Page 1 of 1

#define accesible at specific location in flash?

Posted: Fri May 03, 2019 8:49 pm
by _kyle_
I have a #define that I would like to be accessible at a specific location in flash. Is there an easy way to do this?

Example: during OTA I want to extract the version code from the new bin directly.

Code: Select all

#define VERSION_CODE 1

//example location 0 of the user_app.bin where VERSION_CODE was compiled to
uint8_t versionCode = userAppBin[0];

Re: #define accesible at specific location in flash?

Posted: Sat May 04, 2019 1:55 pm
by tommeyers
It sounds like you may need to study the preprocessor and how that works. In short: #define does not directly put anything in memory; You can use it to do that and a lot more. I recommend that you study a little.

Re: #define accesible at specific location in flash?

Posted: Sat May 04, 2019 3:07 pm
by WiFive