bin file as an array

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

bin file as an array

909 次查看
jjr_net
Contributor I

hello,

There is a bin file, which is treated as normal data.Now, to build a project in the IDE of S32DS, how can this project directly take out the data in bin file and use the bin file as an array?

thank you!

标记 (3)
0 项奖励
回复
1 回复

762 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

the simplest way is add the binary file on specific address by linker script. Something like: 

MEMORY

{

 m_bindata              (RX)  : ORIGIN = 0x00007FF0, LENGTH = 0x000002FF

.

.

.bindata :
{
KEEP(*(.bindata))

} > m_bindata

and include the binary data in some .S file - for example - startup.S :

.section .bindata, "a"
.incbin "data.bin"

Hope it helps. 

Jiri 

0 项奖励
回复