summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-06-16 12:02:42 +0700
committerhathach <[email protected]>2023-06-16 12:02:42 +0700
commit65d6acdbfaea84c3274e359acd5e5474f04e8851 (patch)
treea6a89ff9a243e7a9e3b7f835e959a9cf3d4c798d /hw
parent8af8869d3bcb1504835ead4ba472cd922d997e8d (diff)
fix build warnings
Diffstat (limited to 'hw')
-rw-r--r--hw/bsp/family_support.cmake2
-rw-r--r--hw/bsp/imxrt/FreeRTOSConfig/FreeRTOSConfig.h11
-rw-r--r--hw/bsp/imxrt/family.cmake12
3 files changed, 15 insertions, 10 deletions
diff --git a/hw/bsp/family_support.cmake b/hw/bsp/family_support.cmake
index dfc2095e5..02040c4ed 100644
--- a/hw/bsp/family_support.cmake
+++ b/hw/bsp/family_support.cmake
@@ -177,6 +177,8 @@ function(family_add_freertos TARGET)
target_include_directories(freertos_config INTERFACE
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/${FAMILY}/FreeRTOSConfig
)
+ # add board definition to freertos_config mostly for SystemCoreClock
+ target_link_libraries(freertos_config INTERFACE board_${BOARD})
endif()
# freertos kernel should be generic as freertos_config however, CMAKE complains with missing variable
diff --git a/hw/bsp/imxrt/FreeRTOSConfig/FreeRTOSConfig.h b/hw/bsp/imxrt/FreeRTOSConfig/FreeRTOSConfig.h
index c1928fbcd..f95927069 100644
--- a/hw/bsp/imxrt/FreeRTOSConfig/FreeRTOSConfig.h
+++ b/hw/bsp/imxrt/FreeRTOSConfig/FreeRTOSConfig.h
@@ -44,15 +44,14 @@
// skip if included from IAR assembler
#ifndef __IASMARM__
-// FIXME cause redundant-decls warnings
-extern uint32_t SystemCoreClock;
+ #include "fsl_device_registers.h"
#endif
/* Cortex M23/M33 port configuration. */
-#define configENABLE_MPU 0
-#define configENABLE_FPU 1
-#define configENABLE_TRUSTZONE 0
-#define configMINIMAL_SECURE_STACK_SIZE (1024)
+#define configENABLE_MPU 0
+#define configENABLE_FPU 1
+#define configENABLE_TRUSTZONE 0
+#define configMINIMAL_SECURE_STACK_SIZE (1024)
#define configUSE_PREEMPTION 1
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 0
diff --git a/hw/bsp/imxrt/family.cmake b/hw/bsp/imxrt/family.cmake
index c2c067141..fc90b7e80 100644
--- a/hw/bsp/imxrt/family.cmake
+++ b/hw/bsp/imxrt/family.cmake
@@ -103,10 +103,6 @@ function(family_configure_example TARGET)
#---------- Port Specific ----------
# These files are built for each example since it depends on example's tusb_config.h
target_sources(${TARGET} PUBLIC
- # TinyUSB Port
- ${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
- ${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
- ${TOP}/src/portable/ehci/ehci.c
# BSP
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
@@ -121,6 +117,14 @@ function(family_configure_example TARGET)
# Add TinyUSB
family_add_tinyusb(${TARGET} OPT_MCU_MIMXRT1XXX)
+ # Add TinyUSB Port source
+ target_sources(${TARGET}-tinyusb PUBLIC
+ ${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
+ ${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
+ ${TOP}/src/portable/ehci/ehci.c
+ )
+ target_link_libraries(${TARGET}-tinyusb PUBLIC board_${BOARD})
+
# Link dependencies
target_link_libraries(${TARGET} PUBLIC board_${BOARD} ${TARGET}-tinyusb)