bin file as an array

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

bin file as an array

739 Views
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!

Tags (3)
0 Kudos
1 Reply

592 Views
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 Kudos