Skip to content

Commit

Permalink
fix portenta build
Browse files Browse the repository at this point in the history
  • Loading branch information
hathach committed Dec 13, 2024
1 parent ad0ac67 commit f2c46c5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
21 changes: 6 additions & 15 deletions hw/bsp/ra/boards/portenta_c33/board.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,13 @@ set(MCU_VARIANT ra6m5)
set(JLINK_DEVICE R7FA6M5BH)
set(DFU_UTIL_VID_PID 2341:0368)

set(LD_FILE_GNU ${CMAKE_CURRENT_LIST_DIR}/${BOARD}.ld)

# Device port default to PORT1 Highspeed
if (NOT DEFINED PORT)
set(PORT 1)
# device default to PORT 1 High Speed
if (NOT DEFINED RHPORT_DEVICE)
set(RHPORT_DEVICE 1)
endif()
if (NOT DEFINED RHPORT_HOST)
set(RHPORT_HOST 0)
endif()

# Host port will be the other port
set(HOST_PORT $<NOT:${PORT}>)

function(update_board TARGET)
target_compile_definitions(${TARGET} PUBLIC
BOARD_TUD_RHPORT=${PORT}
BOARD_TUH_RHPORT=${HOST_PORT}
# port 0 is fullspeed, port 1 is highspeed
BOARD_TUD_MAX_SPEED=$<IF:${PORT},OPT_MODE_HIGH_SPEED,OPT_MODE_FULL_SPEED>
BOARD_TUH_MAX_SPEED=$<IF:${HOST_PORT},OPT_MODE_HIGH_SPEED,OPT_MODE_FULL_SPEED>
)
endfunction()
3 changes: 2 additions & 1 deletion hw/bsp/ra/boards/portenta_c33/board.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ CPU_CORE = cortex-m33
MCU_VARIANT = ra6m5

# Port 1 is highspeed
PORT ?= 1
RHPORT_DEVICE ?= 1
RHPORT_HOST ?= 0

JLINK_DEVICE = R7FA6M5BH
DFU_UTIL_OPTION = -d 2341:0368 -a 0
Expand Down

0 comments on commit f2c46c5

Please sign in to comment.