Hi,
I am porting CW10 project to KDS and encounter difficulties when debugging with latest USBDM (V4.12.1.30). Our target is MK10DX128M7.
I have project reside on FlexNVM with interrupt vectors in 0x0~0x400 just like any normal project. Then, I have another project that is in FLASH, but arranged to avoid using 0x0 ~ 0x7ff (1st FLASH sector) by the linker file:
m_interrupts (RX) : ORIGIN = 0x00001000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00001400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00001410, LENGTH = 0x0001EBF0
This arrangement works in CW V10 using USBDM. But doesn't work in KDS using USBDM. After code is downloaded, it is obvious that problem is due to 0x0 ~ 0x7FF being erased, even I have selected "Selective Erase (by sector)".
Is there a work-around? Thanks!
Jei
Solved! Go to Solution.
Hi Jei,
Using the working copy of USBDM which is slightly later than the release version I was able to do what I believe you were trying but there are several caveats.
The setup I used for the debugger is as follows:
You may have to change the above Reset_Handler depending on your code.
The example changes to the KDS startup code should be similar to:
I tested this on a MK20DX128M5 as follows:
I believe the above should work with the current release version with the modified device file provided earlier. If not it would be best to wait a few days for Version 4.11.1.50 to be released.
bye
Hi pgo,
The new device data file doesn't seem to make any difference. After code download, 0x0 ~0x7FF remains erased.
One more piece of info. The "ARM Programmer" is now good. Though, I am not 100% sure because I wasn't as careful as today. I did this yesterday and today:
Set linker to generate S-record output. Use "ARM Programmer" to program the my target. First, mass-erase the target. Select EraseSelective. Then, open a S-record of 1st project that uses the 0x0 region. Programming is successful. Open S-record of 2nd project that doesn't use 0x0 region. Programming is successful. Use "USBDM Memory Dump" and verified the bits in 0x0~0x7FF are intact, today. (But I believe it was erased when I did the same yesterday.)
Jei
Hi Jei,
Using the working copy of USBDM which is slightly later than the release version I was able to do what I believe you were trying but there are several caveats.
The setup I used for the debugger is as follows:
You may have to change the above Reset_Handler depending on your code.
The example changes to the KDS startup code should be similar to:
I tested this on a MK20DX128M5 as follows:
I believe the above should work with the current release version with the modified device file provided earlier. If not it would be best to wait a few days for Version 4.11.1.50 to be released.
bye
Hi pgo,
Thanks for you time. Security Option is the trick!!
But my project runs to never land in the debugger. So something is still wrong. Though, that will be a different thread after I characterize it.
Thanks again!!!
Jei