EmBitz
EBlink on STM32G4 dependance on DBANK option - Printable Version

+- EmBitz (https://www.embitz.org/forum)
+-- Forum: EBlink (https://www.embitz.org/forum/forum-3.html)
+--- Forum: Scripts (https://www.embitz.org/forum/forum-7.html)
+--- Thread: EBlink on STM32G4 dependance on DBANK option (/thread-8.html)



EBlink on STM32G4 dependance on DBANK option - Misc01 - 08-07-2020

I'm using Embitz with EBlink to debug a STM32G4 controller. The G4 family offers an option byte called DBANK that controls whether the flash memory is organised in one single bank with 128 bit granularity (option bit unchecked) or in dual bank mode with 64bit granularity. When the controller is configured to single bank mode, EBlink often stops with an error when updating the software. This does not happen in dual bank configuration. When I use the STM32CubeProgrammer to perform a full chip erase before programming, the effect does not show at all.

Maybe this is related to the fact that the Flash erase function in STs library (HAL_FLASHEx_Erase) requires consideration of the DBANK setting on how to pass the block number to be erased.


RE: EBlink on STM32G4 dependance on DBANK option - embitz - 13-07-2020

Yes, the flash script  for the G4 only supports one mode. 

If you go to the flash script "./scripts/stmicro/flash/stm32Gx_fl.script" you see  the header

Code:
/////////////////////////////////////////////////////////////////////////////////
//
//                   STM32G0_fl flash loader
//
//  ToDo:  - option programming
//         - dual bank for G4x



Perhaps you could add dual bank flashing and share your script files so I can add it or use github.

I just made a quick implementation but I never used those Gx devices myself


RE: EBlink on STM32G4 dependance on DBANK option - embitz - 06-10-2020

Dual bank should work now, from version V3.4