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