Hi to you all,I'm using an LPC4370 (in a link2 probe) to output the data acquired @ 40 MSPS using the USB CDC VCOM driver included in the LPCOPEN Libraries. I can output an array of uint32_t elements and read it properly in Matlab at the host side.Unfortunately though I'm having troubles with arrays declared as follows: I read some strange numbers, not the ones I stored into the array.
__DATA(RAM3) static uint32_t multiChannel[BINS];
Since the application I'm working on has some real time requirements I need to keep the array allocated into RAM and not in flash.To output the array right now I'm passing it to the write method of the driver using a cast to uint8_t and specifying the array length, like:
write(uint8_t*)multiChannel, sizeof(multiChannel));
Wow, this is a strange memory splitting. Anyway, check the map file to see where the array is placed w/o section specifier.
BTW: Where did you get this memory.ld from?
I'm sorry, I know this could be a dumb question, but actually its the first time I dive into linker scripts.. Where is the file you mean supposed to be? I found the .ld one in my Project/Debug directory. Actually 3 files have the .ld extension but no one explicitly mentions the arrays I'm declaring. I'll attach my files to this answer! Thank 42Bastian Schick for the support.2867.myproj_Debug.txt
3225.myproj_Debug_memory.txt
5582.myproj_Debug_library.txt
Wow, those linker-scripts are overly complicated (tool output :( ).Anyway, I see no difference between declaring the array w/ or w/o __DATA(RAM3). In both cases it is placed in RAM.Did you check if it is filled correctly before sending out?
Hi 42Bastian Schick, yesterday I figured it out.I had a problem because my project has a lot of critical data sections which I put in different RAM slots. The RAM3 (which I was trying to use) had already other variables and therefore some interference during read cycles occurred and my data were constantly corrupted... I don't even know why this should happen, not to mention that it actually started after implementing the USB driver for LPCOpen. Re-ordinating everything (now I use 4 RAM sections out of 7 available), solved the issue. It wuould be really interesting to dig more into the thing and fully understand what happened here..