Hello *,
I try to port a project on frdm-k64f (700-28163 REVA/SCH-28163 REVC) and I am facing flashing issue.
I am using :
- a modified version of linker script (MK64FN1M0xxx12_flash.ld) with added sections
- a modified version of assembler file (startup_MK64F12.S) that just disable IRQ and jump to C code
(Flash configuration is not modified)
The original files come from installation of KSDK 1.3.0 and I use GNU toolchain on a GNU/Linux
host.
The sections .interrupts, .flash_config and .text has same addresses of ELF file generated
from hello_world example located in $KSDK/examples/frdmk64f/demo_apps/hello_world/kds/debug.
When I try to flash binary with openOCD coming from KDS (3.2.0-1), I lose control from
debugging interface and get following messages from openOCD
8<---
[..]
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 100ms
Polling target k64.cpu failed, trying to reexamine
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 300ms
Polling target k64.cpu failed, trying to reexamine
Info : SWD DPIDR 0x2ba01477
Info : SWD DPIDR 0x2ba01477
Error: Failed to read memory at 0xe000ed00
Examination failed, GDB will be halted. Polling again in 700ms
Polling target k64.cpu failed, trying to reexamine
--->8
Debugging LED stays in RED and I can do nothing with target...
Some topics from NXP forum look like my issue :
- https://community.nxp.com/thread/375103#comment-566948
- https://community.nxp.com/message/443763?
I try them but they don't solve my issue.
I can only "unbrick" the board with *upstream* openOCD (0.10.0-dev-00321-gd4b7cbf (2016-05-27-16:48))
with command *kinetis mdm mass_erase* from telnet interface.
So .flash_config with values
8<---
Hex dump of section '.flash_config':
0x00000400 ffffffff ffffffff ffffffff feffffff ................
--->8
OR
8<---
Hex dump of section '.flash_config':
0x00000400 ffffffff ffffffff ffffffff fefdffff ................
--->8
don't change anything..
In my use case it is not possible to debug *one* line of loaded binary..
I implement NMI exception handler to see if i can help but nothing change..
Moreover I can observe when openOCD lose control :
8<---
Debug: 101105 45154 command.c:143 script_debug(): command - ocd_k64.cpu ocd_k64.cpu invoke-event reset-end
Debug: 101106 45154 cmsis_dap_usb.c:522 cmsis_dap_swd_run_queue(): Executing 3 queued transactions
Debug: 101107 45154 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): DP write reg 8 10
Debug: 101108 45154 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): AP read reg 0 0
Debug: 101109 45154 cmsis_dap_usb.c:545 cmsis_dap_swd_run_queue(): DP read reg c 0
Debug: 101110 45156 cmsis_dap_usb.c:583 cmsis_dap_swd_run_queue(): SWD ack not OK: 2 FAULT
--->8
Does anyone face this issue?
Did I miss something from vectors initialization, linker script or compiler option?