FlashProgrammer fails 0x2010 bytes into a 0x4020 byte program on MPC5604B

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

FlashProgrammer fails 0x2010 bytes into a 0x4020 byte program on MPC5604B

Jump to solution
949 Views
jonah_ryan-davi
Contributor I

I'm having trouble flashing the MPC5604B.

I tried this on two different chips with the same results.

It also doesn't seem to matter which location in memory is being flashed, it just fails after the Flash Programmer script tries to program 0x4020 bytes.

I tested this by creating a new MPC5604B project and using the default connection for flashing.

Here's the Flash Programmer output:

fl::target -lc "LC for Simple Flash (8)"
fl::target -b 0x40000000 0xa000
fl::target -v off -l off
cmdwin::fl::device -d "MPC5604B_CODE_FLASH" -o "512Kx32x1" -a 0x0 0x7ffff
cmdwin::fl::image -f "C:\\git\\firmware\\build\\BOOT_MPC5604B\\BOOT_MPC5604B_FLASH.mot" -t "Auto Detect" -re on -r 0x0 0x7ffff -oe off
cmdwin::fl::erase image
Beginning Operation ...
-------------------------
Auto-detection is successful.
File is of type Motorola S-Record Format.

Performing target initialization ...
reading SSCM.STATUS ...
processor in single chip mode.
searching for boot sectors ...
found boot sector at 0x0 and entry point at 0xd0.
Downloading Flash Device Driver ...
Reading flash ID ...
Erasing Sector 0x00000000 to 0x00007FFF
Erasing Sector 0x00008000 to 0x0000BFFF
Erasing Sector 0x00010000 to 0x00017FFF
Erasing ...
Erase Command Succeeded
cmdwin::fl::write
Beginning Operation ...
-------------------------
Using restricted address range 0x00000000 to 0x0007FFFF
Programming file C:\git\firmware\build\BOOT_MPC5604B\BOOT_MPC5604B_FLASH.mot
Auto-detection is successful.
File is of type Motorola S-Record Format.

Downloading Flash Device Driver ...
Reading flash ID ...
Auto-detection is successful.
File is of type Motorola S-Record Format.

Downloading 0x00000008 bytes to be programmed at 0x00000000
Executing program ....
Program Command Succeeded
Downloading 0x000000B8 bytes to be programmed at 0x00000010
Executing program ....
Program Command Succeeded
Downloading 0x00000080 bytes to be programmed at 0x000000D0
Executing program ....
Program Command Succeeded
Downloading 0x00000194 bytes to be programmed at 0x00000150
Executing program ....
Program Command Succeeded
Downloading 0x000000F4 bytes to be programmed at 0x00001000
Executing program ....
Program Command Succeeded
Downloading 0x000000A8 bytes to be programmed at 0x00001100
Executing program ....
Program Command Succeeded
Downloading 0x00004020 bytes to be programmed at 0x00003000
Executing program ....
Executing program .....
Executing program ......
Executing program .......
Executing program ........
Executing program .........
Executing program ..........
Executing program ...........

It just keeps doing that

If I check the memory of the device, I can see it programmed up until 0x00005010, exactly half of the record it was trying to program.

Where is this script stored and how can I modify the behavior of Flash Programmer to get this working?

0 Kudos
1 Solution
810 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Jonah,

 

it seems to be a bug in the Flash Programmer – I’m able to reproduce the behavior when large s-record file is used. I will report it to CodeWarrior team.

As a workaround, I can see that it works if you use “Debug” button to program the project to MCU instead of Flash Programmer. Could you try if this works on your side?

 

Regards,

Lukas

View solution in original post

0 Kudos
4 Replies
810 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

could you:

- tell me which version of CodeWarrior do you use?

- send me the s-record file which causes the problem?

If you try to use another s-record file (just default project with endless loop, for example), is it working?

Regards,

Lukas

0 Kudos
810 Views
jonah_ryan-davi
Contributor I

Hi,

I'm using CW 10.7  Build Id:160721

It doesn't seem to depend on the S-record file, I tried with other files, including the default project with this added to the top of main (to make sure the programmer had enough bytes that it would try to program 0x4020 bytes):

const int table[4096];
‍‍‍‍‍

Attached is the file from that project which fails

To be clear, the default project itself works, but the programmer doesn't program any large sections

0 Kudos
811 Views
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi Jonah,

 

it seems to be a bug in the Flash Programmer – I’m able to reproduce the behavior when large s-record file is used. I will report it to CodeWarrior team.

As a workaround, I can see that it works if you use “Debug” button to program the project to MCU instead of Flash Programmer. Could you try if this works on your side?

 

Regards,

Lukas

0 Kudos
810 Views
jonah_ryan-davi
Contributor I

Hi Lukas,

Thanks for the help!

Yes, I forgot to mention it works with the Debug option. However in this case we need to flash an s-record with a slight modification, so we will have to find a different workaround.

Jonah

0 Kudos