change hil board s3 devkitm (devkitc seems to have usb issue with cp2104)

This commit is contained in:
hathach 2024-04-24 16:17:33 +07:00
parent eaec0fb139
commit b67cb26e51
No known key found for this signature in database
GPG Key ID: 26FAB84F615C3C52
14 changed files with 56 additions and 51 deletions

View File

@ -47,7 +47,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://developer.arm.com/-/media/Files/downloads/gnu-a/10.3-2021.07/binrel/gcc-arm-10.3-2021.07-x86_64-aarch64-none-elf.tar.xz
- name: Cache Toolchain - name: Cache Toolchain
uses: actions/cache@v3 uses: actions/cache@v4
id: cache-toolchain id: cache-toolchain
with: with:
path: ~/cache/ path: ~/cache/

View File

@ -168,7 +168,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-17.0.1/LLVMEmbeddedToolchainForArm-17.0.1-Linux-x86_64.tar.xz run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/ARM-software/LLVM-embedded-toolchain-for-Arm/releases/download/release-17.0.1/LLVMEmbeddedToolchainForArm-17.0.1-Linux-x86_64.tar.xz
- name: Cache Toolchain - name: Cache Toolchain
uses: actions/cache@v3 uses: actions/cache@v4
id: cache-toolchain id: cache-toolchain
with: with:
path: ~/cache/ path: ~/cache/
@ -216,7 +216,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2 run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSPGCC/9_2_0_0/export/msp430-gcc-9.2.0.50_linux64.tar.bz2
- name: Cache Toolchain - name: Cache Toolchain
uses: actions/cache@v3 uses: actions/cache@v4
id: cache-toolchain id: cache-toolchain
with: with:
path: ~/cache/ path: ~/cache/

View File

@ -34,7 +34,7 @@ jobs:
# ESP32-S2 # ESP32-S2
- 'espressif_kaluga_1' - 'espressif_kaluga_1'
# ESP32-S3 # ESP32-S3
- 'espressif_s3_devkitc' - 'espressif_s3_devkitm'
steps: steps:
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v5 uses: actions/setup-python@v5
@ -51,7 +51,7 @@ jobs:
run: docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python3 tools/build_esp32.py ${{ matrix.board }} run: docker run --rm -v $PWD:/project -w /project espressif/idf:v5.1.1 python3 tools/build_esp32.py ${{ matrix.board }}
- name: Upload Artifacts for Hardware Testing - name: Upload Artifacts for Hardware Testing
if: matrix.board == 'espressif_s3_devkitc' && github.repository_owner == 'hathach' if: matrix.board == 'espressif_s3_devkitm' && github.repository_owner == 'hathach'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v4
with: with:
name: ${{ matrix.board }} name: ${{ matrix.board }}
@ -75,7 +75,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
board: board:
- 'espressif_s3_devkitc' - 'espressif_s3_devkitm'
steps: steps:
- name: Clean workspace - name: Clean workspace
run: | run: |

View File

@ -46,7 +46,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run run: echo >> $GITHUB_ENV TOOLCHAIN_URL=http://gcc-renesas.com/downloads/get.php?f=rx/8.3.0.202004-gnurx/gcc-8.3.0.202004-GNURX-ELF.run
- name: Cache Toolchain - name: Cache Toolchain
uses: actions/cache@v3 uses: actions/cache@v4
id: cache-toolchain id: cache-toolchain
with: with:
path: ~/cache/ path: ~/cache/

View File

@ -48,7 +48,7 @@ jobs:
run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz run: echo >> $GITHUB_ENV TOOLCHAIN_URL=https://github.com/xpack-dev-tools/riscv-none-embed-gcc-xpack/releases/download/v10.1.0-1.1/xpack-riscv-none-embed-gcc-10.1.0-1.1-linux-x64.tar.gz
- name: Cache Toolchain - name: Cache Toolchain
uses: actions/cache@v3 uses: actions/cache@v4
id: cache-toolchain id: cache-toolchain
with: with:
path: ~/cache/ path: ~/cache/

View File

@ -15,6 +15,8 @@ TOP = $(abspath $(subst make.mk,../../..,$(THIS_MAKEFILE)))
# Set CURRENT_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos # Set CURRENT_PATH to the relative path from TOP to the current directory, ie examples/device/cdc_msc_freertos
CURRENT_PATH = $(subst $(TOP)/,,$(abspath .)) CURRENT_PATH = $(subst $(TOP)/,,$(abspath .))
#-------------- Linux/Windows ------------
# Detect whether shell style is windows or not # Detect whether shell style is windows or not
# https://stackoverflow.com/questions/714100/os-detecting-makefile/52062069#52062069 # https://stackoverflow.com/questions/714100/os-detecting-makefile/52062069#52062069
ifeq '$(findstring ;,$(PATH))' ';' ifeq '$(findstring ;,$(PATH))' ';'
@ -26,13 +28,18 @@ CMDEXE := 1
SHELL := cmd.exe SHELL := cmd.exe
endif endif
# Handy check parameter function ifeq ($(CMDEXE),1)
check_defined = \ CP = copy
$(strip $(foreach 1,$1, \ RM = del
$(call __check_defined,$1,$(strip $(value 2))))) MKDIR = mkdir
__check_defined = \ PYTHON = python
$(if $(value $1),, \ else
$(error Undefined make flag: $1$(if $2, ($2)))) CP = cp
RM = rm
MKDIR = mkdir
PYTHON = python3
endif
# Build directory # Build directory
BUILD := _build/$(BOARD) BUILD := _build/$(BOARD)
@ -44,8 +51,8 @@ BIN := $(TOP)/_bin/$(BOARD)/$(notdir $(CURDIR))
# Board without family # Board without family
ifneq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/board.mk),) ifneq ($(wildcard $(TOP)/hw/bsp/$(BOARD)/board.mk),)
BOARD_PATH := hw/bsp/$(BOARD) BOARD_PATH := hw/bsp/$(BOARD)
FAMILY := FAMILY :=
endif endif
# Board within family # Board within family
@ -68,31 +75,12 @@ else
SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c)) SRC_C += $(subst $(TOP)/,,$(wildcard $(TOP)/$(FAMILY_PATH)/*.c))
endif endif
#-------------- Toolchain ------------ #-------------------------------------------------------------
# Toolchain
# Supported toolchain: gcc, iar # Can be changed via TOOLCHAIN=gcc|iar or CC=arm-none-eabi-gcc|iccarm|clang
#-------------------------------------------------------------
TOOLCHAIN ?= gcc TOOLCHAIN ?= gcc
# Can be set by board, default to ARM GCC
CROSS_COMPILE ?= arm-none-eabi-
ifeq ($(TOOLCHAIN),iar)
CC := iccarm
USE_IAR = 1
endif
ifeq ($(CMDEXE),1)
CP = copy
RM = del
MKDIR = mkdir
PYTHON = python
else
CP = cp
RM = rm
MKDIR = mkdir
PYTHON = python3
endif
#-------------- Source files and compiler flags -------------- #-------------- Source files and compiler flags --------------
# tinyusb makefile # tinyusb makefile
include $(TOP)/src/tinyusb.mk include $(TOP)/src/tinyusb.mk
@ -143,3 +131,11 @@ endif
# toolchain specific # toolchain specific
include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk include ${TOP}/examples/build_system/make/toolchain/arm_$(TOOLCHAIN).mk
# Handy check parameter function
check_defined = \
$(strip $(foreach 1,$1, \
$(call __check_defined,$1,$(strip $(value 2)))))
__check_defined = \
$(if $(value $1),, \
$(error Undefined make flag: $1$(if $2, ($2))))

View File

@ -1,5 +1,8 @@
# makefile for arm gcc toolchain # makefile for arm gcc toolchain
# Can be set by family, default to ARM GCC
CROSS_COMPILE ?= arm-none-eabi-
CC = $(CROSS_COMPILE)gcc CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++ CXX = $(CROSS_COMPILE)g++
AS = $(CC) -x assembler-with-cpp AS = $(CC) -x assembler-with-cpp

View File

@ -1,4 +1,6 @@
# makefile for arm iar toolchain # makefile for arm iar toolchain
CC = iccarm
AS = iasmarm AS = iasmarm
LD = ilinkarm LD = ilinkarm
OBJCOPY = ielftool --silent OBJCOPY = ielftool --silent

View File

@ -1,7 +1,7 @@
include ../../build_system/make/make.mk include ../../build_system/make/make.mk
FREERTOS_SRC = lib/FreeRTOS-Kernel FREERTOS_SRC = lib/FreeRTOS-Kernel
FREERTOS_PORTABLE_PATH= $(FREERTOS_SRC)/portable/$(if $(USE_IAR),IAR,GCC) FREERTOS_PORTABLE_PATH = $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
INC += \ INC += \
src \ src \

View File

@ -3,7 +3,7 @@ DEPS_SUBMODULES += lib/FreeRTOS-Kernel
include ../../build_system/make/make.mk include ../../build_system/make/make.mk
FREERTOS_SRC = lib/FreeRTOS-Kernel FREERTOS_SRC = lib/FreeRTOS-Kernel
FREERTOS_PORTABLE_PATH= $(FREERTOS_SRC)/portable/$(if $(USE_IAR),IAR,GCC) FREERTOS_PORTABLE_PATH= $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
INC += \ INC += \
src \ src \

View File

@ -1,7 +1,7 @@
include ../../build_system/make/make.mk include ../../build_system/make/make.mk
FREERTOS_SRC = lib/FreeRTOS-Kernel FREERTOS_SRC = lib/FreeRTOS-Kernel
FREERTOS_PORTABLE_PATH= $(FREERTOS_SRC)/portable/$(if $(USE_IAR),IAR,GCC) FREERTOS_PORTABLE_PATH= $(FREERTOS_SRC)/portable/$(if $(findstring iar,$(TOOLCHAIN)),IAR,GCC)
INC += \ INC += \
src \ src \

View File

@ -25,6 +25,14 @@
#include "board_api.h" #include "board_api.h"
//--------------------------------------------------------------------+
// Board API
//--------------------------------------------------------------------+
int board_getchar(void) {
char c;
return (sys_read(0, &c, 1) > 0) ? (int) c : (-1);
}
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
// newlib read()/write() retarget // newlib read()/write() retarget
//--------------------------------------------------------------------+ //--------------------------------------------------------------------+
@ -126,8 +134,3 @@ FILE *const stdin = &__stdio;
__strong_reference(stdin, stdout); __strong_reference(stdin, stdout);
__strong_reference(stdin, stderr); __strong_reference(stdin, stderr);
#endif #endif
int board_getchar(void) {
char c;
return (sys_read(0, &c, 1) > 0) ? (int) c : (-1);
}

View File

@ -142,6 +142,7 @@ static inline size_t board_usb_get_serial(uint16_t desc_str1[], size_t max_chars
uint8_t uid[16] TU_ATTR_ALIGNED(4); uint8_t uid[16] TU_ATTR_ALIGNED(4);
size_t uid_len; size_t uid_len;
// TODO work with make, but not working with esp32s3 cmake
if ( board_get_unique_id ) { if ( board_get_unique_id ) {
uid_len = board_get_unique_id(uid, sizeof(uid)); uid_len = board_get_unique_id(uid, sizeof(uid));
}else { }else {

View File

@ -8,13 +8,13 @@
"flasher_args": "-f interface/cmsis-dap.cfg -f target/rp2040.cfg -c \"adapter speed 5000\"" "flasher_args": "-f interface/cmsis-dap.cfg -f target/rp2040.cfg -c \"adapter speed 5000\""
}, },
{ {
"name": "espressif_s3_devkitc", "name": "espressif_s3_devkitm",
"uid": "7CDFA1E073CC", "uid": "84F703C084E4",
"tests": [ "tests": [
"cdc_msc_freertos", "hid_composite_freertos" "cdc_msc_freertos", "hid_composite_freertos"
], ],
"flasher": "esptool", "flasher": "esptool",
"flasher_sn": "461cb8d7decdeb119be9b506e93fd3f1", "flasher_sn": "3ea619acd1cdeb11a0a0b806e93fd3f1",
"flasher_args": "-b 1500000" "flasher_args": "-b 1500000"
}, },
{ {