STM32G4 flash banks description ambiguity
Hello,
I'm currently designing a bootloader and an application for stm32g474ccu6 MCU (256kB flash). Today I wanted to implement a bootloader feature allowing the user app to take up more than one flash bank in flash memory (Im working in dual bank mode - the default configuration). It's not really clear to me how the RM0440 flash layout looks like for a 128 or 256 kB flash. Let's assume a 256 kB version:
- are the banks divided into two 128 kB chunks and then the second bank start address is equal to 0x08002000?
- or are they rather discontinued with a gap-flash region in between (the bank2 start address in the RM seems to be constant?)
I tested it and to my surprise, I was able to program the flash memory using bank1 setting in HAL library and addresses starting at 0x08001f800 (presumably the last page of bank 1) going for 40 kB (presumably first pages of bank 2)! This actually contradicts both of my theories - it seems my stm32g474ccu6 acts completely as a 512 kB unit (even considering the bank division). How is that possible?
I can actually read the whole 512 kB memory (its the same die across different flash versions just not tested right?), so I'm guessing the division between banks is always made at 0x0804 0000, but there's a region of discontinuity that may or may not work (depending on the manufacturing process?).
Best Regards,
Piotr Wasilewski
