Fill unused bytes of ROM with 0xFF

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

Fill unused bytes of ROM with 0xFF

3,839 次查看
manjunathkm
Contributor III

Hello,

Can anyone guide me with settings required in the IDE to fill unused bytes of ROM location with 0xFF in hex file

I am creating hex file for application that am going to load using CAN bootloader. But the application hex file is created only for the code available. But in my case, i am suppose to fill the unused bytes with 0xFF, So that bootloader will program entire flash memory allocated for the application.

Can someone help with this

thanks in advance..

Manjunath

标记 (1)
3 回复数

2,878 次查看
bobpaddock
Senior Contributor III

The erased flash will be 0xFF by default no need to rewrite.

Do you mean there is more than one section that needs to be separated by 0xFF's?

The linker script can be modified:

FILLing unused Memory with the GNU Linker | MCU on Eclipse 

or  SRecord 1.64  can be used to add fill bytes  during the build process.

0 项奖励
回复

2,878 次查看
manjunathkm
Contributor III

Hi Bob,

The link that you have shared is more useful

I am able to fill with 0xFF in the hex file using below script

.fill :
{
FILL(0xFFFFFFFF);
. = ORIGIN(FLASH_2) + LENGTH(FLASH_2) - 1;
BYTE(0xFF)
___ROM_AT = .;
} > FLASH_2

Many Thanks

Manjunath

2,878 次查看
manjunathkm
Contributor III

Hi Bob,

I have only one section, Lets say its starts from 0x00010000 and size is 0xFFFF.

Currently the hex file generated only for the used memory, means for the code available. But I have to generate hex file for entire size, So unused location in the hex file shall be filled with 0xFF

Many Thanks

Manjunath

0 项奖励
回复