CUSTOM BOOTLOADER FOR MPC5777C

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

CUSTOM BOOTLOADER FOR MPC5777C

2,959 次查看
RAMK
Contributor I

we are developing a custom bootloader for MPC5777C taking the reference of MPC5748 code workspace, where some .c extension files such as FlashCheckStatus, FlashErase, FlashProgram are in the form of lookup table. Are these files same for MPC5777C microcontroller ??? because we are getting certain errors as attached in the link below.

Please help us out with the solution to following errors.

 

0 项奖励
回复
3 回复数

2,916 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @RAMK 

There are these SSD flash drivers used in the application note:

https://www.nxp.com/webapp/Download?colCode=C55_NVM_SSD

The drivers support all MPC57xx including MPC5777C.

The only difference is that the flash blocks are different in comparison with MPC5748G. You can check files in this folder:

c:\Program Files (x86)\Freescale\Standard Software Driver v1.1.0\MPC57xx\Demos\Demo_code\MPC5777C\

Next point is that MPC5777C is the only one from MPC57xx family where you can select between BOOKE and VLE instructions. All other MPC57xx are VLE only devices. The driver contains both versions, one for BOOKE, second for VLE, so make sure you are using the right one.

Now regarding the errors - functions FlashErase and FlashProgram are forced to RAM memory to avoid Read-While-Write issues. You can see in the files:

//const unsigned long FlashErase_C[] =
//place to RAM memory:
unsigned long FlashErase_C[] =

Default drivers use "const". I simply removed the const, so the function is automatically copied to RAM by startup files. Easiest way...

Now it looks like the distance from flash to RAM is out of relative jump range. I can remember that CodeWarrior had an option like "Tune relocations" to solve this problem. I can see that you use GHS and I'm, not really sure how to configure this. Maybe you can ask GHS directly.

Regards,

Lukas

 

 

0 项奖励
回复

2,897 次查看
RAMK
Contributor I

HI @lukaszadrapa 

Thank you

1. After including the driver files which you shared earlier , all the compilation errors got resolved.

However while running the code, in teraterm I am getting erase successful message but when I look into the particular memory location the block is not erased. We are using 32MHz clock in our project and Teraterm is configured at baud rate of 115200. 

For MPC5777C I have modified the following lines of code as mentioned in the below attachment. Can you please tell whether the modified lines are correct ?

2. Also when I try to send S record file I am getting an error saying S record length must be even. Can you please help us with this error? 

0 项奖励
回复

2,823 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi @RAMK 

1. Did you updated this in main.c:

#define C55_REG_BASE 0xFFFE0000
#define MAIN_ARRAY_BASE 0x00404000
#define C55_PROGRAMMABLE_SIZE 0x80

to this?

#define C55_REG_BASE 0xFFFE8000
#define MAIN_ARRAY_BASE 0x00000000
#define C55_PROGRAMMABLE_SIZE 0x80

As I mentioned earlier, the flash blocks and flash addresses are different.

2. Please read section "5.1 S-record format" in AN5319. The s-records should be aligned and should have the same length to simplify the parsing and programming.

Regards,

Lukas

0 项奖励
回复