mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-17 04:21:23 +00:00
add cmake for all board in stm32f4. fix build, also move ci for f4 from makefile to cmake
This commit is contained in:
parent
81aca17d6e
commit
25bace5e81
1
.github/workflows/build_arm.yml
vendored
1
.github/workflows/build_arm.yml
vendored
@ -43,7 +43,6 @@ jobs:
|
||||
- 'samd51 same5x'
|
||||
- 'saml2x'
|
||||
- 'stm32f2 stm32f3'
|
||||
- 'stm32f4'
|
||||
- 'stm32l0 stm32u5 stm32wb'
|
||||
- 'tm4c123 xmc4000'
|
||||
steps:
|
||||
|
1
.github/workflows/cmake_arm.yml
vendored
1
.github/workflows/cmake_arm.yml
vendored
@ -42,6 +42,7 @@ jobs:
|
||||
- 'rp2040'
|
||||
- 'stm32f0'
|
||||
- 'stm32f1'
|
||||
- 'stm32f4'
|
||||
- 'stm32f7'
|
||||
- 'stm32g0'
|
||||
- 'stm32g4'
|
||||
|
3
.idea/cmake.xml
generated
3
.idea/cmake.xml
generated
@ -22,7 +22,7 @@
|
||||
</envs>
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</configuration>
|
||||
<configuration PROFILE_NAME="rp2040" ENABLED="true" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberry_pi_pico -DLOG=2" />
|
||||
<configuration PROFILE_NAME="rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberry_pi_pico -DLOG=2" />
|
||||
<configuration PROFILE_NAME="feather_rp2040" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pico_sdk -DPICO_BOARD=adafruit_feather_rp2040" />
|
||||
<configuration PROFILE_NAME="metro m7 1011" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="rt1010 evk" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=mimxrt1010_evk -DLOG=3 -DLOGGER=RTT" />
|
||||
@ -41,6 +41,7 @@
|
||||
<configuration PROFILE_NAME="frdm_kl25z" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=frdm_kl25z -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32f072disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f072disco" />
|
||||
<configuration PROFILE_NAME="stm32f103_mini_2" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f103_mini_2" />
|
||||
<configuration PROFILE_NAME="stm32f411disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f411disco -DLOG=2 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32f769disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32f769disco -DLOG=3 -DLOGGER=RTT" />
|
||||
<configuration PROFILE_NAME="stm32h743eval" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32h743eval -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
|
||||
<configuration PROFILE_NAME="stm32l476disco" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=stm32l476disco" />
|
||||
|
@ -66,7 +66,7 @@
|
||||
#define configUSE_MUTEXES 1
|
||||
#define configUSE_RECURSIVE_MUTEXES 1
|
||||
#define configUSE_COUNTING_SEMAPHORES 1
|
||||
#define configQUEUE_REGISTRY_SIZE 2
|
||||
#define configQUEUE_REGISTRY_SIZE 4
|
||||
#define configUSE_QUEUE_SETS 0
|
||||
#define configUSE_TIME_SLICING 0
|
||||
#define configUSE_NEWLIB_REENTRANT 0
|
||||
|
10
hw/bsp/stm32f4/boards/feather_stm32f405/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/feather_stm32f405/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f405xx)
|
||||
set(JLINK_DEVICE stm32f405rg)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F405RGTx_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F405xx
|
||||
)
|
||||
endfunction()
|
10
hw/bsp/stm32f4/boards/pyboardv11/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/pyboardv11/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f405xx)
|
||||
set(JLINK_DEVICE stm32f405rg)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F405RGTx_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F405xx
|
||||
)
|
||||
endfunction()
|
10
hw/bsp/stm32f4/boards/stm32f401blackpill/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/stm32f401blackpill/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f401xc)
|
||||
set(JLINK_DEVICE stm32f401cc)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F401VCTx_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F405xx
|
||||
)
|
||||
endfunction()
|
@ -2,17 +2,12 @@ set(MCU_VARIANT stm32f407xx)
|
||||
set(JLINK_DEVICE stm32f407ve)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F407VETx_FLASH.ld)
|
||||
set(LD_FILE_IAR ${ST_CMSIS}/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf)
|
||||
|
||||
set(STARTUP_FILE_GNU ${ST_CMSIS}/Source/Templates/gcc/startup_${MCU_VARIANT}.s)
|
||||
set(STARTUP_FILE_IAR ${ST_CMSIS}/Source/Templates/iar/startup_${MCU_VARIANT}.s)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F407xx
|
||||
HSE_VALUE=8000000
|
||||
CORE_CM4
|
||||
BOARD_TUD_RHPORT=0
|
||||
BOARD_TUD_MAX_SPEED=OPT_MODE_FULL_SPEED
|
||||
BOARD_TUD_RHPORT=0
|
||||
BOARD_TUD_MAX_SPEED=OPT_MODE_FULL_SPEED
|
||||
)
|
||||
endfunction()
|
||||
|
10
hw/bsp/stm32f4/boards/stm32f407disco/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/stm32f407disco/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f407xx)
|
||||
set(JLINK_DEVICE stm32f407vg)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F407VGTx_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F407xx
|
||||
)
|
||||
endfunction()
|
10
hw/bsp/stm32f4/boards/stm32f411blackpill/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/stm32f411blackpill/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f411xe)
|
||||
set(JLINK_DEVICE stm32f411ce)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F411CEUx_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F411xE
|
||||
)
|
||||
endfunction()
|
10
hw/bsp/stm32f4/boards/stm32f411disco/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/stm32f411disco/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f411xe)
|
||||
set(JLINK_DEVICE stm32f411ve)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F411VETx_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F411xE
|
||||
)
|
||||
endfunction()
|
10
hw/bsp/stm32f4/boards/stm32f412disco/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/stm32f412disco/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f412zx)
|
||||
set(JLINK_DEVICE stm32f412zg)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F412ZGTx_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F412Zx
|
||||
)
|
||||
endfunction()
|
10
hw/bsp/stm32f4/boards/stm32f412nucleo/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/stm32f412nucleo/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f412zx)
|
||||
set(JLINK_DEVICE stm32f412zg)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F412ZGTx_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F412Zx
|
||||
)
|
||||
endfunction()
|
10
hw/bsp/stm32f4/boards/stm32f439nucleo/board.cmake
Normal file
10
hw/bsp/stm32f4/boards/stm32f439nucleo/board.cmake
Normal file
@ -0,0 +1,10 @@
|
||||
set(MCU_VARIANT stm32f439xx)
|
||||
set(JLINK_DEVICE stm32f439zi)
|
||||
|
||||
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/STM32F439ZITX_FLASH.ld)
|
||||
|
||||
function(update_board TARGET)
|
||||
target_compile_definitions(${TARGET} PUBLIC
|
||||
STM32F439xx
|
||||
)
|
||||
endfunction()
|
@ -31,13 +31,11 @@
|
||||
//--------------------------------------------------------------------+
|
||||
// Forward USB interrupt events to TinyUSB IRQ Handler
|
||||
//--------------------------------------------------------------------+
|
||||
void OTG_FS_IRQHandler(void)
|
||||
{
|
||||
void OTG_FS_IRQHandler(void) {
|
||||
tud_int_handler(0);
|
||||
}
|
||||
|
||||
void OTG_HS_IRQHandler(void)
|
||||
{
|
||||
void OTG_HS_IRQHandler(void) {
|
||||
tud_int_handler(1);
|
||||
}
|
||||
|
||||
@ -46,8 +44,7 @@ void OTG_HS_IRQHandler(void)
|
||||
//--------------------------------------------------------------------+
|
||||
UART_HandleTypeDef UartHandle;
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
void board_init(void) {
|
||||
board_clock_init();
|
||||
//SystemCoreClockUpdate();
|
||||
|
||||
@ -62,7 +59,7 @@ void board_init(void)
|
||||
NVIC_SetPriority(OTG_FS_IRQn, configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY );
|
||||
#endif
|
||||
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
GPIO_InitTypeDef GPIO_InitStruct;
|
||||
|
||||
// LED
|
||||
GPIO_InitStruct.Pin = LED_PIN;
|
||||
@ -82,22 +79,22 @@ void board_init(void)
|
||||
|
||||
#ifdef UART_DEV
|
||||
// UART
|
||||
GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
GPIO_InitStruct.Pin = UART_TX_PIN | UART_RX_PIN;
|
||||
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
|
||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
|
||||
GPIO_InitStruct.Alternate = UART_GPIO_AF;
|
||||
HAL_GPIO_Init(UART_GPIO_PORT, &GPIO_InitStruct);
|
||||
|
||||
UartHandle = (UART_HandleTypeDef){
|
||||
.Instance = UART_DEV,
|
||||
.Init.BaudRate = CFG_BOARD_UART_BAUDRATE,
|
||||
.Init.WordLength = UART_WORDLENGTH_8B,
|
||||
.Init.StopBits = UART_STOPBITS_1,
|
||||
.Init.Parity = UART_PARITY_NONE,
|
||||
.Init.HwFlowCtl = UART_HWCONTROL_NONE,
|
||||
.Init.Mode = UART_MODE_TX_RX,
|
||||
.Init.OverSampling = UART_OVERSAMPLING_16
|
||||
UartHandle = (UART_HandleTypeDef) {
|
||||
.Instance = UART_DEV,
|
||||
.Init.BaudRate = CFG_BOARD_UART_BAUDRATE,
|
||||
.Init.WordLength = UART_WORDLENGTH_8B,
|
||||
.Init.StopBits = UART_STOPBITS_1,
|
||||
.Init.Parity = UART_PARITY_NONE,
|
||||
.Init.HwFlowCtl = UART_HWCONTROL_NONE,
|
||||
.Init.Mode = UART_MODE_TX_RX,
|
||||
.Init.OverSampling = UART_OVERSAMPLING_16
|
||||
};
|
||||
HAL_UART_Init(&UartHandle);
|
||||
#endif
|
||||
@ -148,27 +145,37 @@ void board_init(void)
|
||||
// Board porting API
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
void board_led_write(bool state)
|
||||
{
|
||||
GPIO_PinState pin_state = (GPIO_PinState) (state ? LED_STATE_ON : (1-LED_STATE_ON));
|
||||
void board_led_write(bool state) {
|
||||
GPIO_PinState pin_state = (GPIO_PinState) (state ? LED_STATE_ON : (1 - LED_STATE_ON));
|
||||
HAL_GPIO_WritePin(LED_PORT, LED_PIN, pin_state);
|
||||
}
|
||||
|
||||
uint32_t board_button_read(void)
|
||||
{
|
||||
uint32_t board_button_read(void) {
|
||||
return BUTTON_STATE_ACTIVE == HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN);
|
||||
}
|
||||
|
||||
int board_uart_read(uint8_t* buf, int len)
|
||||
{
|
||||
(void) buf; (void) len;
|
||||
size_t board_get_unique_id(uint8_t id[], size_t max_len) {
|
||||
(void) max_len;
|
||||
volatile uint32_t *stm32_uuid = (volatile uint32_t *) UID_BASE;
|
||||
uint32_t *id32 = (uint32_t *) (uintptr_t) id;
|
||||
uint8_t const len = 12;
|
||||
|
||||
id32[0] = stm32_uuid[0];
|
||||
id32[1] = stm32_uuid[1];
|
||||
id32[2] = stm32_uuid[2];
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
int board_uart_read(uint8_t *buf, int len) {
|
||||
(void) buf;
|
||||
(void) len;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int board_uart_write(void const * buf, int len)
|
||||
{
|
||||
int board_uart_write(void const *buf, int len) {
|
||||
#ifdef UART_DEV
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t*)(uintptr_t) buf, len, 0xffff);
|
||||
HAL_UART_Transmit(&UartHandle, (uint8_t *) (uintptr_t) buf, len, 0xffff);
|
||||
return len;
|
||||
#else
|
||||
(void) buf; (void) len; (void) UartHandle;
|
||||
@ -176,28 +183,25 @@ int board_uart_write(void const * buf, int len)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CFG_TUSB_OS == OPT_OS_NONE
|
||||
#if CFG_TUSB_OS == OPT_OS_NONE
|
||||
volatile uint32_t system_ticks = 0;
|
||||
void SysTick_Handler (void)
|
||||
{
|
||||
|
||||
void SysTick_Handler(void) {
|
||||
HAL_IncTick();
|
||||
system_ticks++;
|
||||
}
|
||||
|
||||
uint32_t board_millis(void)
|
||||
{
|
||||
uint32_t board_millis(void) {
|
||||
return system_ticks;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void HardFault_Handler (void)
|
||||
{
|
||||
void HardFault_Handler(void) {
|
||||
__asm("BKPT #0\n");
|
||||
}
|
||||
|
||||
// Required by __libc_init_array in startup code if we are compiling using
|
||||
// -nostdlib/-nostartfiles.
|
||||
void _init(void)
|
||||
{
|
||||
|
||||
void _init(void) {
|
||||
}
|
||||
|
@ -20,58 +20,58 @@ set(CMAKE_TOOLCHAIN_FILE ${TOP}/tools/cmake/toolchain/arm_${TOOLCHAIN}.cmake)
|
||||
|
||||
set(FAMILY_MCUS STM32F4 CACHE INTERNAL "")
|
||||
|
||||
# enable LTO if supported
|
||||
include(CheckIPOSupported)
|
||||
check_ipo_supported(RESULT IPO_SUPPORTED)
|
||||
if (IPO_SUPPORTED)
|
||||
set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE)
|
||||
endif ()
|
||||
|
||||
|
||||
#------------------------------------
|
||||
# BOARD_TARGET
|
||||
#------------------------------------
|
||||
# only need to be built ONCE for all examples
|
||||
function(add_board_target BOARD_TARGET)
|
||||
if (NOT TARGET ${BOARD_TARGET})
|
||||
add_library(${BOARD_TARGET} STATIC
|
||||
${ST_CMSIS}/Source/Templates/system_${ST_PREFIX}.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_cortex.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_pwr_ex.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_rcc.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_rcc_ex.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_dma.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_gpio.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_uart.c
|
||||
${STARTUP_FILE_${CMAKE_C_COMPILER_ID}}
|
||||
)
|
||||
target_include_directories(${BOARD_TARGET} PUBLIC
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
|
||||
${CMSIS_5}/CMSIS/Core/Include
|
||||
${ST_CMSIS}/Include
|
||||
${ST_HAL_DRIVER}/Inc
|
||||
)
|
||||
target_compile_options(${BOARD_TARGET} PUBLIC
|
||||
)
|
||||
target_compile_definitions(${BOARD_TARGET} PUBLIC
|
||||
)
|
||||
if (TARGET ${BOARD_TARGET})
|
||||
return()
|
||||
endif ()
|
||||
|
||||
update_board(${BOARD_TARGET})
|
||||
# Startup & Linker script
|
||||
set(STARTUP_FILE_GNU ${ST_CMSIS}/Source/Templates/gcc/startup_${MCU_VARIANT}.s)
|
||||
set(STARTUP_FILE_IAR ${ST_CMSIS}/Source/Templates/iar/startup_${MCU_VARIANT}.s)
|
||||
set(LD_FILE_IAR ${ST_CMSIS}/Source/Templates/iar/linker/${MCU_VARIANT}_flash.icf)
|
||||
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_options(${BOARD_TARGET} PUBLIC
|
||||
"LINKER:--script=${LD_FILE_GNU}"
|
||||
-nostartfiles
|
||||
# nanolib
|
||||
--specs=nosys.specs
|
||||
--specs=nano.specs
|
||||
)
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
|
||||
target_link_options(${BOARD_TARGET} PUBLIC
|
||||
"LINKER:--config=${LD_FILE_IAR}"
|
||||
)
|
||||
endif ()
|
||||
add_library(${BOARD_TARGET} STATIC
|
||||
${ST_CMSIS}/Source/Templates/system_${ST_PREFIX}.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_cortex.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_dma.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_gpio.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_pwr_ex.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_rcc.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_rcc_ex.c
|
||||
${ST_HAL_DRIVER}/Src/${ST_PREFIX}_hal_uart.c
|
||||
${STARTUP_FILE_${CMAKE_C_COMPILER_ID}}
|
||||
)
|
||||
target_include_directories(${BOARD_TARGET} PUBLIC
|
||||
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
|
||||
${CMSIS_5}/CMSIS/Core/Include
|
||||
${ST_CMSIS}/Include
|
||||
${ST_HAL_DRIVER}/Inc
|
||||
)
|
||||
target_compile_options(${BOARD_TARGET} PUBLIC
|
||||
)
|
||||
target_compile_definitions(${BOARD_TARGET} PUBLIC
|
||||
)
|
||||
|
||||
update_board(${BOARD_TARGET})
|
||||
|
||||
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
target_link_options(${BOARD_TARGET} PUBLIC
|
||||
"LINKER:--script=${LD_FILE_GNU}"
|
||||
-nostartfiles
|
||||
# nanolib
|
||||
--specs=nosys.specs
|
||||
--specs=nano.specs
|
||||
)
|
||||
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
|
||||
target_link_options(${BOARD_TARGET} PUBLIC
|
||||
"LINKER:--config=${LD_FILE_IAR}"
|
||||
)
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
@ -82,7 +82,6 @@ endfunction()
|
||||
function(family_configure_example TARGET RTOS)
|
||||
family_configure_common(${TARGET} ${RTOS})
|
||||
|
||||
|
||||
# Board target
|
||||
add_board_target(board_${BOARD})
|
||||
|
||||
@ -102,15 +101,9 @@ function(family_configure_example TARGET RTOS)
|
||||
|
||||
# Add TinyUSB target and port source
|
||||
family_add_tinyusb(${TARGET} OPT_MCU_STM32F4 ${RTOS})
|
||||
if (MCU_VARIANT STREQUAL "stm32f407xx")
|
||||
target_sources(${TARGET}-tinyusb PUBLIC
|
||||
${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c
|
||||
)
|
||||
else()
|
||||
target_sources(${TARGET}-tinyusb PUBLIC
|
||||
${TOP}/src/portable/st/stm32_fsdev/dcd_stm32_fsdev.c
|
||||
)
|
||||
endif()
|
||||
target_sources(${TARGET}-tinyusb PUBLIC
|
||||
${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c
|
||||
)
|
||||
target_link_libraries(${TARGET}-tinyusb PUBLIC board_${BOARD})
|
||||
|
||||
# Link dependencies
|
||||
@ -120,16 +113,3 @@ function(family_configure_example TARGET RTOS)
|
||||
family_flash_stlink(${TARGET})
|
||||
family_flash_jlink(${TARGET})
|
||||
endfunction()
|
||||
|
||||
|
||||
function(family_configure_device_example TARGET)
|
||||
family_configure_example(${TARGET})
|
||||
endfunction()
|
||||
|
||||
function(family_configure_host_example TARGET)
|
||||
family_configure_example(${TARGET})
|
||||
endfunction()
|
||||
|
||||
function(family_configure_dual_usb_example TARGET)
|
||||
family_configure_example(${TARGET})
|
||||
endfunction()
|
||||
|
Loading…
x
Reference in New Issue
Block a user