problem while flashing program to MPC5744

cancel
Showing results for 
Search instead for 
Did you mean: 

problem while flashing program to MPC5744

Jump to solution
899 Views
WayneCherish
Contributor I

I met a problem while flashing program to MPC5744.

Firstly, when I set [un-check] to "Attatch to Running Target" in Startup page of Flash configuration,  i can see my project running with PE debugger. But when I reset the MPC5744, or when I disconnect my PE and use 12V power, an elder version of project runs.

 

Secondly, when I set [check] of this item, the error show as below:

Connection from "127.0.0.1" via 127.0.0.1. Connection from port "54999" to 7224
PE-ERROR: Warning. Can't read registers while part is running.
PE-ERROR: Warning. Can't read memory while part is running. @0 (4 bytes)
PE-ERROR: Warning. Can't read memory while part is running. @0 (4 bytes)
PE-ERROR: Warning. Can't read memory while part is running. @0 (4 bytes)
PE-ERROR: Warning. Can't read memory while part is running. @0 (4 bytes)
PE-ERROR: Warning. Can't read memory while part is running. @4002d44(4 bytes)
PE-ERROR: Warning. Can't read memory while part is running. @4002d44(4 bytes)
PE-ERROR: Warning. Can't read memory while part is running.  @4002d44(4 bytes)
Interrupt command received. Halting execution.
No breakpoints currently set.
Disconnected from "127.0.0.1" via 127.0.0.1. Disconnection by port "54999" from 7224
Target Disconnected.

 

In conclusion, I try these method, but neither of them can make me flashing my new project.

HELP!

0 Kudos
1 Solution
894 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

if you can see that old version of your project is running after disconnection of PE or after power-on - are you sure that you didn't select RAM target in Debug Configurations by mistake?

There are two typical use-cases how to configure it:

1. You want to load new code to flash. In this case, it's necessary to enable "Load executable" and also "Load symbols" to see the source code when debugging. Do not select "Attach to Running Target" here:

lukaszadrapa_0-1610987599078.png

 

2. You want to do a "hot attach" only to debug code which is already programmed in flash and which is running (you are not going to program the flash again). In this case, disable "Load executable" and enable "Attach to Running Target":

lukaszadrapa_1-1610987729053.png

You can get a message that the debugger can't read some registers or memory because the device is already running (real-time access is not supported by this debugger). Just stop the execution to see all resources.

Note: Source level debug of a running target is only possible if the sources of the project to be attached exactly match the binary code running on the target.

 

Regards,

Lukas

 

 

View solution in original post

0 Kudos
4 Replies
895 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

if you can see that old version of your project is running after disconnection of PE or after power-on - are you sure that you didn't select RAM target in Debug Configurations by mistake?

There are two typical use-cases how to configure it:

1. You want to load new code to flash. In this case, it's necessary to enable "Load executable" and also "Load symbols" to see the source code when debugging. Do not select "Attach to Running Target" here:

lukaszadrapa_0-1610987599078.png

 

2. You want to do a "hot attach" only to debug code which is already programmed in flash and which is running (you are not going to program the flash again). In this case, disable "Load executable" and enable "Attach to Running Target":

lukaszadrapa_1-1610987729053.png

You can get a message that the debugger can't read some registers or memory because the device is already running (real-time access is not supported by this debugger). Just stop the execution to see all resources.

Note: Source level debug of a running target is only possible if the sources of the project to be attached exactly match the binary code running on the target.

 

Regards,

Lukas

 

 

0 Kudos
882 Views
WayneCherish
Contributor I

Hi, Lukas:

Thank you for your explanation!

I follow your instruction and especially not select "Attach to Running Target" .

Still, new code can run normally in debug mode, but after reset old version runs, it driving me crazy!

 

Here is my concern:

1-I can not set my project to DEBUG_FLASH mode(only DEBUG, DEBUG_RAM available) 

2-What is the difference between DEBUG_FLASH mode and the flash function(with the "lightning" symbol)

 

Looking forward to your reply.

 

Best regards!

 

Wayne

0 Kudos
877 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Wayne,

DEBUG or DEBUG FLASH forces the code to the flash memory, it will run also after disconnection of debugger. DEBUG_RAM forces everything to RAM memory - it's for fast testing and debugging when the project is not too large (less than size of RAM). It does not touch the flash ever, obviously it won't work after reset. There are separate linker files for both modes.

Not sure what's wrong on your side. Could you make a screenshot of your Debug Configurations window? I would like to see Main and Startup tabs.

If you can see that old version of your project is running after reset, it really looks like you use DEBUG_RAM target by mistake.

Regards,

Lukas

 

862 Views
WayneCherish
Contributor I

Hi Lukas:

 

Problem solved!

It is that I use DEBUG_RAM mode.

 

Thank you!

Good luck!

 

Wayne

0 Kudos