Skip to content

Commit 088180e

Browse files
committed
add iar support for lpc43, add lpcxpresso43s67 to hil farm
1 parent 78e5b2c commit 088180e

File tree

6 files changed

+71
-124
lines changed

6 files changed

+71
-124
lines changed

.github/workflows/build_iar.yml

Lines changed: 1 addition & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
# Alphabetical order
3333
# Note: bundle multiple families into a matrix since there is only one self-hosted instance can
3434
# run IAR build. Too many matrix can hurt due to setup/teardown overhead.
35-
- 'stm32f0 stm32f1 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l4'
35+
- 'lpc43 stm32f0 stm32f1 stm32f4 stm32f7 stm32g0 stm32g4 stm32h7 stm32l4'
3636
steps:
3737
- name: Clean workspace
3838
run: |
@@ -52,82 +52,3 @@ jobs:
5252
- name: Test on actual hardware (hardware in the loop)
5353
run: |
5454
python3 test/hil/hil_test.py hil_hfp.json
55-
56-
# # Upload binaries for hardware test with self-hosted
57-
# - name: Prepare stm32l412nucleo Artifacts
58-
# if: contains(matrix.family, 'stm32l4')
59-
# working-directory: ${{github.workspace}}/cmake-build/cmake-build-stm32l412nucleo
60-
# run: |
61-
# find device/ -name "*.elf" -exec mv {} ../../ \;
62-
#
63-
# - name: Upload Artifacts for stm32l412nucleo
64-
# if: contains(matrix.family, 'stm32l4') && github.repository_owner == 'hathach'
65-
# uses: actions/upload-artifact@v3
66-
# with:
67-
# name: stm32l4
68-
# path: |
69-
# *.elf
70-
71-
# ---------------------------------------
72-
# Hardware in the loop (HIL)
73-
# Current self-hosted instance is running on an EPYC 7232 server hosted by HiFiPhile user
74-
# ---------------------------------------
75-
# hw-stm32l412nucleo-test:
76-
# needs: cmake
77-
# runs-on: [self-hosted, Linux, X64, hifiphile]
78-
#
79-
# steps:
80-
# - name: Clean workspace
81-
# run: |
82-
# echo "Cleaning up previous run"
83-
# rm -rf "${{ github.workspace }}"
84-
# mkdir -p "${{ github.workspace }}"
85-
#
86-
# - name: Download stm32l4 Artifacts
87-
# uses: actions/download-artifact@v3
88-
# with:
89-
# name: stm32l4
90-
#
91-
# - name: Create flash.sh
92-
# run: |
93-
# echo > flash.sh 'echo halt > flash.jlink'
94-
# echo >> flash.sh 'echo r >> flash.jlink'
95-
# echo >> flash.sh 'echo loadfile $1 >> flash.jlink'
96-
# echo >> flash.sh 'echo r >> flash.jlink'
97-
# echo >> flash.sh 'echo go >> flash.jlink'
98-
# echo >> flash.sh 'echo exit >> flash.jlink'
99-
# echo >> flash.sh 'cmdout=$(JLinkExe -USB 774470029 -device stm32l412kb -if swd -JTAGConf -1,-1 -speed auto -NoGui 1 -ExitOnError 1 -CommandFile flash.jlink)'
100-
# echo >> flash.sh 'if (( $? )) ; then echo $cmdout ; fi'
101-
# chmod +x flash.sh
102-
#
103-
# - name: Test cdc_dual_ports
104-
# run: |
105-
# ./flash.sh cdc_dual_ports.elf
106-
# while (! ([ -e /dev/ttyACM1 ] && [ -e /dev/ttyACM2 ])) && [ $SECONDS -le 10 ]; do :; done
107-
# test -e /dev/ttyACM1 && echo "ttyACM1 exists"
108-
# test -e /dev/ttyACM2 && echo "ttyACM2 exists"
109-
#
110-
# # Debian does not auto mount usb drive. skip this test for now
111-
# - name: Test cdc_msc
112-
# if: false
113-
# run: |
114-
# ./flash.sh cdc_msc.elf
115-
# readme='/media/pi/TinyUSB MSC/README.TXT'
116-
# while (! ([ -e /dev/ttyACM1 ] && [ -f "$readme" ])) && [ $SECONDS -le 10 ]; do :; done
117-
# test -e /dev/ttyACM1 && echo "ttyACM1 exists"
118-
# test -f "$readme" && echo "$readme exists"
119-
# cat "$readme"
120-
#
121-
# - name: Test dfu
122-
# run: |
123-
# ./flash.sh dfu.elf
124-
# while (! (dfu-util -l | grep "Found DFU")) && [ $SECONDS -le 10 ]; do :; done
125-
# dfu-util -d cafe -a 0 -U dfu0
126-
# dfu-util -d cafe -a 1 -U dfu1
127-
# grep "TinyUSB DFU! - Partition 0" dfu0
128-
# grep "TinyUSB DFU! - Partition 1" dfu1
129-
#
130-
# - name: Test dfu_runtime
131-
# run: |
132-
# ./flash.sh dfu_runtime.elf
133-
# while (! (dfu-util -l | grep "Found Runtime")) && [ $SECONDS -le 10 ]; do :; done

examples/host/msc_file_explorer/CMakeLists.txt

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@ target_sources(${PROJECT} PUBLIC
2222
)
2323

2424
# Suppress warnings on fatfs
25-
set_source_files_properties(
26-
${TOP}/lib/fatfs/source/ff.c
27-
PROPERTIES
28-
COMPILE_FLAGS "-Wno-conversion -Wno-cast-qual"
29-
)
25+
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
26+
set_source_files_properties(
27+
${TOP}/lib/fatfs/source/ff.c
28+
PROPERTIES
29+
COMPILE_FLAGS "-Wno-conversion -Wno-cast-qual"
30+
)
31+
endif ()
3032

3133
# Example include
3234
target_include_directories(${PROJECT} PUBLIC

hw/bsp/lpc43/family.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,25 @@ const uint32_t ExtRateIn = 0;
6363
void SystemInit(void)
6464
{
6565
#ifdef __USE_LPCOPEN
66-
extern void (* const g_pfnVectors[])(void);
6766
unsigned int *pSCB_VTOR = (unsigned int *) 0xE000ED08;
67+
68+
#ifdef __ICCARM__
69+
extern void *__vector_table;
70+
*pSCB_VTOR = (unsigned int) &__vector_table;
71+
72+
#elif defined(__ARMCC_VERSION)
73+
extern void *__Vectors;
74+
*pSCB_VTOR = (unsigned int) &__Vectors;
75+
76+
#else // other compoiler using cr_startup_lpc43xx.c
77+
extern void (* const g_pfnVectors[])(void);
6878
*pSCB_VTOR = (unsigned int) g_pfnVectors;
79+
#endif
6980

70-
#if __FPU_USED == 1
81+
#if __FPU_USED == 1
7182
fpuInit();
72-
#endif
83+
#endif
84+
7385
#endif
7486

7587
/* Setup system level pin muxing */

hw/bsp/lpc43/family.cmake

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -17,43 +17,48 @@ set(FAMILY_MCUS LPC43XX CACHE INTERNAL "")
1717
#------------------------------------
1818
# only need to be built ONCE for all examples
1919
function(add_board_target BOARD_TARGET)
20-
if (NOT TARGET ${BOARD_TARGET})
21-
add_library(${BOARD_TARGET} STATIC
22-
${SDK_DIR}/../gcc/cr_startup_lpc43xx.c
23-
${SDK_DIR}/src/chip_18xx_43xx.c
24-
${SDK_DIR}/src/clock_18xx_43xx.c
25-
${SDK_DIR}/src/fpu_init.c
26-
${SDK_DIR}/src/gpio_18xx_43xx.c
27-
${SDK_DIR}/src/iap_18xx_43xx.c
28-
${SDK_DIR}/src/sysinit_18xx_43xx.c
29-
${SDK_DIR}/src/uart_18xx_43xx.c
30-
)
31-
target_compile_options(${BOARD_TARGET} PUBLIC
32-
-nostdlib
33-
)
34-
target_compile_definitions(${BOARD_TARGET} PUBLIC
35-
__USE_LPCOPEN
36-
CORE_M4
20+
if (TARGET ${BOARD_TARGET})
21+
return()
22+
endif ()
23+
24+
# Startup & Linker script
25+
set(STARTUP_FILE_GNU ${SDK_DIR}/../gcc/cr_startup_lpc43xx.c)
26+
set(STARTUP_FILE_IAR ${SDK_DIR}/../iar/iar_startup_lpc18xx43xx.s)
27+
set(LD_FILE_IAR ${SDK_DIR}/../iar/linker/lpc18xx_43xx_ldscript_iflash.icf)
28+
29+
add_library(${BOARD_TARGET} STATIC
30+
${STARTUP_FILE_${CMAKE_C_COMPILER_ID}}
31+
${SDK_DIR}/src/chip_18xx_43xx.c
32+
${SDK_DIR}/src/clock_18xx_43xx.c
33+
${SDK_DIR}/src/fpu_init.c
34+
${SDK_DIR}/src/gpio_18xx_43xx.c
35+
${SDK_DIR}/src/iap_18xx_43xx.c
36+
${SDK_DIR}/src/sysinit_18xx_43xx.c
37+
${SDK_DIR}/src/uart_18xx_43xx.c
38+
)
39+
target_compile_definitions(${BOARD_TARGET} PUBLIC
40+
__USE_LPCOPEN
41+
CORE_M4
42+
)
43+
target_include_directories(${BOARD_TARGET} PUBLIC
44+
${SDK_DIR}/inc
45+
${SDK_DIR}/inc/config_43xx
46+
)
47+
48+
update_board(${BOARD_TARGET})
49+
50+
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
51+
target_compile_options(${BOARD_TARGET} PUBLIC -nostdlib)
52+
target_link_options(${BOARD_TARGET} PUBLIC
53+
"LINKER:--script=${LD_FILE_GNU}"
54+
# nanolib
55+
--specs=nosys.specs
56+
--specs=nano.specs
3757
)
38-
target_include_directories(${BOARD_TARGET} PUBLIC
39-
${SDK_DIR}/inc
40-
${SDK_DIR}/inc/config_43xx
58+
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
59+
target_link_options(${BOARD_TARGET} PUBLIC
60+
"LINKER:--config=${LD_FILE_IAR}"
4161
)
42-
43-
update_board(${BOARD_TARGET})
44-
45-
if (CMAKE_C_COMPILER_ID STREQUAL "GNU")
46-
target_link_options(${BOARD_TARGET} PUBLIC
47-
"LINKER:--script=${LD_FILE_GNU}"
48-
# nanolib
49-
--specs=nosys.specs
50-
--specs=nano.specs
51-
)
52-
elseif (CMAKE_C_COMPILER_ID STREQUAL "IAR")
53-
target_link_options(${BOARD_TARGET} PUBLIC
54-
"LINKER:--config=${LD_FILE_IAR}"
55-
)
56-
endif ()
5762
endif ()
5863
endfunction()
5964

test/hil/hil_hfp.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313
"debugger": "jlink",
1414
"debugger_sn": "770935966",
1515
"cpu": "STM32F746NG"
16+
},
17+
{
18+
"name": "lpcxpresso43s67",
19+
"uid": "08F000044528BAAA8D858F58C50700F5",
20+
"debugger": "jlink",
21+
"debugger_sn": "728973776",
22+
"cpu": "LPC43S67_M4"
1623
}
1724
]
1825
}

tools/get_deps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
'2204191ec76283371419fbcec207da02e1bc22fa',
4949
'nuc'],
5050
'hw/mcu/nxp/lpcopen': ['https://github.com/hathach/nxp_lpcopen.git',
51-
'43c45c85405a5dd114fff0ea95cca62837740c13',
51+
'84e0bd3e43910aaf71eefd62075cf57495418312',
5252
'lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43'],
5353
'hw/mcu/nxp/mcux-sdk': ['https://github.com/hathach/mcux-sdk.git',
5454
'950819b7de9b32f92c3edf396bc5ffb8d66e7009',

0 commit comments

Comments
 (0)