summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Thach <[email protected]>2024-07-20 00:33:22 +0700
committerGitHub <[email protected]>2024-07-20 00:33:22 +0700
commite09cf361048ec4a77ce6ec6ac35f1b8b2d62d76c (patch)
treeaab832a97e25c71c513d57b0601bb03907075fa8
parente9f9d43d67804dc853cd064e8c0e204f2758731f (diff)
parent66193cba05dc9205254dcb839bbea3a53fd03eee (diff)
Merge pull request #2728 from hathach/hil-add-lpc11u377
[HIL] add lpc11u37 for hil test
-rw-r--r--.idea/cmake.xml3
-rw-r--r--hw/bsp/lpc11/family.c7
-rw-r--r--hw/bsp/lpc11/family.cmake1
-rw-r--r--hw/bsp/lpc11/family.mk7
-rw-r--r--test/hil/rpi.json7
-rw-r--r--tools/get_deps.py2
6 files changed, 24 insertions, 3 deletions
diff --git a/.idea/cmake.xml b/.idea/cmake.xml
index f09e185b1..67e793016 100644
--- a/.idea/cmake.xml
+++ b/.idea/cmake.xml
@@ -69,7 +69,7 @@
<configuration PROFILE_NAME="metro_m4_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m4_express" />
<configuration PROFILE_NAME="itsybitsy_m4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=itsybitsy_m4" />
<configuration PROFILE_NAME="same54_xplained" ENABLED="false" GENERATION_OPTIONS="-DBOARD=same54_xplained -DLOG=2 -DLOGGER=RTT" />
- <configuration PROFILE_NAME="feather_nrf52840_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_nrf52840_express -DLOG=3 -DLOGGER=RTT -DMAX3421_HOST=1" />
+ <configuration PROFILE_NAME="feather_nrf52840_express" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=feather_nrf52840_express -DLOG=1 -DLOGGER=RTT -DMAX3421_HOST=1" />
<configuration PROFILE_NAME="pca10056" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10056 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="pca10095" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=pca10095 -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
<configuration PROFILE_NAME="metro m7 1011 sd" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=metro_m7_1011_sd -DLOG=3 -DLOGGER=RTT -DTRACE_ETM=1" />
@@ -117,6 +117,7 @@
<configuration PROFILE_NAME="raspberrypi_zero" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberrypi_zero -DLOG=2" />
<configuration PROFILE_NAME="raspberrypi_cm4" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberrypi_cm4 -DLOG=2" />
<configuration PROFILE_NAME="raspberrypi_zero2" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=raspberrypi_zero2 -DLOG=2" />
+ <configuration PROFILE_NAME="lpcxpresso11u37" ENABLED="false" GENERATION_OPTIONS="-DBOARD=lpcxpresso11u37" />
<configuration PROFILE_NAME="lpcxpresso11u68" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso11u68 -DLOG=2 -DLOGGER=RTT" />
<configuration PROFILE_NAME="lpcxpresso1347" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso1347 -DLOG=2 -DLOGGER=RTT" />
<configuration PROFILE_NAME="lpcxpresso1549" ENABLED="false" CONFIG_NAME="Debug" GENERATION_OPTIONS="-DBOARD=lpcxpresso1549 -DLOG=2 -DLOGGER=RTT" />
diff --git a/hw/bsp/lpc11/family.c b/hw/bsp/lpc11/family.c
index bff7110b8..e75bc4919 100644
--- a/hw/bsp/lpc11/family.c
+++ b/hw/bsp/lpc11/family.c
@@ -90,6 +90,13 @@ void board_led_write(bool state) {
Chip_GPIO_SetPinState(LPC_GPIO, LED_PORT, LED_PIN, state ? LED_STATE_ON : (1 - LED_STATE_ON));
}
+size_t board_get_unique_id(uint8_t id[], size_t max_len) {
+ if ( max_len < 16 ) return 0;
+ uint32_t* id32 = (uint32_t*) (uintptr_t) id;
+ id32[0] = Chip_IAP_ReadUID();
+ return 4;
+}
+
uint32_t board_button_read(void) {
return BUTTON_STATE_ACTIVE == Chip_GPIO_GetPinState(LPC_GPIO, BUTTON_PORT, BUTTON_PIN);
}
diff --git a/hw/bsp/lpc11/family.cmake b/hw/bsp/lpc11/family.cmake
index f17a48dd7..818600656 100644
--- a/hw/bsp/lpc11/family.cmake
+++ b/hw/bsp/lpc11/family.cmake
@@ -30,6 +30,7 @@ function(add_board_target BOARD_TARGET)
${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
${SDK_DIR}/src/iocon_${LPC_FAMILY}.c
${SDK_DIR}/src/sysinit_${LPC_FAMILY}.c
)
diff --git a/hw/bsp/lpc11/family.mk b/hw/bsp/lpc11/family.mk
index 09713fd55..a3ec33768 100644
--- a/hw/bsp/lpc11/family.mk
+++ b/hw/bsp/lpc11/family.mk
@@ -9,13 +9,18 @@ CFLAGS += \
-DCFG_TUSB_MCU=OPT_MCU_LPC11UXX \
-DCFG_TUSB_MEM_ALIGN='__attribute__((aligned(64)))'
-LDFLAGS_GCC += -specs=nosys.specs -specs=nano.specs
+# mcu driver cause following warnings
+CFLAGS += \
+ -Wno-error=incompatible-pointer-types \
+
+LDFLAGS_GCC += --specs=nosys.specs --specs=nano.specs
SRC_C += \
src/portable/nxp/lpc_ip3511/dcd_lpc_ip3511.c \
$(MCU_DIR)/../gcc/cr_startup_lpc$(MCU_DRV).c \
$(MCU_DIR)/src/chip_$(MCU_DRV).c \
$(MCU_DIR)/src/clock_$(MCU_DRV).c \
+ $(MCU_DIR)/src/iap.c \
$(MCU_DIR)/src/iocon_$(MCU_DRV).c \
$(MCU_DIR)/src/sysinit_$(MCU_DRV).c
diff --git a/test/hil/rpi.json b/test/hil/rpi.json
index 98d576db8..bd20b3313 100644
--- a/test/hil/rpi.json
+++ b/test/hil/rpi.json
@@ -46,6 +46,13 @@
"flasher": "jlink",
"flasher_sn": "000831174392",
"flasher_args": "-device R7FA4M1AB"
+ },
+ {
+ "name": "lpcxpresso11u37",
+ "uid": "17121919",
+ "flasher": "jlink",
+ "flasher_sn": "000724441579",
+ "flasher_args": "-device LPC11U37/401"
}
]
}
diff --git a/tools/get_deps.py b/tools/get_deps.py
index 555e2d707..7fbde0e02 100644
--- a/tools/get_deps.py
+++ b/tools/get_deps.py
@@ -49,7 +49,7 @@ deps_optional = {
'2204191ec76283371419fbcec207da02e1bc22fa',
'nuc'],
'hw/mcu/nxp/lpcopen': ['https://github.com/hathach/nxp_lpcopen.git',
- '04bfe7a5f6ee74a89a28ad618d3367dcfcfb7d83',
+ 'b41cf930e65c734d8ec6de04f1d57d46787c76ae',
'lpc11 lpc13 lpc15 lpc17 lpc18 lpc40 lpc43'],
'hw/mcu/nxp/mcux-sdk': ['https://github.com/hathach/mcux-sdk.git',
'144f1eb7ea8c06512e12f12b27383601c0272410',