Skip to content
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

STM32G0 update drivers version to CUBE V1.5.0 #15075

Merged
merged 5 commits into from
Sep 28, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
STM32G0: align code with CubeUpdate script
  • Loading branch information
jeromecoutant committed Sep 21, 2021
commit e0877e4077bd04d50f8638a700eadac73cdac0d8
22 changes: 11 additions & 11 deletions targets/TARGET_STM/TARGET_STM32G0/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Copyright (c) 2020 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

add_subdirectory(TARGET_STM32G030xx EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G031xx EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G041xx EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G070xx EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G071xx EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G081xx EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G030x8 EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G031x8 EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G041x8 EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G070xB EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G071xB EXCLUDE_FROM_ALL)
add_subdirectory(TARGET_STM32G081xB EXCLUDE_FROM_ALL)
add_subdirectory(STM32Cube_FW EXCLUDE_FROM_ALL)

add_library(mbed-stm32g0 INTERFACE)

target_include_directories(mbed-stm32g0
INTERFACE
.
)

target_sources(mbed-stm32g0
INTERFACE
analogin_device.c
Expand All @@ -23,9 +28,4 @@ target_sources(mbed-stm32g0
spi_api.c
)

target_include_directories(mbed-stm32g0
INTERFACE
.
)

target_link_libraries(mbed-stm32g0 INTERFACE mbed-stm mbed-stm32g0cube-fw)
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,21 @@ typedef enum {
ADC_1 = (int)ADC1_BASE
} ADCName;

#if defined DAC_BASE
typedef enum {
DAC_1 = (int)DAC_BASE
} DACName;
#endif

typedef enum {
UART_1 = (int)USART1_BASE,
UART_2 = (int)USART2_BASE,
#if defined USART3_BASE
UART_3 = (int)USART3_BASE,
#endif
#if defined USART4_BASE
UART_4 = (int)USART4_BASE,
#endif
LPUART_1 = (int)LPUART1_BASE
} UARTName;

Expand All @@ -53,7 +59,9 @@ typedef enum {
PWM_2 = (int)TIM2_BASE,
PWM_3 = (int)TIM3_BASE,
PWM_14 = (int)TIM14_BASE,
#if defined TIM15_BASE
PWM_15 = (int)TIM15_BASE,
#endif
PWM_16 = (int)TIM16_BASE,
PWM_17 = (int)TIM17_BASE
} PWMName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,83 +73,63 @@ extern "C" {
#if !defined (USE_HAL_ADC_REGISTER_CALLBACKS)
#define USE_HAL_ADC_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_CEC_REGISTER_CALLBACKS)
#define USE_HAL_CEC_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_COMP_REGISTER_CALLBACKS)
#define USE_HAL_COMP_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_CRYP_REGISTER_CALLBACKS)
#define USE_HAL_CRYP_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_DAC_REGISTER_CALLBACKS)
#define USE_HAL_DAC_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_FDCAN_REGISTER_CALLBACKS)
#define USE_HAL_FDCAN_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_I2C_REGISTER_CALLBACKS)
#define USE_HAL_I2C_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_I2S_REGISTER_CALLBACKS)
#define USE_HAL_I2S_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_IRDA_REGISTER_CALLBACKS)
#define USE_HAL_IRDA_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_LPTIM_REGISTER_CALLBACKS)
#define USE_HAL_LPTIM_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_HCD_REGISTER_CALLBACKS)
#define USE_HAL_HCD_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_PCD_REGISTER_CALLBACKS)
#define USE_HAL_PCD_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_RNG_REGISTER_CALLBACKS)
#define USE_HAL_RNG_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_RTC_REGISTER_CALLBACKS)
#define USE_HAL_RTC_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_SMARTCARD_REGISTER_CALLBACKS)
#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_SMBUS_REGISTER_CALLBACKS)
#define USE_HAL_SMBUS_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_SPI_REGISTER_CALLBACKS)
#define USE_HAL_SPI_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_TIM_REGISTER_CALLBACKS)
#define USE_HAL_TIM_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_UART_REGISTER_CALLBACKS)
#define USE_HAL_UART_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_USART_REGISTER_CALLBACKS)
#define USE_HAL_USART_REGISTER_CALLBACKS 0u
#endif

#if !defined (USE_HAL_WWDG_REGISTER_CALLBACKS)
#define USE_HAL_WWDG_REGISTER_CALLBACKS 0u
#endif
Expand Down Expand Up @@ -259,6 +239,7 @@ in voltage and temperature.*/
#define USE_HAL_CRYP_SUSPEND_RESUME 1U
#endif


/* ########################## Assert Selection ############################## */
/**
* @brief Uncomment the line below to expanse the "assert_param" macro in the
Expand Down Expand Up @@ -394,17 +375,7 @@ in voltage and temperature.*/

/* Exported macro ------------------------------------------------------------*/
#ifdef USE_FULL_ASSERT
/**
* @brief The assert_param macro is used for functions parameters check.
* @param expr If expr is false, it calls assert_failed function
* which reports the name of the source file and the source
* line number of the call that failed.
* If expr is true, it returns no value.
* @retval None
*/
#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
/* Exported functions ------------------------------------------------------- */
void assert_failed(uint8_t *file, uint32_t line);
#include "stm32_assert.h" // MBED patch
#else
#define assert_param(expr) ((void)0U)
#endif /* USE_FULL_ASSERT */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,10 @@
* @param None
* @retval None
*/
void SystemInit(void)
__WEAK void SystemInit(void)
{
/* Configure the Vector Table location add offset address ------------------*/
#ifdef VECT_TAB_SRAM
SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM */
#else
#include "nvic_addr.h" // MBED
SCB->VTOR = NVIC_FLASH_VECTOR_ADDRESS; // MBED
#endif
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32g030xx.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32g030xx.ld)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32g030x8.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32g030xx.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32g030xx.sct)
set(LINKER_FILE TOOLCHAIN_ARM/stm32g030x8.sct)
endif()

add_library(mbed-stm32g030xx INTERFACE)
add_library(mbed-stm32g030x8 INTERFACE)

target_sources(mbed-stm32g030xx
target_include_directories(mbed-stm32g030x8
INTERFACE
${STARTUP_FILE}
.
)

target_include_directories(mbed-stm32g030xx
target_sources(mbed-stm32g030x8
INTERFACE
.
${STARTUP_FILE}
)

mbed_set_linker_script(mbed-stm32g030xx ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
mbed_set_linker_script(mbed-stm32g030x8 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_link_libraries(mbed-stm32g030xx INTERFACE mbed-stm32g0)
target_link_libraries(mbed-stm32g030x8 INTERFACE mbed-stm32g0)
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
#define MBED_APP_SIZE MBED_ROM_SIZE
#endif

/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
#if defined(MBED_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
#else
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
#endif
#endif

/* Round up VECTORS_SIZE to 8 bytes */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
}

if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
/* This value is normally defined by the tools
/* This value is normally defined by the tools
to 0x1000 for bare metal and 0x400 for RTOS */
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@
#endif

#if !defined(MBED_ROM_SIZE)
#if defined (TARGET_NUCLEO_G031K8)
#define MBED_ROM_SIZE 0x10000 // 64 KB
#else
#error "MBED_ROM_SIZE not defined"
#endif
#endif

#if !defined(MBED_RAM_START)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,25 @@ add_subdirectory(TARGET_NUCLEO_G031K8 EXCLUDE_FROM_ALL)

if(${MBED_TOOLCHAIN} STREQUAL "GCC_ARM")
set(STARTUP_FILE TOOLCHAIN_GCC_ARM/startup_stm32g031xx.S)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32g031xx.ld)
set(LINKER_FILE TOOLCHAIN_GCC_ARM/stm32g031x8.ld)
elseif(${MBED_TOOLCHAIN} STREQUAL "ARM")
set(STARTUP_FILE TOOLCHAIN_ARM/startup_stm32g031xx.S)
set(LINKER_FILE TOOLCHAIN_ARM/stm32g031xx.sct)
set(LINKER_FILE TOOLCHAIN_ARM/stm32g031x8.sct)
endif()

add_library(mbed-stm32g031xx INTERFACE)
add_library(mbed-stm32g031x8 INTERFACE)

target_sources(mbed-stm32g031xx
target_include_directories(mbed-stm32g031x8
INTERFACE
${STARTUP_FILE}
.
)

target_include_directories(mbed-stm32g031xx
target_sources(mbed-stm32g031x8
INTERFACE
.
${STARTUP_FILE}
system_clock.c
)

mbed_set_linker_script(mbed-stm32g031xx ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})
mbed_set_linker_script(mbed-stm32g031x8 ${CMAKE_CURRENT_SOURCE_DIR}/${LINKER_FILE})

target_link_libraries(mbed-stm32g031xx INTERFACE mbed-stm32g0)
target_link_libraries(mbed-stm32g031x8 INTERFACE mbed-stm32g0)
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@ add_library(mbed-nucleo-g031k8 INTERFACE)
target_sources(mbed-nucleo-g031k8
INTERFACE
PeripheralPins.c
system_clock.c
)

target_include_directories(mbed-nucleo-g031k8
INTERFACE
.
)

target_link_libraries(mbed-nucleo-g031k8 INTERFACE mbed-stm32g031xx)
target_link_libraries(mbed-nucleo-g031k8 INTERFACE mbed-stm32g031x8)
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@
#define MBED_APP_SIZE MBED_ROM_SIZE
#endif

/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
#if !defined(MBED_CONF_TARGET_BOOT_STACK_SIZE)
# if defined(MBED_BOOT_STACK_SIZE)
# define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
# else
# define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
# endif
/* This value is normally defined by the tools to 0x1000 for bare metal and 0x400 for RTOS */
#if defined(MBED_BOOT_STACK_SIZE)
#define MBED_CONF_TARGET_BOOT_STACK_SIZE MBED_BOOT_STACK_SIZE
#else
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
#endif
#endif

/* Round up VECTORS_SIZE to 8 bytes */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

/* Tools provide -DMBED_ROM_START=xxx -DMBED_ROM_SIZE=xxx -DMBED_RAM_START=xxx -DMBED_RAM_SIZE=xxx */

define symbol VECTORS = 46; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
define symbol VECTORS = 48; /* This value must match NVIC_NUM_VECTORS in cmsis_nvic.h */
define symbol HEAP_SIZE = 0x1000;

/* Common - Do not change */
Expand All @@ -32,7 +32,7 @@ if (!isdefinedsymbol(MBED_APP_SIZE)) {
}

if (!isdefinedsymbol(MBED_CONF_TARGET_BOOT_STACK_SIZE)) {
/* This value is normally defined by the tools
/* This value is normally defined by the tools
to 0x1000 for bare metal and 0x400 for RTOS */
define symbol MBED_CONF_TARGET_BOOT_STACK_SIZE = 0x400;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@
#endif

#if !defined(MBED_ROM_SIZE)
#define MBED_ROM_SIZE 0x20000
#define MBED_ROM_SIZE 0x10000 // 64 KB
#endif

#if !defined(MBED_RAM_START)
#define MBED_RAM_START 0x20000000
#endif

#if !defined(MBED_RAM_SIZE)
#define MBED_RAM_SIZE 0x9000
#define MBED_RAM_SIZE 0x2000 // 8 KB
#endif

#define NVIC_NUM_VECTORS 48
Expand Down
Loading