AnsweredAssumed Answered

Putting a variable in code memory

Question asked by Mike U on Jun 4, 2014
Latest reply on Jun 5, 2014 by Mike U

I want to declare an array of constant values and have them put into code memory.

Something like this:
const uint16_t my_array[4] = {0x3456, 0x789A, 0x1234, 0x9876};

I want to be able to download the code and then start up STM32 ST-LINK Utility and search for one of the values and find the whole array.

I'm pretty sure I can do it using #pragmas and/or attributes and maybe the scatter file ... but I just haven't figured out the right combo.

I'm using Keil uvision and a STM32F401.

I'd appreciate any help I can get.