AnsweredAssumed Answered

How to flash MPC56 by Jtag the memory "Data Flash 64K" ?

Question asked by on Nov 6, 2019
Latest reply on Nov 12, 2019 by



does anyone know how to flash with Jlink by Jtag the memory "Data Flash 64K" on MPC5602D (or Family MPC)?


Usually I flash my .elf for debug with IC5000 that works well. But it need some licence with WinIdea.

With the Jtag I just add a pull down on Nrest and GND.

SWD is not allow on the Nexus 1, so I use Jtag conf.


I made some .jlinkscript to flash my µC from my .elf file with 3 parts (converted into .srec with srec_cat.exe):


Flash Code 256KB : 0x00000000 - 0x00003FFFF

Data Code 64KB : 0x00800000 - 0x0080FFFF

SRAM 16 KB : 0x40000000 - 0x40003FFF


I tried to flash the full .srec, but when flashing there is error of writing.


I tried to flash separate 3 parts. Flash Code and SRAM are well flashed, but not Data Code, so my software running, but with bad config data.


In the datasheet I see that to Flash the Data Flash the Code Flash must be powered.


So I try to add the "power on perm" command in my script but it changed nothing.

My µC is already externaly powered, so the option Jlink is up but the ITarget still 0mA (because no consumption on JLink)


I tried too to unlock memory by this option in my script, that's seems to be the only device working.


//unlock flash
unlock LM3Sxxx


Here is one of my script.jlinkscript :


device MPC5602D
//configure JTAG
si jtag
//Autodetect IRPre and DRPre
JTAGConf -1,-1
//1600Khz is the max for MPC5602D, known using command "hwinfo"
speed 1600



//load 3 parts

loadfile ".\BinToFlash\my_file_3parts.srec"


//load part by part, other option to uncomment

//loadfile ".\BinToFlash\my_file_part_ONE.srec"
//loadfile ".\BinToFlash\my_file_part_SRAM.srec"
//loadfile ".\BinToFlash\my_file_part_DATA.srec"


//reset delay 5ms, made in other script call by my .bat
//rx 100

//going out the script to run other script



//g made in other script call by my .bat



If someone have some issue or any idea to search for.

Thank you.