Skip to main content
dzbogar
Associate
July 27, 2012
Question

To many elements in the array - stm32f103

  • July 27, 2012
  • 3 replies
  • 876 views
Posted on July 27, 2012 at 21:29

hello,

I have an issue. I'm using the stm32f103RB. When i want to create an array which has 8192 elements - const uint16_t table[8192] = {458,542...  }; The software successfully build in to the flash, but when i'm starting the debug mode, i get an error - ''cannot access memmory'' - error 57 or somethink. The program do not jump to the main. Than i change the array, which has less elements, aboute quarter of previous and the program normali works. I can not find the problem.. 

#stm32f103-flash-memmory-array
This topic has been closed for replies.

3 replies

Tesla DeLorean
Guru
July 27, 2012
Posted on July 27, 2012 at 21:43

Is this in Keil? If using the eval version it could be that you've exceeded the code limit.

Make sure you've picked the correct CPU for the project, and the correct flash algorithm for the part.

Also make sure BOOT0 is not pulled high. Perhaps SWD or JTAG connectivity.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
dzbogar
dzbogarAuthor
Associate
August 1, 2012
Posted on August 01, 2012 at 07:50

Yes, this is in keil uvision. I put the array out of the function ''int main (void)'' - and its working well. But, it should work even if the initialization of the array is in the function. Is this a compiler problem? Thank you for helping =) 

Andrew Neil
Super User
August 4, 2012
Posted on August 04, 2012 at 21:21

''I put the array out of the function 'int main (void)' - and its working well But, it should work even if the initialization of the array is in the function''

Remember that local variables are allocated on the stack...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.