Skip to content

feat: Generic variant C071RBTx support #2556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CI/build/conf/cores_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"GENERIC_C031C4UX",
"GENERIC_C031C6TX",
"GENERIC_C031F4PX",
"GENERIC_C071R8TX",
"GENERIC_F031C4TX",
"GENERIC_F031E6YX",
"GENERIC_F031F4PX",
Expand Down
1 change: 1 addition & 0 deletions CI/build/conf/cores_config_ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"GENERIC_C031C4UX",
"GENERIC_C031C6TX",
"GENERIC_C031F4PX",
"GENERIC_C071R8TX",
"GENERIC_F031C4TX",
"GENERIC_F031E6YX",
"GENERIC_F031F4PX",
Expand Down
108 changes: 108 additions & 0 deletions cmake/boards_db.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7130,6 +7130,114 @@ target_compile_options(GENERIC_C031F6PX_serial_none INTERFACE
"SHELL:-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE"
)

# GENERIC_C071R8TX
# -----------------------------------------------------------------------------

set(GENERIC_C071R8TX_VARIANT_PATH "${CMAKE_CURRENT_LIST_DIR}/../variants/STM32C0xx/C071R(8-B)T")
set(GENERIC_C071R8TX_MAXSIZE 65536)
set(GENERIC_C071R8TX_MAXDATASIZE 24576)
set(GENERIC_C071R8TX_MCU cortex-m0plus)
set(GENERIC_C071R8TX_FPCONF "-")
add_library(GENERIC_C071R8TX INTERFACE)
target_compile_options(GENERIC_C071R8TX INTERFACE
"SHELL:-DSTM32C071xx -D__CORTEX_SC=0"
"SHELL:"
"SHELL:"
"SHELL: "
-mcpu=${GENERIC_C071R8TX_MCU}
)
target_compile_definitions(GENERIC_C071R8TX INTERFACE
"STM32C0xx"
"ARDUINO_GENERIC_C071R8TX"
"BOARD_NAME=\"GENERIC_C071R8TX\""
"BOARD_ID=GENERIC_C071R8TX"
"VARIANT_H=\"variant_generic.h\""
)
target_include_directories(GENERIC_C071R8TX INTERFACE
${CMAKE_CURRENT_LIST_DIR}/../system/STM32C0xx
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/STM32C0xx_HAL_Driver/Inc
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/STM32C0xx_HAL_Driver/Src
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/CMSIS/Device/ST/STM32C0xx/Include/
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/CMSIS/Device/ST/STM32C0xx/Source/Templates/gcc/
${GENERIC_C071R8TX_VARIANT_PATH}
)

target_link_options(GENERIC_C071R8TX INTERFACE
"LINKER:--default-script=${GENERIC_C071R8TX_VARIANT_PATH}/ldscript.ld"
"LINKER:--defsym=LD_FLASH_OFFSET=0x0"
"LINKER:--defsym=LD_MAX_SIZE=65536"
"LINKER:--defsym=LD_MAX_DATA_SIZE=24576"
"SHELL: "
-mcpu=${GENERIC_C071R8TX_MCU}
)

add_library(GENERIC_C071R8TX_serial_disabled INTERFACE)
target_compile_options(GENERIC_C071R8TX_serial_disabled INTERFACE
"SHELL:"
)
add_library(GENERIC_C071R8TX_serial_generic INTERFACE)
target_compile_options(GENERIC_C071R8TX_serial_generic INTERFACE
"SHELL:-DHAL_UART_MODULE_ENABLED"
)
add_library(GENERIC_C071R8TX_serial_none INTERFACE)
target_compile_options(GENERIC_C071R8TX_serial_none INTERFACE
"SHELL:-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE"
)

# GENERIC_C071RBTX
# -----------------------------------------------------------------------------

set(GENERIC_C071RBTX_VARIANT_PATH "${CMAKE_CURRENT_LIST_DIR}/../variants/STM32C0xx/C071R(8-B)T")
set(GENERIC_C071RBTX_MAXSIZE 131072)
set(GENERIC_C071RBTX_MAXDATASIZE 24576)
set(GENERIC_C071RBTX_MCU cortex-m0plus)
set(GENERIC_C071RBTX_FPCONF "-")
add_library(GENERIC_C071RBTX INTERFACE)
target_compile_options(GENERIC_C071RBTX INTERFACE
"SHELL:-DSTM32C071xx -D__CORTEX_SC=0"
"SHELL:"
"SHELL:"
"SHELL: "
-mcpu=${GENERIC_C071RBTX_MCU}
)
target_compile_definitions(GENERIC_C071RBTX INTERFACE
"STM32C0xx"
"ARDUINO_GENERIC_C071RBTX"
"BOARD_NAME=\"GENERIC_C071RBTX\""
"BOARD_ID=GENERIC_C071RBTX"
"VARIANT_H=\"variant_generic.h\""
)
target_include_directories(GENERIC_C071RBTX INTERFACE
${CMAKE_CURRENT_LIST_DIR}/../system/STM32C0xx
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/STM32C0xx_HAL_Driver/Inc
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/STM32C0xx_HAL_Driver/Src
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/CMSIS/Device/ST/STM32C0xx/Include/
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/CMSIS/Device/ST/STM32C0xx/Source/Templates/gcc/
${GENERIC_C071RBTX_VARIANT_PATH}
)

target_link_options(GENERIC_C071RBTX INTERFACE
"LINKER:--default-script=${GENERIC_C071RBTX_VARIANT_PATH}/ldscript.ld"
"LINKER:--defsym=LD_FLASH_OFFSET=0x0"
"LINKER:--defsym=LD_MAX_SIZE=131072"
"LINKER:--defsym=LD_MAX_DATA_SIZE=24576"
"SHELL: "
-mcpu=${GENERIC_C071RBTX_MCU}
)

add_library(GENERIC_C071RBTX_serial_disabled INTERFACE)
target_compile_options(GENERIC_C071RBTX_serial_disabled INTERFACE
"SHELL:"
)
add_library(GENERIC_C071RBTX_serial_generic INTERFACE)
target_compile_options(GENERIC_C071RBTX_serial_generic INTERFACE
"SHELL:-DHAL_UART_MODULE_ENABLED"
)
add_library(GENERIC_C071RBTX_serial_none INTERFACE)
target_compile_options(GENERIC_C071RBTX_serial_none INTERFACE
"SHELL:-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE"
)

# GENERIC_F030C6TX
# -----------------------------------------------------------------------------

Expand Down
4 changes: 2 additions & 2 deletions libraries/Wire/src/utility/twi.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,8 +763,8 @@ void i2c_init(i2c_t *obj, uint32_t timing, uint32_t ownAddress)
__HAL_RCC_I2C2_FORCE_RESET();
__HAL_RCC_I2C2_RELEASE_RESET();
obj->irq = I2C2_EV_IRQn;
#if !defined(STM32F0xx) && !defined(STM32G0xx) && !defined(STM32L0xx) && \
!defined(STM32U0xx)
#if !defined(STM32C0xx) && !defined(STM32F0xx) && !defined(STM32G0xx) && \
!defined(STM32L0xx) && !defined(STM32U0xx)
obj->irqER = I2C2_ER_IRQn;
#endif /* !STM32F0xx && !STM32G0xx && !STM32L0xx && !STM32U0xx */
i2c_handles[I2C2_INDEX] = handle;
Expand Down
Loading