Skip to content

Commit a7f330f

Browse files
committed
fix build, update freertos config for cmake
1 parent 65d6acd commit a7f330f

File tree

21 files changed

+107
-100
lines changed

21 files changed

+107
-100
lines changed

examples/device/net_lwip_webserver/skip.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mcu:MSP430x5xx
44
mcu:NUC121
55
mcu:SAMD11
66
mcu:STM32L0
7-
mcu:MKL25ZXX
7+
mcu:KINETIS_KL
88
family:broadcom_64bit
99
family:broadcom_32bit
1010
board:curiosity_nano

hw/bsp/family_support.cmake

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,8 @@ function(family_add_freertos TARGET)
192192
CFG_TUSB_OS=OPT_OS_FREERTOS
193193
)
194194
# link tinyusb with freeRTOS kernel
195-
target_link_libraries(${TARGET}-tinyusb PUBLIC
196-
freertos_kernel
197-
)
198-
target_link_libraries(${TARGET} PUBLIC
199-
freertos_kernel
200-
)
195+
target_link_libraries(${TARGET}-tinyusb PUBLIC freertos_kernel)
196+
target_link_libraries(${TARGET} PUBLIC freertos_kernel)
201197
endfunction()
202198

203199

hw/bsp/imxrt/family.cmake

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ function(family_configure_example TARGET)
114114
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
115115
)
116116

117-
# Add TinyUSB
117+
# Add TinyUSB target and port source
118118
family_add_tinyusb(${TARGET} OPT_MCU_MIMXRT1XXX)
119-
120-
# Add TinyUSB Port source
121119
target_sources(${TARGET}-tinyusb PUBLIC
122120
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
123121
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c

hw/bsp/kinetis_kl/FreeRTOSConfig/FreeRTOSConfig.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,14 @@
4444

4545
// skip if included from IAR assembler
4646
#ifndef __IASMARM__
47-
// FIXME cause redundant-decls warnings
48-
extern uint32_t SystemCoreClock;
47+
#include "fsl_device_registers.h"
4948
#endif
5049

5150
/* Cortex M23/M33 port configuration. */
52-
#define configENABLE_MPU 0
53-
#define configENABLE_FPU 1
54-
#define configENABLE_TRUSTZONE 0
55-
#define configMINIMAL_SECURE_STACK_SIZE (1024)
51+
#define configENABLE_MPU 0
52+
#define configENABLE_FPU 1
53+
#define configENABLE_TRUSTZONE 0
54+
#define configMINIMAL_SECURE_STACK_SIZE (1024)
5655

5756
#define configUSE_PREEMPTION 1
5857
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0

hw/bsp/kinetis_kl/boards/frdm_kl25z/clock_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ board: FRDM-KL25Z
8383
* Variables
8484
******************************************************************************/
8585
/* System clock frequency. */
86-
extern uint32_t SystemCoreClock;
86+
//extern uint32_t SystemCoreClock;
8787

8888
/*******************************************************************************
8989
* Code

hw/bsp/kinetis_kl/family.cmake

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ function(family_configure_example TARGET)
8787
#---------- Port Specific ----------
8888
# These files are built for each example since it depends on example's tusb_config.h
8989
target_sources(${TARGET} PUBLIC
90-
# TinyUSB Port
91-
${TOP}/src/portable/chipidea/ci_fs/dcd_ci_fs.c
92-
${TOP}/src/portable/nxp/khci/hcd_khci.c
9390
# BSP
9491
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
9592
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
@@ -101,8 +98,13 @@ function(family_configure_example TARGET)
10198
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
10299
)
103100

104-
# Add TinyUSB
101+
# Add TinyUSB target and port source
105102
family_add_tinyusb(${TARGET} OPT_MCU_KINETIS_KL)
103+
target_sources(${TARGET}-tinyusb PUBLIC
104+
${TOP}/src/portable/chipidea/ci_fs/dcd_ci_fs.c
105+
${TOP}/src/portable/nxp/khci/hcd_khci.c
106+
)
107+
target_link_libraries(${TARGET}-tinyusb PUBLIC board_${BOARD})
106108

107109
# Link dependencies
108110
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)

hw/bsp/lpc18/FreeRTOSConfig/FreeRTOSConfig.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,16 @@
4242
* See http://www.freertos.org/a00110.html.
4343
*----------------------------------------------------------*/
4444

45-
// IAR assembler have limited preprocessor support and it only need following macros:
45+
// skip if included from IAR assembler
4646
#ifndef __IASMARM__
47-
// FIXME cause redundant-decls warnings
48-
extern uint32_t SystemCoreClock;
47+
#include "chip.h"
4948
#endif
5049

5150
/* Cortex M23/M33 port configuration. */
52-
#define configENABLE_MPU 0
53-
#define configENABLE_FPU 0
54-
#define configENABLE_TRUSTZONE 0
55-
#define configMINIMAL_SECURE_STACK_SIZE (1024)
51+
#define configENABLE_MPU 0
52+
#define configENABLE_FPU 1
53+
#define configENABLE_TRUSTZONE 0
54+
#define configMINIMAL_SECURE_STACK_SIZE (1024)
5655

5756
#define configUSE_PREEMPTION 1
5857
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0

hw/bsp/lpc18/family.cmake

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,6 @@ function(family_configure_example TARGET)
7979
#---------- Port Specific ----------
8080
# These files are built for each example since it depends on example's tusb_config.h
8181
target_sources(${TARGET} PUBLIC
82-
# TinyUSB Port
83-
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
84-
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
85-
${TOP}/src/portable/ehci/ehci.c
8682
# BSP
8783
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
8884
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
@@ -94,8 +90,14 @@ function(family_configure_example TARGET)
9490
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
9591
)
9692

97-
# Add TinyUSB
93+
# Add TinyUSB target and port source
9894
family_add_tinyusb(${TARGET} OPT_MCU_LPC18XX)
95+
target_sources(${TARGET}-tinyusb PUBLIC
96+
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
97+
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
98+
${TOP}/src/portable/ehci/ehci.c
99+
)
100+
target_link_libraries(${TARGET}-tinyusb PUBLIC board_${BOARD})
99101

100102
# Link dependencies
101103
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)

hw/bsp/lpc55/FreeRTOSConfig/FreeRTOSConfig.h

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,16 @@
4242
* See http://www.freertos.org/a00110.html.
4343
*----------------------------------------------------------*/
4444

45-
// IAR assembler have limited preprocessor support and it only need following macros:
45+
// skip if included from IAR assembler
4646
#ifndef __IASMARM__
47-
// FIXME cause redundant-decls warnings
48-
extern uint32_t SystemCoreClock;
47+
#include "fsl_device_registers.h"
4948
#endif
5049

5150
/* Cortex M23/M33 port configuration. */
52-
#define configENABLE_MPU 0
53-
#define configENABLE_FPU 1
54-
#define configENABLE_TRUSTZONE 0
55-
#define configMINIMAL_SECURE_STACK_SIZE (1024)
51+
#define configENABLE_MPU 0
52+
#define configENABLE_FPU 1
53+
#define configENABLE_TRUSTZONE 0
54+
#define configMINIMAL_SECURE_STACK_SIZE (1024)
5655

5756
#define configUSE_PREEMPTION 1
5857
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0

hw/bsp/lpc55/family.cmake

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,6 @@ set(FAMILY_MCUS LPC55XX CACHE INTERNAL "")
1616
# include board specific
1717
include(${CMAKE_CURRENT_LIST_DIR}/boards/${BOARD}/board.cmake)
1818

19-
#------------------------------------
20-
# freertos
21-
#------------------------------------
22-
if (NOT TARGET freertos_config)
23-
add_library(freertos_config INTERFACE)
24-
target_include_directories(freertos_config SYSTEM INTERFACE
25-
${CMAKE_CURRENT_LIST_DIR}/FreeRTOSConfig
26-
)
27-
endif()
28-
2919

3020
#------------------------------------
3121
# BOARD_TARGET
@@ -106,8 +96,6 @@ function(family_configure_example TARGET)
10696
#---------- Port Specific ----------
10797
# These files are built for each example since it depends on example's tusb_config.h
10898
target_sources(${TARGET} PUBLIC
109-
# TinyUSB Port
110-
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
11199
# BSP
112100
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
113101
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
@@ -121,15 +109,19 @@ function(family_configure_example TARGET)
121109
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
122110
)
123111

124-
# Add TinyUSB
112+
# Add TinyUSB target and port source
125113
family_add_tinyusb(${TARGET} OPT_MCU_LPC55XX)
114+
target_sources(${TARGET}-tinyusb PUBLIC
115+
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
116+
)
117+
target_link_libraries(${TARGET}-tinyusb PUBLIC board_${BOARD})
126118

127119
# Link dependencies
128120
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)
129121

130122
# Flashing
131123
family_flash_jlink(${TARGET})
132-
family_flash_nxplink(${TARGET})
124+
#family_flash_nxplink(${TARGET})
133125
#family_flash_pyocd(${TARGET})
134126
endfunction()
135127

0 commit comments

Comments
 (0)