Array initialisation failed in lpc4370m0app

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

Array initialisation failed in lpc4370m0app

292 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by JoeE on Tue Sep 09 11:49:45 MST 2014
Hello,
I tried to implement a simple initialized array in an 4370m0app Prozessor application.
The code was someting like this:
volatile int32_t myarray[64]={64312, 64221, ... and so on};
I placed a declaration in the repective .h file:
volatile int32_t myarray[64];
To my surprice the array worked, I could read and write values to it, but it was not initialized. It was filled with zeroes.
When placed in the 4370 m4 application the array was initialized normally. So what is wrong.
My workaround was to put the array back to the m4 application and to hand over an pointer to the m0 application.

Best regards
JoeE
Labels (1)
0 Kudos
1 Reply

285 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Pacman on Tue Sep 09 20:41:12 MST 2014
Sounds like your M0 does not have any 'startup code'.

Eg. make sure that it copies the .data section (and similar sections) to SRAM somewhere.
Also make sure that it clears the .bss section.

I think you can look at startup.c, crt.c or the like.
0 Kudos