#define accesible at specific location in flash?

_kyle_
Posts: 1
Joined: Fri May 03, 2019 8:27 pm

#define accesible at specific location in flash?

Postby _kyle_ » Fri May 03, 2019 8:49 pm

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];

tommeyers
Posts: 77
Joined: Tue Apr 17, 2018 1:51 pm
Location: Santiago, Dominican Republic

Re: #define accesible at specific location in flash?

Postby tommeyers » Sat May 04, 2019 1:55 pm

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.
IT Professional, Maker
Santiago, Dominican Republic


Who is online

Users browsing this forum: MSN [Bot] and 19 guests