Hi,
I have tried that like below,
1. Created an assembly file and included the data as below
.section rodata
.global mydata
.type mydata, "object"
.align 4
mydata:
.incbin "blinky.bin"
.global mydata_size
.type mydata_size, "object"
.align 4
mydata_size:
.int mydata_size - mydata
NOTE : blinky.bin is my bin file with 3276 bytes in size
2. I have used the below in main .c file
extern int mydata,mydata_size;
static const int *ata ;
unsigned char flash[20];
int main(void) {
ata = &mydata;
memcpy(&flash, ata, 16);
}
It is building without error and warning.
here i am trying to copy of first 16 bytes of ata's data into array flash but is giving some wrong data.
i.e.
I have opened the blinky.bin file using HEX editor NEO. It is having values like below (shown first 16 bytes only)
00 98 00 20 a5 04 00 20 ad 04 00 20 c5 04 00 20 but it is not matching with the values of array flash which was copied by ata (pointed by address of mydata).
3.
Without adding bin file (assembly file is not added), it shows the below at console tab.
make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size "ProxM_GTL.axf"; # arm-none-eabi-objcopy -v -O binary "ProxM_GTL.axf" "ProxM_GTL.bin" ; # checksum -p LPC54101J512 -d "ProxM_GTL.bin";
text data bss dec hex filename
13148 0 408 13556 34f4 ProxM_GTL.axf
After Adding bin file (added of assembly file), it shows the below at console tab.
make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size "ProxM_GTL.axf"; # arm-none-eabi-objcopy -v -O binary "ProxM_GTL.axf" "ProxM_GTL.bin" ; # checksum -p LPC54101J512 -d "ProxM_GTL.bin";
text data bss dec hex filename
13148 0 408 13556 34f4 ProxM_GTL.axf
My questions are ,
1. Whether i missed anything there in section 1&2 ? if it is correct what i have to do next ?
2. is there any other ways to complete this?
3. In section 3, both ways hex file size (34f4) was same, but I think it should be greater of 3276 in the bin file added project , is it correct or bin file is not included?