Hi Hercules experts,
I have an silly issue (I reckon) but spent hours to figure out without success.
I use DMA to continuously transfer 12 ADC results to a memory. The memory is defined as static in the adc.c module. ADC is configured to do the conversion continuously, and DMA is triggered when all 12 channels have been converted.
When debugging, the memory address monitored gave me expected results. See picture below.
However, when I read the memory in the application , it gave me the initialised data instead of the ADC data seen above. Insert a breakpoint to the reading adc function, the memory is automatically reset to my initialised data 0xA5, and this is the data I've got in the application instead of ADC data seen above. See picture below
If I cleared the breakpoint and let the the program run freely, then refresh the memory browser, I see the ADC data again in the debug window but not inside the application. Try continuous refreshing also gave me updated ADC results frequently in the debug window only.
I suspect the issue has something to do with memory mapping. Please anyone can explain and give me a suggestion to solve this?
Many thanks.
Phil