MPC5748G LCEVB Flash Programming

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

MPC5748G LCEVB Flash Programming

624 Views
PaddyChan
Contributor III

Hi,

I am using the MPC5748G LCEVB with S32DS Power 2.1 and I am trying to program the device so that it can continue running the programmed code after a power cycle.

I have attempted to burn the program into Flash using the Blinking LED tutorial provided on the official website (https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/HOWTO-Create-a-Blinking-LED-Project-M...), using both Build Release and Debug Release.
However, whenever I press the external reset button during power on or perform a power cycle, the program stops running and cannot continue.

According to this URL
https://community.nxp.com/t5/MPC5xxx/MPC5748G-flash-start-address-flashStart-1000000/m-p/821300/thre...
I have modified my flash memory as follows:

flash_rchw: org = 0x00F90000,len = 0x4
cpu0_reset_vec: org = 0x00F90000+0x10, len = 0x4
cpu1_reset_vec: org = 0x00F90000+0x14, len = 0x4
cpu2_reset_vec: org = 0x00F90000+0x04, len = 0x4

m_text : org = 0x00F94000, len = FLASH_SIZE

However, I am still unable to have the program continue running after a reset or power cycle.

When I finish debugging and before executing, I can see that both RAM and Flash memory contain data, as shown in the figure.

0x00F90000:
PaddyChan_0-1684487549916.png

0x00F94000:
PaddyChan_1-1684487585485.png

0x40000000:
PaddyChan_2-1684487633306.png

 

The data in RAM gets cleared when I press the reset button, but the data in Flash remains. However, the program is not executing either.

I'm not sure if there is a problem with my project settings that prevents me from directly burning and running the program in Flash.
Alternatively, is there an example I can test that allows me to burn the program into Flash and continue using it after a power cycle?

I have already tried debug Flash in the MPC5748G SDK Example Project, but I still cannot continue execution after a power cycle or reset.

Best Regards,
Paddy

0 Kudos
7 Replies

602 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

I tested attached project (I need to modify it slightly because I have only EVB). And there is no issue on my side. There was some strange settings in debug configurations which I fixed. The modified project is in attachment. After reset or power cycle - the board LED stats blinking. 

If you have Mother Board - just remove DEVIT define in main.c: 

jiri_kral_0-1684499623689.png

 

0 Kudos

580 Views
PaddyChan
Contributor III

Hi,

Thank you for your quick response.
After commenting out the define DEVKIT, when I was debugging, I was asked to power cycle.

PaddyChan_0-1684736152430.png

When I turned off and restarted the power, it threw this warning and error.

PaddyChan_1-1684736196564.png

PaddyChan_2-1684736218347.png

Best Regards,
Paddy

 

0 Kudos

575 Views
PaddyChan
Contributor III

According to the method shown in the diagram. 
"Turn the power off, press and hold the reset button, turn the power on. Now release the reset button and press "Connect" within 300ms."
PaddyChan_0-1684737221383.png

I adjusted the debug configuration by setting a 300ms delay after reset.
The debug configuration was successful.
However, after executing it and then turning off and restarting the power, the LED stopped emitting light.

PaddyChan_0-1684737816197.png

 

 

 

0 Kudos

565 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

if you attach to running target - are you able see where the program execution ends? 

jiri_kral_0-1684746402750.png

 

0 Kudos

561 Views
PaddyChan
Contributor III

Hi,

Thank you for your reply.
After restarting the power supply following the completion of the debugging process, I ran the program again using the configuration mentioned earlier.
I paused the program and used the "Instruction stepping mode" by pressing "step into" repeatedly.
I observed that it continuously looped at the addresses 00f8c3e4, 00f8c3e8, 00f8c3ec, 00f8c3ee, and 00f8c3f0.

PaddyChan_1-1684756917612.png

I'm not sure if this is the content you would like me to test.

Best Regards,
Paddy

0 Kudos

518 Views
jiri_kral
NXP Employee
NXP Employee
0 Kudos

520 Views
jiri_kral
NXP Employee
NXP Employee

Hi, 

in my attached project - there is no code around the address 0xF8C3E4.  The RCHW starts on 0xF90000. There is probably some un-erased old code which starts instead the blinking LED. Some Boot Loader? 

0 Kudos