How can I read the hex code of the main programme stored inside flash memory inside my running Arduino programme?
So far I am able to read the Flash at any given address by using PROGMEM
unsigned int displayInt;
int k; // counter variable
void setup() {
Serial.begin(9600);
while (!Serial); // wait for serial port to connect. Needed for native USB
for(k = 0; k < 5; k++) {
displayInt = pgm_read_word_near(k);
Serial.println(displayInt);
}
}
void loop() {
}
The output is
37900
13716
53
3072
37900
But this not hex code.
I am implementing the OTA (over the air) feature. I will get the new version of a code from GPRS. It will be huge code so I will write it to flash by using the custom bootloader mentioned in this thread. I am able to write to the flash memory. Now I would like to read the data from flash. To begin with I would like to read the main programme inside my main programme.