Skip to content

Commit

Permalink
Add support for 32KB version of STM32F031 (x6 suffix)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasbakken committed May 14, 2024
1 parent 0f2469f commit 83403ba
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
8 changes: 6 additions & 2 deletions src/stm32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@ choice
config MACH_STM32F031
bool "STM32F031"
select MACH_STM32F0
config MACH_STM32F031x6
bool "STM32F031x6"
select MACH_STM32F0
config MACH_STM32F042
bool "STM32F042"
select MACH_STM32F0
Expand Down Expand Up @@ -164,7 +167,8 @@ config HAVE_STM32_USBCANBUS

config MCU
string
default "stm32f031x6" if MACH_STM32F031
default "stm32f031x4" if MACH_STM32F031
default "stm32f031x6" if MACH_STM32F031x6
default "stm32f042x6" if MACH_STM32F042
default "stm32f070xb" if MACH_STM32F070
default "stm32f072xb" if MACH_STM32F072
Expand Down Expand Up @@ -207,7 +211,7 @@ config CLOCK_FREQ
config FLASH_SIZE
hex
default 0x4000 if MACH_STM32F031
default 0x8000 if MACH_STM32F042
default 0x8000 if MACH_STM32F042 || MACH_STM32F031x6
default 0x20000 if MACH_STM32F070 || MACH_STM32F072
default 0x10000 if MACH_STM32F103 || MACH_STM32L412 # Flash size of stm32f103x8 (64KiB)
default 0x40000 if MACH_STM32F2 || MACH_STM32F401 || MACH_STM32H723
Expand Down
3 changes: 3 additions & 0 deletions src/stm32/stm32f0_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ struct i2c_info {
DECL_CONSTANT_STR("BUS_PINS_i2c1_PF1_PF0", "PF1,PF0");
DECL_ENUMERATION("i2c_bus", "i2c1_PB8_PB9", 2);
DECL_CONSTANT_STR("BUS_PINS_i2c1_PB8_PB9", "PB8,PB9");
DECL_ENUMERATION("i2c_bus", "i2c1_PB7_PB8", 3);
DECL_CONSTANT_STR("BUS_PINS_i2c1_PB7_PB8", "PB7,PB8");
// Deprecated "i2c1a" style mappings
DECL_ENUMERATION("i2c_bus", "i2c1", 0);
DECL_CONSTANT_STR("BUS_PINS_i2c1", "PB6,PB7");
Expand Down Expand Up @@ -93,6 +95,7 @@ static const struct i2c_info i2c_bus[] = {
{ I2C1, GPIO('B', 6), GPIO('B', 7), GPIO_FUNCTION(1) },
{ I2C1, GPIO('F', 1), GPIO('F', 0), GPIO_FUNCTION(1) },
{ I2C1, GPIO('B', 8), GPIO('B', 9), GPIO_FUNCTION(1) },
{ I2C1, GPIO('B', 7), GPIO('B', 8), GPIO_FUNCTION(1) },
#elif CONFIG_MACH_STM32F7
{ I2C1, GPIO('B', 6), GPIO('B', 7), GPIO_FUNCTION(1) },
#elif CONFIG_MACH_STM32G0
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Base config file for STM32F031 boards with serial on PA14/PA15
# Base config file for STM32F031x6 (32KB) boards with serial on PA14/PA15
CONFIG_MACH_STM32=y
CONFIG_MACH_STM32F031=y
CONFIG_MACH_STM32F031x6=y
CONFIG_SERIAL=y
CONFIG_STM32_FLASH_START_0000=y
CONFIG_STM32_SERIAL_USART2_ALT_PA15_PA14=y
Expand Down

0 comments on commit 83403ba

Please sign in to comment.