#include <stdint.h> // Standard integer types
int main(void) {
volatile uint8_t *inputImageData = (volatile uint8_t*)0x40000000;
volatile uint8_t *outputGrayscaleData = (volatile uint8_t*)0x50000000;
uint8_t odata = *inputImageData; // Reading the original data
*inputImageData = 0xAB; // Writing to input image data for test
uint8_t readData = *inputImageData; // Reading back the data
*outputGrayscaleData = 0x66; // Setting first byte of output data
*(outputGrayscaleData + 1) = readData; // Copying read data to the second byte of output
*(outputGrayscaleData + 2) = odata; // Copying original data to the third byte of output
return 0;
}
A hex file of a PNG image is mapped onto compiler memory at 0x40000000. However, I can’t seem to read the data from the said address no matter what I try. I’ve tried de-referencing pointer to the address and it will always show up as 00 and nothing else. I’ve tried different types to see if it’s the issue with address size but none of them seem to be successful at reading values loaded in the address in Keil MDK. Is there specific way to effectively read values from memory in KEIL MDK ARM V7? Thank you for your help!
Ehgus Rnjs is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.