summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/bsp/lpc11/boards/lpcxpresso11u68/board.cmake2
-rw-r--r--hw/bsp/lpc11/family.cmake5
-rw-r--r--hw/bsp/lpc13/family.cmake14
-rw-r--r--hw/bsp/lpc15/family.cmake14
-rw-r--r--hw/bsp/lpc17/family.cmake18
-rw-r--r--hw/bsp/lpc18/family.cmake18
-rw-r--r--hw/bsp/lpc40/family.cmake18
-rw-r--r--hw/bsp/nrf/family.cmake40
8 files changed, 42 insertions, 87 deletions
diff --git a/hw/bsp/lpc11/boards/lpcxpresso11u68/board.cmake b/hw/bsp/lpc11/boards/lpcxpresso11u68/board.cmake
index b7393cb2f..36296fb54 100644
--- a/hw/bsp/lpc11/boards/lpcxpresso11u68/board.cmake
+++ b/hw/bsp/lpc11/boards/lpcxpresso11u68/board.cmake
@@ -5,7 +5,7 @@ set(PYOCD_TARGET LPC11U68)
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/lpc11u68.ld)
function(update_board TARGET)
- target_sources(${TARGET} PUBLIC
+ target_sources(${TARGET} PRIVATE
${SDK_DIR}/src/gpio_${LPC_FAMILY}.c
${SDK_DIR}/src/syscon_${LPC_FAMILY}.c
)
diff --git a/hw/bsp/lpc11/family.cmake b/hw/bsp/lpc11/family.cmake
index 506d76ed0..42578d403 100644
--- a/hw/bsp/lpc11/family.cmake
+++ b/hw/bsp/lpc11/family.cmake
@@ -23,7 +23,7 @@ set(FAMILY_MCUS LPC11UXX CACHE INTERNAL "")
# only need to be built ONCE for all examples
function(family_add_board BOARD_TARGET)
add_library(${BOARD_TARGET} STATIC
-
+ ${SDK_DIR}/../gcc/cr_startup_lpc${LPC_FAMILY}.c
${SDK_DIR}/src/chip_${LPC_FAMILY}.c
${SDK_DIR}/src/clock_${LPC_FAMILY}.c
${SDK_DIR}/src/iap.c
@@ -43,6 +43,8 @@ function(family_add_board BOARD_TARGET)
)
update_board(${BOARD_TARGET})
+
+ set_target_properties(${BOARD_TARGET} PROPERTIES COMPILE_FLAGS "-Wno-incompatible-pointer-types")
endfunction()
@@ -59,7 +61,6 @@ function(family_configure_example TARGET RTOS)
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
- ${SDK_DIR}/../gcc/cr_startup_lpc${LPC_FAMILY}.c
)
target_include_directories(${TARGET} PUBLIC
# family, hw, board
diff --git a/hw/bsp/lpc13/family.cmake b/hw/bsp/lpc13/family.cmake
index 5e6470b5f..6a66cfe95 100644
--- a/hw/bsp/lpc13/family.cmake
+++ b/hw/bsp/lpc13/family.cmake
@@ -64,14 +64,12 @@ endfunction()
#------------------------------------
function(family_configure_example TARGET RTOS)
family_configure_common(${TARGET} ${RTOS})
+ family_add_tinyusb(${TARGET} OPT_MCU_LPC13XX)
-
- #---------- Port Specific ----------
- # These files are built for each example since it depends on example's tusb_config.h
target_sources(${TARGET} PUBLIC
- # BSP
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
+ ${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -85,14 +83,6 @@ function(family_configure_example TARGET RTOS)
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
)
- # Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_LPC13XX)
- target_sources(${TARGET} PUBLIC
- ${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
- )
-
-
-
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
diff --git a/hw/bsp/lpc15/family.cmake b/hw/bsp/lpc15/family.cmake
index 589172132..8de26421d 100644
--- a/hw/bsp/lpc15/family.cmake
+++ b/hw/bsp/lpc15/family.cmake
@@ -66,14 +66,12 @@ endfunction()
#------------------------------------
function(family_configure_example TARGET RTOS)
family_configure_common(${TARGET} ${RTOS})
+ family_add_tinyusb(${TARGET} OPT_MCU_LPC15XX)
-
- #---------- Port Specific ----------
- # These files are built for each example since it depends on example's tusb_config.h
target_sources(${TARGET} PUBLIC
- # BSP
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
+ ${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -87,14 +85,6 @@ function(family_configure_example TARGET RTOS)
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
)
- # Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_LPC15XX)
- target_sources(${TARGET} PUBLIC
- ${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
- )
-
-
-
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
diff --git a/hw/bsp/lpc17/family.cmake b/hw/bsp/lpc17/family.cmake
index cd8b71110..92bcbff21 100644
--- a/hw/bsp/lpc17/family.cmake
+++ b/hw/bsp/lpc17/family.cmake
@@ -63,14 +63,14 @@ endfunction()
#------------------------------------
function(family_configure_example TARGET RTOS)
family_configure_common(${TARGET} ${RTOS})
+ family_add_tinyusb(${TARGET} OPT_MCU_LPC175X_6X)
-
- #---------- Port Specific ----------
- # These files are built for each example since it depends on example's tusb_config.h
target_sources(${TARGET} PUBLIC
- # BSP
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
+ ${TOP}/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
+ ${TOP}/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
+ ${TOP}/src/portable/ohci/ohci.c
)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -84,16 +84,6 @@ function(family_configure_example TARGET RTOS)
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
)
- # Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_LPC175X_6X)
- target_sources(${TARGET} PUBLIC
- ${TOP}/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
- ${TOP}/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
- ${TOP}/src/portable/ohci/ohci.c
- )
-
-
-
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
diff --git a/hw/bsp/lpc18/family.cmake b/hw/bsp/lpc18/family.cmake
index 655caee0e..27ee00f4c 100644
--- a/hw/bsp/lpc18/family.cmake
+++ b/hw/bsp/lpc18/family.cmake
@@ -61,14 +61,14 @@ endfunction()
#------------------------------------
function(family_configure_example TARGET RTOS)
family_configure_common(${TARGET} ${RTOS})
+ family_add_tinyusb(${TARGET} OPT_MCU_LPC18XX)
-
- #---------- Port Specific ----------
- # These files are built for each example since it depends on example's tusb_config.h
target_sources(${TARGET} PUBLIC
- # BSP
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
+ ${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_include_directories(${TARGET} PUBLIC
# family, hw, board
@@ -77,16 +77,6 @@ function(family_configure_example TARGET RTOS)
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
)
- # Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_LPC18XX)
- target_sources(${TARGET} 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
- )
-
-
-
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
diff --git a/hw/bsp/lpc40/family.cmake b/hw/bsp/lpc40/family.cmake
index d0e0bc9b1..211846444 100644
--- a/hw/bsp/lpc40/family.cmake
+++ b/hw/bsp/lpc40/family.cmake
@@ -64,14 +64,14 @@ endfunction()
#------------------------------------
function(family_configure_example TARGET RTOS)
family_configure_common(${TARGET} ${RTOS})
+ family_add_tinyusb(${TARGET} OPT_MCU_LPC40XX)
-
- #---------- Port Specific ----------
- # These files are built for each example since it depends on example's tusb_config.h
target_sources(${TARGET} PUBLIC
- # BSP
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
+ ${TOP}/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
+ ${TOP}/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
+ ${TOP}/src/portable/ohci/ohci.c
)
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -85,16 +85,6 @@ function(family_configure_example TARGET RTOS)
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
)
- # Add TinyUSB target and port source
- family_add_tinyusb(${TARGET} OPT_MCU_LPC40XX)
- target_sources(${TARGET} PUBLIC
- ${TOP}/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
- ${TOP}/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
- ${TOP}/src/portable/ohci/ohci.c
- )
-
-
-
# Flashing
family_add_bin_hex(${TARGET})
family_flash_jlink(${TARGET})
diff --git a/hw/bsp/nrf/family.cmake b/hw/bsp/nrf/family.cmake
index dbc126a6e..0c19d2155 100644
--- a/hw/bsp/nrf/family.cmake
+++ b/hw/bsp/nrf/family.cmake
@@ -43,6 +43,7 @@ endif ()
if (NOT DEFINED LD_FILE_GNU)
set(LD_FILE_GNU ${LD_FILE_GNU_DEFAULT})
endif ()
+set(LD_FILE_Clang ${LD_FILE_GNU})
#------------------------------------
# Board Target
@@ -112,14 +113,13 @@ function(family_configure_example TARGET RTOS)
family_configure_common(${TARGET} ${RTOS})
family_add_tinyusb(${TARGET} OPT_MCU_${FAMILY_MCUS})
- target_sources(${TARGET} PUBLIC
+ target_sources(${TARGET} PRIVATE
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
${TOP}/src/portable/nordic/nrf5x/dcd_nrf5x.c
${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c
${TOP}/src/portable/synopsys/dwc2/hcd_dwc2.c
${TOP}/src/portable/synopsys/dwc2/dwc2_common.c
- ${STARTUP_FILE_${CMAKE_C_COMPILER_ID}}
)
target_include_directories(${TARGET} PUBLIC
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
@@ -127,22 +127,26 @@ function(family_configure_example TARGET RTOS)
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
)
- if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
- target_link_options(${TARGET} PUBLIC
- "LINKER:--script=${LD_FILE_GNU}"
- -L${NRFX_PATH}/mdk
- --specs=nosys.specs --specs=nano.specs
- -nostartfiles
- )
- elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
- target_link_options(${TARGET} PUBLIC
- "LINKER:--script=${LD_FILE_GNU}"
- -L${NRFX_PATH}/mdk
- )
- elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
- target_link_options(${TARGET} PUBLIC
- "LINKER:--config=${LD_FILE_IAR}"
- )
+ if (NOT RTOS STREQUAL zephyr)
+ target_sources(${TARGET} PRIVATE ${STARTUP_FILE_${CMAKE_C_COMPILER_ID}})
+
+ if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ target_link_options(${TARGET} PUBLIC
+ "LINKER:--script=${LD_FILE_GNU}"
+ -L${NRFX_PATH}/mdk
+ --specs=nosys.specs --specs=nano.specs
+ -nostartfiles
+ )
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
+ target_link_options(${TARGET} PUBLIC
+ "LINKER:--script=${LD_FILE_GNU}"
+ -L${NRFX_PATH}/mdk
+ )
+ elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
+ target_link_options(${TARGET} PUBLIC
+ "LINKER:--config=${LD_FILE_IAR}"
+ )
+ endif ()
endif ()
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")