STM32G0B1 Single bank flash support Topic is solved

Report here problems in any of ChibiOS components. This forum is NOT for support.
KarlK90
Posts: 16
Joined: Fri Feb 05, 2021 10:53 am
Has thanked: 1 time
Been thanked: 7 times

STM32G0B1 Single bank flash support  Topic is solved

Postby KarlK90 » Sat Mar 15, 2025 1:25 pm

Hi Giovanni,

the g0b1 series feature 128kb flash and a single bank flash memory organisation[1], which is currently missing in the registry and elf driver. I have attached a patch that adds the support. I'm not sure if you're happy with the registry #if defined switch but it is a start :-).

Cheers,
Stefan

[1]: see RM0444 Rev 6, page 70, 3.2 FLASH main features


Code: Select all

diff --git a/os/hal/ports/STM32/STM32G0xx/hal_efl_lld.h b/os/hal/ports/STM32/STM32G0xx/hal_efl_lld.h
index b31db288a7..0a796adcd9 100644
--- a/os/hal/ports/STM32/STM32G0xx/hal_efl_lld.h
+++ b/os/hal/ports/STM32/STM32G0xx/hal_efl_lld.h
@@ -52,7 +52,7 @@
 /*===========================================================================*/
 
 #if defined(STM32G070xx) || defined(STM32G071xx) ||                         \
-    defined(STM32G081xx) ||                                                 \
+    defined(STM32G081xx) || defined(STM32G0B1xx) ||                         \
     defined(__DOXYGEN__)
 
 /* Flash size register. */
diff --git a/os/hal/ports/STM32/STM32G0xx/stm32_registry.h b/os/hal/ports/STM32/STM32G0xx/stm32_registry.h
index b22320955e..06824f4e33 100644
--- a/os/hal/ports/STM32/STM32G0xx/stm32_registry.h
+++ b/os/hal/ports/STM32/STM32G0xx/stm32_registry.h
@@ -712,7 +712,11 @@
 #define STM32_EXTI_IMR2_MASK                0xFFFFFFFFU
 
 /* Flash attributes.*/
+#if defined(STM32G0B1xx)
+#define STM32_FLASH_NUMBER_OF_BANKS         1
+#else
 #define STM32_FLASH_NUMBER_OF_BANKS         2
+#endif
 
 /* GPIO attributes.*/
 #define STM32_HAS_GPIOA                     TRUE

User avatar
Giovanni
Site Admin
Posts: 14627
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1132 times
Been thanked: 944 times

Re: STM32G0B1 Single bank flash support

Postby Giovanni » Sat Mar 15, 2025 3:20 pm

Thansk, moving in "bug reports" or I will forget about this :-)

Giovanni

KarlK90
Posts: 16
Joined: Fri Feb 05, 2021 10:53 am
Has thanked: 1 time
Been thanked: 7 times

Re: STM32G0B1 Single bank flash support

Postby KarlK90 » Thu May 08, 2025 10:26 am

Hi Giovanni,

friendly ping on this bug/issue.

Cheers,
Stefan

User avatar
Giovanni
Site Admin
Posts: 14627
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1132 times
Been thanked: 944 times

Re: STM32G0B1 Single bank flash support

Postby Giovanni » Thu May 15, 2025 9:19 am

Hi,

Change committed, thanks.

Giovanni


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 37 guests