MPC5634M Bootloader: flash program

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

MPC5634M Bootloader: flash program

Jump to solution
1,280 Views
jasonhd
Contributor III

Hi, My microcontroller is mpc5634m. I'm developing bootloader. I use the program  got from the forum and modify it,now I can use serial port to download bootloader to RAM and run it in BAM mode. When I execute the program in RAM, I can brush the user application program to the flash address of 0x10000. But when I use the program running in RAM to brush bootloader to flash (0x0000), the program will not be executed. I don't know why? I made the following attempts:
1. Change the address of the user application program to 0x0000, and the program will not be executed
2. Change the address of the user application program to 0x10000, and the program will be executed
3. Change the address of the user application program to 0x20000, and the program will be executed
4. Change the address of bootloader to flash(0x10000), and the program also not  execute(like flash address 0x0000)
Do that need any other settings?
I noticed in the note that if the program swipes to the flash initialization register:

jasonhd_0-1614766893094.png

Is there anything to do with this register? I compared the user application program with the bootloader program, the operation of this register should be the same, but the application program can run, but the bootloader does not.

 

0 Kudos
1 Solution
1,248 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

1. I can see you didn't update EraseFlash() function:

lukaszadrapa_0-1614932413904.png

That means you are not erasing lowest three blocks. If you are going to program an application or whatever to 0x0, it won't work if the flash is not already erased before that.

2. You can simply run

c:\Program Files (x86)\Freescale\CW for MPC55xx and MPC56xx 2.10\pemicro\CW_ICDPPCNEXUS.EXE

and either select "Connect" which will perform reset and enter debug mode, or select "Hotsync" which will not perform reset and it just establishes JTAG communication with running device.

Regards,

Lukas

 

View solution in original post

0 Kudos
5 Replies
1,271 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I have two questions:

1. Are those applications working when you load them via JTAG, not by the bootloader?

2 Once the applications are loaded by your bootloader, did you try to check the content of flash by debugger? In other words, is the application loaded correctly?

I'm asking because I do not understand from the description if it is problem of bootloader loaded by BAM or problem of loaded applications.

Regards,

Lukas

 

0 Kudos
1,262 Views
jasonhd
Contributor III

Thank you.

1. I tested to change the startup address of the user application to 0x00000000. After downloading through JTAG, the program can be executed. In the program, I set to print a line of string through the serial port, and I can see the string printed circularly. But the same .mot file, after I download it to flash through bootloader, there is no string printed out, but I feel that the program may have been loaded into flash, because according to previous tests, if there is no program in MCU, when I send characters to MCU at 115200 baudrate, MCU will always reply with a "?"  in response, whatever I send is a reply to this character.But now when I send any character, there is no response,
2. I use CodeWarrior v2.10, I don't know how to debug .mot file loaded into MCU program by upper computer, because once I click "debug", it will reload the program into MCU through JTAG, I'm not very familiar with it.

I send the following program to the ram of MCU for execution through the upper computer.

0 Kudos
1,249 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

1. I can see you didn't update EraseFlash() function:

lukaszadrapa_0-1614932413904.png

That means you are not erasing lowest three blocks. If you are going to program an application or whatever to 0x0, it won't work if the flash is not already erased before that.

2. You can simply run

c:\Program Files (x86)\Freescale\CW for MPC55xx and MPC56xx 2.10\pemicro\CW_ICDPPCNEXUS.EXE

and either select "Connect" which will perform reset and enter debug mode, or select "Hotsync" which will not perform reset and it just establishes JTAG communication with running device.

Regards,

Lukas

 

0 Kudos
1,239 Views
jasonhd
Contributor III

Flash data and .mot original file are the same, I think the program has been loaded into flash, but I don't know why it is not executed, no response.

jasonhd_1-1614942030831.png

jasonhd_0-1614941976967.png

 

0 Kudos
1,221 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

once it is loaded to the flash, run CW_ICDPPCNEXUS as mentioned above and step the code to see what happens and where it crashes.

Regards,

Lukas

 

0 Kudos