Skip to content

Commit 8e25220

Browse files
authored
Merge pull request #3145 from hathach/refactor-maxim-bsp
Refactor maxim bsp
2 parents b203d9e + 41e615d commit 8e25220

File tree

73 files changed

+567
-2381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+567
-2381
lines changed

.github/workflows/ci_set_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"lpc11 lpc13 lpc15": ["arm-gcc", "arm-clang"],
2525
"lpc17 lpc18 lpc40 lpc43": ["arm-gcc", "arm-clang"],
2626
"lpc51 lpc54 lpc55": ["arm-gcc", "arm-clang"],
27-
"max32650 max32666 max32690 max78002": ["arm-gcc"],
27+
"maxim": ["arm-gcc"],
2828
"mcx": ["arm-gcc"],
2929
"mm32": ["arm-gcc"],
3030
"msp430": ["msp430-gcc"],

examples/build_system/make/make.mk

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
# Common make definition for all examples
33
# ---------------------------------------
44

5+
# upper helper function
6+
to_upper = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$(subst -,_,$(1))))))))))))))))))))))))))))
7+
58
#-------------------------------------------------------------
69
# Toolchain
710
# Can be changed via TOOLCHAIN=gcc|iar or CC=arm-none-eabi-gcc|iccarm|clang
@@ -109,7 +112,7 @@ INC += \
109112
$(TOP)/$(FAMILY_PATH) \
110113
$(TOP)/src \
111114

112-
BOARD_UPPER = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$(subst -,_,$(BOARD))))))))))))))))))))))))))))
115+
BOARD_UPPER = $(call to_upper,$(BOARD))
113116
CFLAGS += -DBOARD_$(BOARD_UPPER)
114117

115118
ifdef CFLAGS_CLI

hw/bsp/espressif/family.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ endif ()
3232

3333
# Add example src and bsp directories
3434
set(EXTRA_COMPONENT_DIRS "src" "${CMAKE_CURRENT_LIST_DIR}/boards" "${CMAKE_CURRENT_LIST_DIR}/components")
35-
36-
# set SDKCONFIG for each IDF Target
3735
set(SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig)
3836

3937
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

hw/bsp/family_support.cmake

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ if (NOT DEFINED TOOLCHAIN)
3838
set(TOOLCHAIN gcc)
3939
endif ()
4040

41+
# Optimization
42+
if (NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
43+
set(CMAKE_BUILD_TYPE MinSizeRel CACHE STRING "Build type" FORCE)
44+
endif ()
45+
4146
#-------------------------------------------------------------
4247
# FAMILY and BOARD
4348
#-------------------------------------------------------------
@@ -482,7 +487,7 @@ function(family_flash_openocd TARGET)
482487
# note skip verify since it has issue with rp2040
483488
add_custom_target(${TARGET}-openocd
484489
DEPENDS ${TARGET}
485-
COMMAND ${OPENOCD} -c "tcl_port disabled" -c "gdb_port disabled" ${OPTION_LIST} -c init -c halt -c "program $<TARGET_FILE:${TARGET}>" -c reset ${OPTION_LIST2} -c exit
490+
COMMAND ${OPENOCD} -c "tcl_port disabled; gdb_port disabled" ${OPTION_LIST} -c "init; halt; program $<TARGET_FILE:${TARGET}>" -c reset ${OPTION_LIST2} -c exit
486491
VERBATIM
487492
)
488493
endfunction()
@@ -502,10 +507,16 @@ endfunction()
502507
# Add flash openocd adi (Analog Devices) target
503508
# included with msdk or compiled from release branch of https://github.com/analogdevicesinc/openocd
504509
function(family_flash_openocd_adi TARGET)
505-
if (DEFINED $ENV{MAXIM_PATH})
506-
# use openocd from msdk
507-
set(OPENOCD ENV{MAXIM_PATH}/Tools/OpenOCD/openocd)
508-
set(OPENOCD_OPTION2 "-s ENV{MAXIM_PATH}/Tools/OpenOCD/scripts")
510+
if (DEFINED MAXIM_PATH)
511+
# use openocd from msdk with MAXIM_PATH cmake variable first if the user specified it
512+
set(OPENOCD ${MAXIM_PATH}/Tools/OpenOCD/openocd)
513+
set(OPENOCD_OPTION2 "-s ${MAXIM_PATH}/Tools/OpenOCD/scripts")
514+
elseif (DEFINED ENV{MAXIM_PATH})
515+
# use openocd from msdk with MAXIM_PATH environment variable. Normalize
516+
# since msdk can be Windows (MinGW) or Linux
517+
file(TO_CMAKE_PATH "$ENV{MAXIM_PATH}" MAXIM_PATH_NORM)
518+
set(OPENOCD ${MAXIM_PATH_NORM}/Tools/OpenOCD/openocd)
519+
set(OPENOCD_OPTION2 "-s ${MAXIM_PATH_NORM}/Tools/OpenOCD/scripts")
509520
else()
510521
# compiled from source
511522
if (NOT DEFINED OPENOCD_ADI_PATH)

hw/bsp/max32650/README.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

hw/bsp/max32650/boards/max32650evkit/board.cmake

Lines changed: 0 additions & 10 deletions
This file was deleted.

hw/bsp/max32650/boards/max32650evkit/board.mk

Lines changed: 0 additions & 2 deletions
This file was deleted.

hw/bsp/max32650/boards/max32650fthr/board.cmake

Lines changed: 0 additions & 10 deletions
This file was deleted.

hw/bsp/max32650/boards/max32650fthr/board.mk

Lines changed: 0 additions & 2 deletions
This file was deleted.

hw/bsp/max32650/boards/max32650fthr/max32650.ld

Lines changed: 0 additions & 119 deletions
This file was deleted.

0 commit comments

Comments
 (0)