Skip to content

Commit 550a303

Browse files
committed
🔨 Better build, envs, tests
1 parent a53ad3b commit 550a303

File tree

97 files changed

+15884
-14337
lines changed

Some content is hidden

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

97 files changed

+15884
-14337
lines changed

Makefile

+13-17
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ CONTAINER_IMAGE := marlin-dev
55

66
help:
77
@echo "Tasks for local development:"
8-
@echo "* format-pins: Reformat all pins files
9-
@echo "* tests-single-ci: Run a single test from inside the CI"
10-
@echo "* tests-single-local: Run a single test locally"
11-
@echo "* tests-single-local-docker: Run a single test locally, using docker"
12-
@echo "* tests-all-local: Run all tests locally"
13-
@echo "* tests-all-local-docker: Run all tests locally, using docker"
14-
@echo "* setup-local-docker: Build the local docker image"
8+
@echo "make marlin : Build marlin for the configured board"
9+
@echo "make format-pins : Reformat all pins files"
10+
@echo "make tests-single-ci : Run a single test from inside the CI"
11+
@echo "make tests-single-local : Run a single test locally"
12+
@echo "make tests-single-local-docker : Run a single test locally, using docker"
13+
@echo "make tests-all-local : Run all tests locally"
14+
@echo "make tests-all-local-docker : Run all tests locally, using docker"
15+
@echo "make setup-local-docker : Build the local docker image"
1516
@echo ""
1617
@echo "Options for testing:"
1718
@echo " TEST_TARGET Set when running tests-single-*, to select the"
@@ -24,46 +25,41 @@ help:
2425
@echo " VERBOSE_PLATFORMIO If you want the full PIO output, set any value"
2526
@echo " GIT_RESET_HARD Used by CI: reset all local changes. WARNING:"
2627
@echo " THIS WILL UNDO ANY CHANGES YOU'VE MADE!"
27-
.PHONY: help
28+
29+
marlin:
30+
./buildroot/bin/mftest -a
31+
.PHONY: marlin
2832

2933
tests-single-ci:
3034
export GIT_RESET_HARD=true
3135
$(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) PLATFORMIO_BUILD_FLAGS=-DGITHUB_ACTION
32-
.PHONY: tests-single-ci
3336

3437
tests-single-local:
3538
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local" ; return 1; fi
3639
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
3740
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
3841
&& run_tests . $(TEST_TARGET) "$(ONLY_TEST)"
39-
.PHONY: tests-single-local
4042

4143
tests-single-local-docker:
4244
@if ! test -n "$(TEST_TARGET)" ; then echo "***ERROR*** Set TEST_TARGET=<your-module> or use make tests-all-local-docker" ; return 1; fi
4345
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
4446
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-single-local TEST_TARGET=$(TEST_TARGET) VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD) ONLY_TEST="$(ONLY_TEST)"
45-
.PHONY: tests-single-local-docker
4647

4748
tests-all-local:
4849
export PATH="./buildroot/bin/:./buildroot/tests/:${PATH}" \
4950
&& export VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) \
5051
&& for TEST_TARGET in $$($(SCRIPTS_DIR)/get_test_targets.py) ; do echo "Running tests for $$TEST_TARGET" ; run_tests . $$TEST_TARGET ; done
51-
.PHONY: tests-all-local
5252

5353
tests-all-local-docker:
5454
@if ! $(CONTAINER_RT_BIN) images -q $(CONTAINER_IMAGE) > /dev/null ; then $(MAKE) setup-local-docker ; fi
5555
$(CONTAINER_RT_BIN) run $(CONTAINER_RT_OPTS) $(CONTAINER_IMAGE) $(MAKE) tests-all-local VERBOSE_PLATFORMIO=$(VERBOSE_PLATFORMIO) GIT_RESET_HARD=$(GIT_RESET_HARD)
56-
.PHONY: tests-all-local-docker
5756

5857
setup-local-docker:
5958
$(CONTAINER_RT_BIN) build -t $(CONTAINER_IMAGE) -f docker/Dockerfile .
60-
.PHONY: setup-local-docker
6159

6260
PINS := $(shell find Marlin/src/pins -mindepth 2 -name '*.h')
6361

64-
.PHONY: $(PINS)
65-
6662
$(PINS): %:
67-
@echo "Formatting $@" && node buildroot/share/scripts/pinsformat.js $@
63+
@echo "Formatting $@" && node $(SCRIPTS_DIR)/pinsformat.js $@
6864

6965
format-pins: $(PINS)

buildroot/bin/build_all_examples

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
# build_all_examples [...] branch [resume-from]
1515
#
1616

17-
. mfutil
17+
HERE=`dirname $0`
18+
19+
. "$HERE/mfutil"
1820

1921
GITREPO=https://github.com/MarlinFirmware/Configurations.git
2022
STAT_FILE=./.pio/.buildall
@@ -123,7 +125,7 @@ CONF_TREE=$( ls -d "$TMP"/config/examples/*/ "$TMP"/config/examples/*/*/ "$TMP"/
123125
for CONF in $CONF_TREE ; do
124126

125127
# Get a config's directory name
126-
DIR=$( echo $CONF | sed "s|$TMP/config/examples/||" )
128+
DIR=$( echo $CONF | "$SED" "s|$TMP/config/examples/||" )
127129

128130
# If looking for a config, skip others
129131
[[ $FIRST_CONF ]] && [[ $FIRST_CONF != $DIR && "$FIRST_CONF/" != $DIR ]] && continue

buildroot/bin/build_example

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
# Usage: build_example internal config-home config-folder
66
#
77

8-
. mfutil
8+
HERE=`dirname $0`
9+
10+
. "$HERE/mfutil"
911

1012
# Require 'internal' as the first argument
1113
[[ "$1" == "internal" ]] || { echo "Don't call this script directly, use build_all_examples instead." ; exit 1 ; }
@@ -36,6 +38,6 @@ unset IFS; set +f
3638
echo -e "\n#define NO_CONTROLLER_CUSTOM_WIRING_WARNING" >> Marlin/Configuration.h
3739

3840
echo "Building the firmware now..."
39-
$HERE/mftest -s -a -n1 || { echo "Failed"; exit 1; }
41+
"$HERE/mftest" -s -a -n1 || { echo "Failed"; exit 1; }
4042

4143
echo "Success"

buildroot/bin/mftest

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
[[ -d Marlin/src ]] || { echo "Please 'cd' to the Marlin repo root." ; exit 1 ; }
1010

11+
which pio || { echo "Make sure 'pio' is in your execution PATH." ; exit 1 ; }
12+
1113
perror() { echo -e "$0: \033[0;31m$1 -- $2\033[0m" ; }
1214
errout() { echo -e "\033[0;31m$1\033[0m" ; }
1315
bugout() { ((DEBUG)) && echo -e "\033[0;32m$1\033[0m" ; }

buildroot/bin/mfutil

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
which curl 1>/dev/null 2>&1 || { echo "curl not found! Please install it."; exit ; }
88
which git 1>/dev/null 2>&1 || { echo "git not found! Please install it."; exit ; }
99

10-
SED=$(command -v gsed 2>/dev/null || command -v sed 2>/dev/null)
10+
SED=$(which gsed sed | head -n1)
1111
[[ -z "$SED" ]] && { echo "No sed found, please install sed" ; exit 1 ; }
1212

1313
OPEN=$( which gnome-open xdg-open open | head -n1 )
1414

1515
SELF=`basename "$0"`
16-
HERE=`dirname "$0"`
1716

1817
# Check if called in the right location
1918
[[ -e "Marlin/src" ]] || { echo -e "This script must be called from a Marlin working copy with:\n ./buildroot/bin/$SELF $1" ; exit ; }

buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RC.json buildroot/share/PlatformIO/boards/marlin_CREALITY_STM32F401RE.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
]
1616
],
1717
"ldscript": "ldscript.ld",
18-
"mcu": "stm32f401rct6",
19-
"variant": "MARLIN_CREALITY_STM32F401RC"
18+
"mcu": "stm32f401ret6",
19+
"variant": "MARLIN_CREALITY_STM32F401RE"
2020
},
2121
"debug": {
22-
"jlink_device": "STM32F401RC",
22+
"jlink_device": "STM32F401RE",
2323
"openocd_target": "stm32f4x",
2424
"svd_path": "STM32F40x.svd",
2525
"tools": {
@@ -45,11 +45,11 @@
4545
"arduino",
4646
"stm32cube"
4747
],
48-
"name": "STM32F401RC (64k RAM. 256k Flash)",
48+
"name": "STM32F401RE (64k RAM. 512k Flash)",
4949
"upload": {
5050
"disable_flushing": false,
5151
"maximum_ram_size": 65536,
52-
"maximum_size": 262144,
52+
"maximum_size": 514288,
5353
"protocol": "stlink",
5454
"protocols": [
5555
"stlink",
@@ -60,6 +60,6 @@
6060
"use_1200bps_touch": false,
6161
"wait_for_upload_port": false
6262
},
63-
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f401rc.html",
63+
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f401re.html",
6464
"vendor": "Generic"
6565
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"build": {
3+
"cpu": "cortex-m4",
4+
"extra_flags": "-DSTM32F446xx",
5+
"f_cpu": "180000000L",
6+
"mcu": "stm32f446ret6",
7+
"variant": "MARLIN_F446VE"
8+
},
9+
"connectivity": [
10+
"can"
11+
],
12+
"debug": {
13+
"jlink_device": "STM32F446RE",
14+
"openocd_target": "stm32f4x",
15+
"svd_path": "STM32F446x.svd"
16+
},
17+
"frameworks": [
18+
"arduino",
19+
"stm32cube"
20+
],
21+
"name": "3D Printer control board",
22+
"upload": {
23+
"maximum_ram_size": 131072,
24+
"maximum_size": 524288,
25+
"protocol": "stlink",
26+
"protocols": [
27+
"jlink",
28+
"stlink",
29+
"blackmagic",
30+
"serial"
31+
]
32+
},
33+
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32f446.html",
34+
"vendor": "FYSETC"
35+
}

buildroot/share/PlatformIO/boards/marlin_STM32H723Vx.json buildroot/share/PlatformIO/boards/marlin_STM32H723VG.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44
"cpu": "cortex-m7",
55
"extra_flags": "-DSTM32H7xx -DSTM32H723xx",
66
"f_cpu": "550000000L",
7-
"mcu": "stm32h723vet6",
7+
"mcu": "stm32h723vgt6",
88
"product_line": "STM32H723xx",
9-
"variant": "MARLIN_H723Vx"
9+
"variant": "MARLIN_H723VG"
1010
},
1111
"connectivity": [
1212
"can",
1313
"ethernet"
1414
],
1515
"debug": {
16-
"jlink_device": "STM32H723VE",
16+
"jlink_device": "STM32H723VG",
1717
"openocd_target": "stm32h7x",
1818
"svd_path": "STM32H7x3.svd",
1919
"tools": {
@@ -39,11 +39,11 @@
3939
"arduino",
4040
"stm32cube"
4141
],
42-
"name": "STM32H723VE (564k RAM. 512k Flash)",
42+
"name": "STM32H723VG (564k RAM. 1024k Flash)",
4343
"upload": {
4444
"disable_flushing": false,
4545
"maximum_ram_size": 577536,
46-
"maximum_size": 524288,
46+
"maximum_size": 1048576,
4747
"protocol": "stlink",
4848
"protocols": [
4949
"stlink",
@@ -56,6 +56,6 @@
5656
"use_1200bps_touch": false,
5757
"wait_for_upload_port": false
5858
},
59-
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32h723ze.html",
59+
"url": "https://www.st.com/en/microcontrollers-microprocessors/stm32h723vg.html",
6060
"vendor": "ST"
6161
}

buildroot/share/PlatformIO/boards/marlin_STM32H723Zx.json buildroot/share/PlatformIO/boards/marlin_STM32H723ZE.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"f_cpu": "550000000L",
77
"mcu": "stm32h723zet6",
88
"product_line": "STM32H723xx",
9-
"variant": "MARLIN_H723Zx"
9+
"variant": "MARLIN_H723ZE"
1010
},
1111
"connectivity": [
1212
"can",

buildroot/share/PlatformIO/boards/marlin_STM32H743Vx.json buildroot/share/PlatformIO/boards/marlin_STM32H743VI.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"f_cpu": "480000000L",
77
"mcu": "stm32h743vit6",
88
"product_line": "STM32H743xx",
9-
"variant": "MARLIN_H743Vx"
9+
"variant": "MARLIN_H743VI"
1010
},
1111
"connectivity": [
1212
"can",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
MEMORY
2+
{
3+
ram (rwx) : ORIGIN = 0x20000000, LENGTH = 48K - 40
4+
rom (rx) : ORIGIN = 0x08007000, LENGTH = 256K - 28K
5+
}
6+
7+
/* Provide memory region aliases for common.inc */
8+
REGION_ALIAS("REGION_TEXT", rom);
9+
REGION_ALIAS("REGION_DATA", ram);
10+
REGION_ALIAS("REGION_BSS", ram);
11+
REGION_ALIAS("REGION_RODATA", rom);
12+
13+
/* Let common.inc handle the real work. */
14+
INCLUDE common.inc

buildroot/share/PlatformIO/scripts/common-dependencies.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
#define HAS_MENU_BACKLASH
5555
#endif
5656
#if ENABLED(LCD_BED_TRAMMING)
57-
#define HAS_MENU_BED_CORNERS
57+
#define HAS_MENU_BED_TRAMMING
5858
#endif
5959
#if ENABLED(CANCEL_OBJECTS)
6060
#define HAS_MENU_CANCELOBJECT
@@ -99,7 +99,7 @@
9999
#define HAS_MENU_TOUCH_SCREEN
100100
#endif
101101
#if ENABLED(ASSISTED_TRAMMING_WIZARD)
102-
#define HAS_MENU_TRAMMING
102+
#define HAS_MENU_TRAMMING_WIZARD
103103
#endif
104104
#if ENABLED(AUTO_BED_LEVELING_UBL)
105105
#define HAS_MENU_UBL

0 commit comments

Comments
 (0)