STM32G030F6P6TR Memory flash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-30 07:21 AM
Hello to everyone,
I have an issue with the MCU in the title. I am about to show you my problem in some steps:
1- What is the flash memory size of my microcontroller? I consulted the datasheet of device and I read:
So, for this series, I can have up to 64 Kbytes of memory flash. Specifically, for this package I should have a 32 Kbytes memory flash. Right?
2- Where can I store my application data in the memory flash?
I taked a look to 'Build Analyzer' in STM32cubeIde and I saw the size of FLASH: 32 KB, and the used space 30.96 Kb, about 96.77 % of the space.
With 'Memory' tool I saw every sector of the flash and where the memory address is out of range, it shows me a series of '?' like follow:
but, where I thinked to be out of range I see that:
Is that unsed flash memory space or what?
From the datasheet I see the memory organization: For the main memory there is 2k for each page, so in my case I should have only 16 available pages (?).
Ignoring that, I started to store my data at page 31 with address 0x0801 0000 and the program seems to work :dizzy_face:
Here's my stored data:
using the following function:
#define FLASH_PAGE_TO_ERASE 31
#define FLASH_DATA_ADDRESS (0x0800F800) //page 31 address
MEMORY
{
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 48K
}
Solved! Go to Solution.
- Labels:
-
Documentation
-
Flash
-
STM32G0 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-30 07:37 AM
ST uses the same die for multiple chips, but only tests the portion of FLASH guaranteed by the datasheet. In your case, that's 32kB starting at 0x08000000.
There may be FLASH beyond that, which probably works, but wasn't tested and isn't guaranteed to work. Up to you if you want to use it or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-30 07:37 AM
ST uses the same die for multiple chips, but only tests the portion of FLASH guaranteed by the datasheet. In your case, that's 32kB starting at 0x08000000.
There may be FLASH beyond that, which probably works, but wasn't tested and isn't guaranteed to work. Up to you if you want to use it or not.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-30 07:50 AM
Hi TDK,
Thanks for the reply.
So, I'm using unprotected memory, thanks.
Supposing I want to extend the flash memory beyond 32Kb what should I do?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-30 09:18 AM
You mean apart from buying a new chip with more memory?
Create the project intended for a 64kB chip in the same form factor and see if that works. It's possible that ST's tools check the register that sets the flash size and will refuse to program past that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-08-30 01:11 PM
>. It's possible that ST's tools check the register that sets the flash size and will refuse to program past that.
In this case, try to write the extra flash by program.
The "official" flash size in KB can be read from the Flash memory size data register at 0x1FFF 75E0
(RM0454, 30.1)