Skip to content

Commit bde4499

Browse files
committed
fix more build
1 parent c8a1b75 commit bde4499

File tree

8 files changed

+42
-87
lines changed

8 files changed

+42
-87
lines changed

hw/bsp/lpc11/boards/lpcxpresso11u68/board.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set(PYOCD_TARGET LPC11U68)
55
set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/lpc11u68.ld)
66

77
function(update_board TARGET)
8-
target_sources(${TARGET} PUBLIC
8+
target_sources(${TARGET} PRIVATE
99
${SDK_DIR}/src/gpio_${LPC_FAMILY}.c
1010
${SDK_DIR}/src/syscon_${LPC_FAMILY}.c
1111
)

hw/bsp/lpc11/family.cmake

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ set(FAMILY_MCUS LPC11UXX CACHE INTERNAL "")
2323
# only need to be built ONCE for all examples
2424
function(family_add_board BOARD_TARGET)
2525
add_library(${BOARD_TARGET} STATIC
26-
26+
${SDK_DIR}/../gcc/cr_startup_lpc${LPC_FAMILY}.c
2727
${SDK_DIR}/src/chip_${LPC_FAMILY}.c
2828
${SDK_DIR}/src/clock_${LPC_FAMILY}.c
2929
${SDK_DIR}/src/iap.c
@@ -43,6 +43,8 @@ function(family_add_board BOARD_TARGET)
4343
)
4444

4545
update_board(${BOARD_TARGET})
46+
47+
set_target_properties(${BOARD_TARGET} PROPERTIES COMPILE_FLAGS "-Wno-incompatible-pointer-types")
4648
endfunction()
4749

4850

@@ -59,7 +61,6 @@ function(family_configure_example TARGET RTOS)
5961
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
6062
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
6163
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
62-
${SDK_DIR}/../gcc/cr_startup_lpc${LPC_FAMILY}.c
6364
)
6465
target_include_directories(${TARGET} PUBLIC
6566
# family, hw, board

hw/bsp/lpc13/family.cmake

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,12 @@ endfunction()
6464
#------------------------------------
6565
function(family_configure_example TARGET RTOS)
6666
family_configure_common(${TARGET} ${RTOS})
67+
family_add_tinyusb(${TARGET} OPT_MCU_LPC13XX)
6768

68-
69-
#---------- Port Specific ----------
70-
# These files are built for each example since it depends on example's tusb_config.h
7169
target_sources(${TARGET} PUBLIC
72-
# BSP
7370
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
7471
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
72+
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
7573
)
7674

7775
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -85,14 +83,6 @@ function(family_configure_example TARGET RTOS)
8583
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
8684
)
8785

88-
# Add TinyUSB target and port source
89-
family_add_tinyusb(${TARGET} OPT_MCU_LPC13XX)
90-
target_sources(${TARGET} PUBLIC
91-
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
92-
)
93-
94-
95-
9686
# Flashing
9787
family_add_bin_hex(${TARGET})
9888
family_flash_jlink(${TARGET})

hw/bsp/lpc15/family.cmake

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,12 @@ endfunction()
6666
#------------------------------------
6767
function(family_configure_example TARGET RTOS)
6868
family_configure_common(${TARGET} ${RTOS})
69+
family_add_tinyusb(${TARGET} OPT_MCU_LPC15XX)
6970

70-
71-
#---------- Port Specific ----------
72-
# These files are built for each example since it depends on example's tusb_config.h
7371
target_sources(${TARGET} PUBLIC
74-
# BSP
7572
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
7673
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
74+
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
7775
)
7876

7977
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -87,14 +85,6 @@ function(family_configure_example TARGET RTOS)
8785
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
8886
)
8987

90-
# Add TinyUSB target and port source
91-
family_add_tinyusb(${TARGET} OPT_MCU_LPC15XX)
92-
target_sources(${TARGET} PUBLIC
93-
${TOP}/src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c
94-
)
95-
96-
97-
9888
# Flashing
9989
family_add_bin_hex(${TARGET})
10090
family_flash_jlink(${TARGET})

hw/bsp/lpc17/family.cmake

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ endfunction()
6363
#------------------------------------
6464
function(family_configure_example TARGET RTOS)
6565
family_configure_common(${TARGET} ${RTOS})
66+
family_add_tinyusb(${TARGET} OPT_MCU_LPC175X_6X)
6667

67-
68-
#---------- Port Specific ----------
69-
# These files are built for each example since it depends on example's tusb_config.h
7068
target_sources(${TARGET} PUBLIC
71-
# BSP
7269
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
7370
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
71+
${TOP}/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
72+
${TOP}/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
73+
${TOP}/src/portable/ohci/ohci.c
7474
)
7575

7676
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -84,16 +84,6 @@ function(family_configure_example TARGET RTOS)
8484
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
8585
)
8686

87-
# Add TinyUSB target and port source
88-
family_add_tinyusb(${TARGET} OPT_MCU_LPC175X_6X)
89-
target_sources(${TARGET} PUBLIC
90-
${TOP}/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
91-
${TOP}/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
92-
${TOP}/src/portable/ohci/ohci.c
93-
)
94-
95-
96-
9787
# Flashing
9888
family_add_bin_hex(${TARGET})
9989
family_flash_jlink(${TARGET})

hw/bsp/lpc18/family.cmake

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,14 @@ endfunction()
6161
#------------------------------------
6262
function(family_configure_example TARGET RTOS)
6363
family_configure_common(${TARGET} ${RTOS})
64+
family_add_tinyusb(${TARGET} OPT_MCU_LPC18XX)
6465

65-
66-
#---------- Port Specific ----------
67-
# These files are built for each example since it depends on example's tusb_config.h
6866
target_sources(${TARGET} PUBLIC
69-
# BSP
7067
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
7168
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
69+
${TOP}/src/portable/chipidea/ci_hs/dcd_ci_hs.c
70+
${TOP}/src/portable/chipidea/ci_hs/hcd_ci_hs.c
71+
${TOP}/src/portable/ehci/ehci.c
7272
)
7373
target_include_directories(${TARGET} PUBLIC
7474
# family, hw, board
@@ -77,16 +77,6 @@ function(family_configure_example TARGET RTOS)
7777
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
7878
)
7979

80-
# Add TinyUSB target and port source
81-
family_add_tinyusb(${TARGET} OPT_MCU_LPC18XX)
82-
target_sources(${TARGET} PUBLIC
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
86-
)
87-
88-
89-
9080
# Flashing
9181
family_add_bin_hex(${TARGET})
9282
family_flash_jlink(${TARGET})

hw/bsp/lpc40/family.cmake

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ endfunction()
6464
#------------------------------------
6565
function(family_configure_example TARGET RTOS)
6666
family_configure_common(${TARGET} ${RTOS})
67+
family_add_tinyusb(${TARGET} OPT_MCU_LPC40XX)
6768

68-
69-
#---------- Port Specific ----------
70-
# These files are built for each example since it depends on example's tusb_config.h
7169
target_sources(${TARGET} PUBLIC
72-
# BSP
7370
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
7471
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
72+
${TOP}/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
73+
${TOP}/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
74+
${TOP}/src/portable/ohci/ohci.c
7575
)
7676

7777
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
@@ -85,16 +85,6 @@ function(family_configure_example TARGET RTOS)
8585
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
8686
)
8787

88-
# Add TinyUSB target and port source
89-
family_add_tinyusb(${TARGET} OPT_MCU_LPC40XX)
90-
target_sources(${TARGET} PUBLIC
91-
${TOP}/src/portable/nxp/lpc17_40/dcd_lpc17_40.c
92-
${TOP}/src/portable/nxp/lpc17_40/hcd_lpc17_40.c
93-
${TOP}/src/portable/ohci/ohci.c
94-
)
95-
96-
97-
9888
# Flashing
9989
family_add_bin_hex(${TARGET})
10090
family_flash_jlink(${TARGET})

hw/bsp/nrf/family.cmake

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ endif ()
4343
if (NOT DEFINED LD_FILE_GNU)
4444
set(LD_FILE_GNU ${LD_FILE_GNU_DEFAULT})
4545
endif ()
46+
set(LD_FILE_Clang ${LD_FILE_GNU})
4647

4748
#------------------------------------
4849
# Board Target
@@ -112,37 +113,40 @@ function(family_configure_example TARGET RTOS)
112113
family_configure_common(${TARGET} ${RTOS})
113114
family_add_tinyusb(${TARGET} OPT_MCU_${FAMILY_MCUS})
114115

115-
target_sources(${TARGET} PUBLIC
116+
target_sources(${TARGET} PRIVATE
116117
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/family.c
117118
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../board.c
118119
${TOP}/src/portable/nordic/nrf5x/dcd_nrf5x.c
119120
${TOP}/src/portable/synopsys/dwc2/dcd_dwc2.c
120121
${TOP}/src/portable/synopsys/dwc2/hcd_dwc2.c
121122
${TOP}/src/portable/synopsys/dwc2/dwc2_common.c
122-
${STARTUP_FILE_${CMAKE_C_COMPILER_ID}}
123123
)
124124
target_include_directories(${TARGET} PUBLIC
125125
${CMAKE_CURRENT_FUNCTION_LIST_DIR}
126126
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../
127127
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/boards/${BOARD}
128128
)
129129

130-
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
131-
target_link_options(${TARGET} PUBLIC
132-
"LINKER:--script=${LD_FILE_GNU}"
133-
-L${NRFX_PATH}/mdk
134-
--specs=nosys.specs --specs=nano.specs
135-
-nostartfiles
136-
)
137-
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
138-
target_link_options(${TARGET} PUBLIC
139-
"LINKER:--script=${LD_FILE_GNU}"
140-
-L${NRFX_PATH}/mdk
141-
)
142-
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
143-
target_link_options(${TARGET} PUBLIC
144-
"LINKER:--config=${LD_FILE_IAR}"
145-
)
130+
if (NOT RTOS STREQUAL zephyr)
131+
target_sources(${TARGET} PRIVATE ${STARTUP_FILE_${CMAKE_C_COMPILER_ID}})
132+
133+
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
134+
target_link_options(${TARGET} PUBLIC
135+
"LINKER:--script=${LD_FILE_GNU}"
136+
-L${NRFX_PATH}/mdk
137+
--specs=nosys.specs --specs=nano.specs
138+
-nostartfiles
139+
)
140+
elseif (CMAKE_C_COMPILER_ID STREQUAL "Clang")
141+
target_link_options(${TARGET} PUBLIC
142+
"LINKER:--script=${LD_FILE_GNU}"
143+
-L${NRFX_PATH}/mdk
144+
)
145+
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
146+
target_link_options(${TARGET} PUBLIC
147+
"LINKER:--config=${LD_FILE_IAR}"
148+
)
149+
endif ()
146150
endif ()
147151

148152
if (CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")

0 commit comments

Comments
 (0)