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?
Hi,
first we need to know the problem is on open OCD interface or project. if you create a new project with wizard, can you download this project vis OpenOCD to target?
Can you download the default project C:\Freescale\KSDK_1.3.0\examples\frdmk64f\demo_apps\hello_world\kds to board without problem?
if the problem is only on your specific project, please send your project to me, I will check it on my side.
Have a great day,
Jennie Zhang
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello,
Thanks for your quick answer (:
Yes I can download the binary hello_world_frdmk64f.elf just after mass erasing board with openOCD and debug it
with no issue.
The project is confidential and I can only send you binary (ELF) in a private channel..
It will be possible to explain problem solution in this forum without publishing binary and I hope we can catch this issue..
We already exchange with NXP through *encompass extranet*.
Is it an appropriate channel to send you this binary?
Let me know if there is a better solution.
Hello *,
Finally find the problem.
It concerns semihosting option of OpenOCD in gdb script file.
So add :
monitor arm semihosting enable
solve the issue.
Have a nice day.
thanks for sharing the solutions.
so I may understand your code includes semihosting functions, which need enable semihosting in debugger to support it. Correct?