I'd suggest to link the binary data with your application.
First copy the binary file to your project folder (e.g. root project folder within workspace)
Edit the linker file (.ld) and enter the binary file commands behind the MEMORY Section.
In the SECTIONS please specify where to place the binary file (in the example below it is placed at the end of .text section). You can specify your own section if you need to place the binary file at a specific address.
MEMORY
{
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x00000400
m_flash_config (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0007FBF0
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00008000
m_data_2 (RW) : ORIGIN = 0x20000000, LENGTH = 0x00007000
}
TARGET(binary)
INPUT (..\test.bin)
OUTPUT_FORMAT(default)
SECTIONS
{
.interrupts :
{
__VECTOR_TABLE = .;
...
.text :
{
. = ALIGN(4);
*(.text)
*(.text*)
*(.rodata)
*(.rodata*)
*(.glue_7)
*(.glue_7t)
*(.eh_frame)
KEEP (*(.init))
KEEP (*(.fini))
. = ALIGN(4);
..\test.bin
} > m_text
...
NOTE:
Linker creates automatic symbols with start and end address for the binary data which you can reference in your code. Check the map file output:
*(.glue_7t)
.glue_7t 0x0000080c 0x0 linker stubs
*(.eh_frame)
*(.init)
*(.fini)
0x0000080c . = ALIGN (0x4)
..\test.bin()
.data 0x0000080c 0x48 ..\test.bin
0x0000080c _binary____test_bin_start
0x00000854 _binary____test_bin_end
.vfp11_veneer 0x00000854 0x0
.vfp11_veneer 0x00000854 0x0 linker stubs
.v4_bx 0x00000854 0x0
...
Hope it helps.
Stan