I'm trying to port ChibiOS 3.0 on Freescale K64F in order to understand certain mechanisms and take a look deeper in this RTOS. Before to start, I'm configuring ChibiStudio (on Windows) and I have a problem related to the OpenOCD part.
Well, I know this is off-topic but the internet seems to be outdate on this topic,so I hope someone has faced (and solved) the same problem before. I'm using Open-SDA with CMSIS-DAP debug support. I have configured a new entry into external tools launching OpenOCD using as interface "cmsis-dap.cfg" but something goes wrong. It seems like the flash is in a secured state since I have received this reply:
Code: Select all
Open On-Chip Debugger 0.10.0-dev-00200-gdb56a3b (2016-02-10-18:08)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : only one transport option; autoselect 'swd'
Info : add flash_bank kinetis k60.flash
adapter speed: 1000 kHz
none separate
cortex_m reset_config sysresetreq
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : CMSIS-DAP: FW Version = 1.0
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 0 TDO = 0 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 1000 kHz
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 100ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 700ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 1500ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 3100ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ef40
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ef44
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe0002000
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe0001000
Info : k60.cpu: hardware has 0 breakpoints, 0 watchpoints
Warn : MDM: Secured MCU state detected however it may be a false alarm
Warn : MDM: Halting target to detect secured state reliably
Warn : target was in unknown state when halt was requested
Info : SWD IDCODE 0x2ba01477
Warn : MDM: Target not halted, trying reset halt
Info : SWD IDCODE 0x2ba01477
Info : SWD IDCODE 0x2ba01477
Warn : *********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********
Warn : **** ****
Warn : **** Your Kinetis MCU is in secured state, which means that, ****
Warn : **** with exception for very basic communication, JTAG/SWD ****
Warn : **** interface will NOT work. In order to restore its ****
Warn : **** functionality please issue 'kinetis mdm mass_erase' ****
Warn : **** command, power cycle the MCU and restart OpenOCD. ****
Warn : **** ****
Warn : *********** ATTENTION! ATTENTION! ATTENTION! ATTENTION! **********
Now, I have issued the command "kinetis mdm mass_erase" and OpenOCD works...
Code: Select all
Info : SWD IDCODE 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 6300ms
Polling target k60.cpu failed, trying to reexamine
Info : k60.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : MDM: Chip is unsecured. Continuing.
k60.cpu: target state: halted
target halted due to debug-request, current mode: Thread
Until I disconnect/reconnect the USB: in this case the Flash comes back in a secured state...
Suggestions?
Regards,
RM