Fixes for flashing G0/G4 devices - #1506
Conversation
- Unified similar handling for G0 & G4 series - Erase handling for G0 dual bank devices (BKER) - Added missing CR flag clearing (PGSERR-Errata) - Removed flash erasure delays for G0 (for testing purposes)
e016060 to
06dec6c
Compare
|
@klonyyy Can you have a look at this as well with your device? |
|
Note on G4 dual-bank detection Unlike G0's dual-bank variants (G0B1/G0C1/G0B0), where dual-bank is a fixed hardware property correctly reflected in chip_flags (CHIP_F_HAS_DUAL_BANK), G4 Cat.3/Cat.4 devices have a runtime-configurable dual-bank mode via the DBANK bit in FLASH_OPTR (RM0440 sec. 3.7.1). Single-bank is the common default when the option byte was never explicitly set (e.g. via STM32CubeMX/HAL). Relying on chip_flags alone for the BKER decision would set BKER for any G474/G4 Cat.3 device with >128K flash and an address past the halfway point, regardless of its actual bank configuration — silently targeting the wrong bank on single-bank-configured devices. Thus we may need: and |
|
I tried compiling but I get errors that are already solved by the fix/win_binaries branch. Merged the fix/win_binaries branch into it locally and was able to flash on my STM32G474CC with DBANK checked and unchekced - note that I only have the G4, not G0 unfortunately :/ |
|
@klonyyy: Yes, the compile errors you initially ran into, do not surprise me. Your intention to merge in the |
|
@OpusElectronics, @massimoGG, @rafaelmartins: Can you give it a try at this point? |
|
We are still waiting for feedback here. |
|
Apologies, I will test it this monday. |
|
I'm still having the same error when flashing to the first bank. |
|
I've had a quick look and the fix seems incomplete. I'll give it a shot when I get more time, but I'm currently busy with other stuff. |
(Closes #1473) (Closes #1491)