Creating a custom task to run at the start of the debugger (so you can add address offset when downloading file)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Creating a custom task to run at the start of the debugger (so you can add address offset when downloading file)

441 Views
darsnack
Contributor I

Hi everyone

I am using a K70FN1M0VMJ12 Tower Module. When I try to program flash, I get an error about writing to the security area. It appears that offsetting by 0x500 fixes this issue. Unfortunately, from some simple test code, I found that I must be running the debugger in order for my code to run successfully (programming using the flash programmer then hitting reset doesn't work?). When I run the debugger, I get a similar error referring to the secure memory area. To resolve this, I created a custom RunAndDebug task that will erase the device, run a blank check on all sectors, program flash, and verify the write. I set my debug configuration to run this custom task instead of the standard one. I am getting a "Error downloading program". Below are the settings I used for the custom task:

Device: FTFE_PFlash1M0 (128Kx64x1)

Erase: Base Addr = 0x0

Blank Check: Base Addr = 0x0

Program and Verify: File Type = Auto; Addr Offset = 0x500

Any help on anything I mentioned is much appreciated!

Thanks

darsnack

Labels (1)
0 Kudos
1 Reply

344 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Flash configuration address 0x40C is Flash security byte, which will be loaded to FTFE_FSEC register during the chip reset.

If the chip was secured, the debugger couldn't use JTAG interface access Kinetis internal register and memory.

And I also recommend customer to refer C90TFS_FLASH_DRIVER ( TFS Flash Driver Software for Kinetis and ColdFire+ Microcontrollers), which provides example demo for Flash operations.

More detailed info, please refer below link:

http://cache.freescale.com/files/32bit/software/C90TFS_FLASH_DRIVER.exe

Wish it help.

best regards,
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos