cancel
Showing results for 
Search instead for 
Did you mean: 

I want to read/write to the FLASH of STM32G071.

Pankaj
Associate

 I am using the Nucleo-G071RB dev board along with it's demo code. It runs fine in run mode however in debug mode I cannot see the data at the specified memory locations. I am using Keil IDE (first time user of Keil) for writing the code.. Is there any setting or anything that I need to change in Keil or anyother place to view the memory contents while in debug mode. I want to confirm if the data is actually being written at the specified memory address. Any help is highly appreciated.

5 REPLIES 5
Pavel A.
Evangelist III

What means "cannot see"? When you open the memory pane in the Keil (uVision) debugger, and point it to the address, what happens?

Do you have latest uVision update (5.28) ?

Note that you cannot change content of flash in the memory view. Only read.

-- pa

Pankaj
Associate

I am trying to read the memory @ 0x8002400 and all I see is "00 00 ...."

#define FLASH_USER_START_ADDR  (FLASH_BASE + (3 * FLASH_PAGE_SIZE))  /* Start @ of user Flash area */

#define FLASH_USER_END_ADDR   (FLASH_BASE + FLASH_SIZE - 1)  /* End @ of user Flash area */

Here #define FLASH_BASE      (0x08000000UL) /*!< FLASH base address */ (in the ST Micro demo code)

#define FLASH_PAGE_SIZE         0x800u

#define DATA_64         ((uint64_t)0x1234567812345678)

I ran the debugger again and this time noticed in the Command window saw the foll. error messages:

"error 65: Access violation at 0x40022000: no "read" permission" etc...

No I do not have the uVision update. I am running uVision V5.26.2.0

I have attached a screenshot of the debug window.

Use REAL hardware not the simulator, the simulators doesn't know anything useful about your hardware or the flash controller.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Pavel A.
Evangelist III

It's suspicious that the debugger reads from 0x4002200. Is a watch set of some peripheral address?

Try to remove it and get rid of this message.

Else, you may want to ask in Keil forum. They have some issues with the debugger in v. 5.26,2.

-- pa

No it is the address of the FLASH controller on the AHB bus

Error 65 is the ID-TEN-T error for the simulator, which doesn't support the hardware.

https://www.st.com/content/ccc/resource/technical/document/reference_manual/group0/2f/21/cb/33/78/80/42/64/DM00371828/files/DM00371828.pdf/jcr:content/translations/en.DM00371828.pdf

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..