Skip to content

Commit

Permalink
Merge pull request #2728 from hathach/hil-add-lpc11u377
Browse files Browse the repository at this point in the history
[HIL] add lpc11u37 for hil test
  • Loading branch information
hathach authored Jul 19, 2024
2 parents e9f9d43 + 66193cb commit e09cf36
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .idea/cmake.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions hw/bsp/lpc11/family.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
1 change: 1 addition & 0 deletions hw/bsp/lpc11/family.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
7 changes: 6 additions & 1 deletion hw/bsp/lpc11/family.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions test/hil/rpi.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
2 changes: 1 addition & 1 deletion tools/get_deps.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
'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',
Expand Down

0 comments on commit e09cf36

Please sign in to comment.