Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update toolchains to newer compilers #25327

Draft
wants to merge 47 commits into
base: bugfix-2.1.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
9500762
- updated toolchains to newer compilers, aiming for a good Marlin FW …
quiret Feb 1, 2023
08704ea
- fix ESP32 ADC for new toolchain version
quiret Feb 1, 2023
e87f26d
- fix a duplicate inline bug (not allowed anymore under the new stand…
quiret Feb 1, 2023
62ebd6e
- fixed FSMC display support: force SRAM HAL module to compile for th…
quiret Feb 1, 2023
47f8064
- (temporarily) updated the ESP3DLib dependency for MKS TinyBee / ESP…
quiret Feb 2, 2023
99f3ffb
- remove obsolete and problematic ESP32 build fixes, allowing Linux b…
quiret Feb 2, 2023
05f8c2b
- another bugfix related to a programming error in framework-arduinoe…
quiret Feb 2, 2023
af10a81
- config fixes + cleanup
quiret Feb 2, 2023
95b1a5a
- fix for STM32F103CB_malyan build target
quiret Feb 2, 2023
3592c1f
- fixed building for STM32 flash-drive mix-in enabled board configura…
quiret Feb 2, 2023
d2f6061
- compatibility update: fixed PINS_DEBUGGING build configurations by …
quiret Feb 2, 2023
12ecb3e
- follow-up fix: old STM32 toolchains need the NUM_ANALOG_FIRST but i…
quiret Feb 2, 2023
bbdfd6d
- bugfix: template specification for constructor is invalid C++ synta…
quiret Feb 2, 2023
dd0d58c
misc. cleanup
thinkyhead Feb 3, 2023
6f8138c
quickie test
thinkyhead Feb 3, 2023
3578dae
- improved the ESP32 build config further, specializing the ESP32 Ard…
quiret Feb 15, 2023
0224670
Merge branch 'bugfix-2.1.x-tcupdate' of github.com:quiret/Marlin into…
quiret Feb 15, 2023
29e7cd1
Update esp32.ini
thinkyhead Feb 15, 2023
9c35bba
Update stm32f4.ini
thinkyhead Feb 15, 2023
6778a50
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into pr/25327
thinkyhead Apr 28, 2023
d888ff6
followup
thinkyhead Apr 28, 2023
ecd8e53
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead May 10, 2023
799a847
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead May 12, 2023
56f209c
merge followup
thinkyhead May 12, 2023
bbf6df9
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead Jun 5, 2023
ba42b86
ESP32 update (as of 2.0.9)
thinkyhead Jun 5, 2023
5f1cb95
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead Aug 3, 2023
94b55ae
tweak import
thinkyhead Aug 3, 2023
03d8f59
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead Aug 3, 2023
924e148
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead Oct 25, 2023
e5bfdaf
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead Dec 13, 2023
8484b84
Fix mks_robin_nano_v1v2 build
thinkyhead Dec 13, 2023
319af2f
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead Dec 24, 2023
60f0360
merge followup
thinkyhead Dec 24, 2023
143f4c8
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead Jan 22, 2024
7844b0a
Merge branch 'bugfix-2.1.x' into pr/25327
thinkyhead May 6, 2024
c28ed43
probably fine
thinkyhead May 7, 2024
449d585
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into pr/25327
thinkyhead Sep 21, 2024
c3b3f1e
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into pr/25327
thinkyhead Sep 28, 2024
447cf64
Merge remote-tracking branch 'upstream/bugfix-2.1.x' into pr/25327
thinkyhead Oct 29, 2024
f524c18
merge followup
thinkyhead Oct 29, 2024
b43c22e
Skip MKS Tinybee, here
thinkyhead Oct 29, 2024
aa86cb8
Try ststm32@~17.6.0
thinkyhead Oct 29, 2024
fd846dd
catch 'em all
thinkyhead Oct 29, 2024
8a9249f
spi_mode_e => SPIMode
thinkyhead Oct 29, 2024
17a1c0a
catch more issues
thinkyhead Oct 29, 2024
52729d3
more variant changes needed
thinkyhead Oct 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions Marlin/src/HAL/ESP32/HAL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,16 +209,17 @@ int MarlinHAL::freeMemory() { return ESP.getFreeHeap(); }
// ADC
// ------------------------

#define ADC1_CHANNEL(pin) ADC1_GPIO ## pin ## _CHANNEL

// https://docs.espressif.com/projects/esp-idf/en/release-v4.4/esp32/api-reference/peripherals/adc.html
adc1_channel_t get_channel(int pin) {
switch (pin) {
case 39: return ADC1_CHANNEL(39);
case 36: return ADC1_CHANNEL(36);
case 35: return ADC1_CHANNEL(35);
case 34: return ADC1_CHANNEL(34);
case 33: return ADC1_CHANNEL(33);
case 32: return ADC1_CHANNEL(32);
case 39: return ADC1_CHANNEL_3;
case 36: return ADC1_CHANNEL_0;
case 35: return ADC1_CHANNEL_7;
case 34: return ADC1_CHANNEL_6;
case 33: return ADC1_CHANNEL_5;
case 32: return ADC1_CHANNEL_4;
case 37: return ADC1_CHANNEL_1;
case 38: return ADC1_CHANNEL_2;
}
return ADC1_CHANNEL_MAX;
}
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/ESP32/timers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ void HAL_timer_start(const uint8_t timer_num, const uint32_t frequency) {
config.counter_en = TIMER_PAUSE;
config.alarm_en = TIMER_ALARM_EN;
config.intr_type = TIMER_INTR_LEVEL;
config.auto_reload = true;
config.auto_reload = TIMER_AUTORELOAD_EN;

// Select and initialize the timer
timer_init(timer.group, timer.idx, &config);
Expand Down
54 changes: 43 additions & 11 deletions Marlin/src/HAL/STM32/pinsDebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,19 @@
*/
#pragma once

#ifndef PINS_DEBUGGING
#error "PINS_DEBUGGING not defined but tried to include debug header!"
#endif

#include <Arduino.h>

#ifndef NUM_DIGITAL_PINS
// Only in ST's Arduino core (STM32duino, STM32Core)
#error "Expected NUM_DIGITAL_PINS not found"
#endif
#ifndef NUM_ANALOG_INPUTS
#error "Expected NUM_ANALOG_INPUTS not found"
#endif

/**
* Life gets complicated if you want an easy to use 'M43 I' output (in port/pin order)
Expand Down Expand Up @@ -107,13 +114,32 @@ const XrefInfo pin_xref[] PROGMEM = {
/**
* Translation of routines & variables used by pinsDebug.h
*/
#ifndef __STRINGIFY
#define __STRINGIFY(x) #x
#endif
#define TOSTRING(x) __STRINGIFY(x)
#define _STM32_PLATDEFPATH(x) TOSTRING(platdefs/x.h)
#if defined(_STM32_PLATDEFS)
#if __has_include(_STM32_PLATDEFPATH(_STM32_PLATDEFS))
#include _STM32_PLATDEFPATH(_STM32_PLATDEFS)
#endif
#endif

#if NUM_ANALOG_FIRST >= NUM_DIGITAL_PINS
#define HAS_HIGH_ANALOG_PINS 1
#ifndef NUM_ANALOG_FIRST
#warning "Preprocessor macro NUM_ANALOG_FIRST is not defined but PINS_DEBUGGING is enabled; ignoring analog pin debug functions."
#endif

#ifdef NUM_ANALOG_FIRST
#if NUM_ANALOG_FIRST >= NUM_DIGITAL_PINS
#define HAS_HIGH_ANALOG_PINS 1
#endif
#define NUM_ANALOG_LAST ((NUM_ANALOG_FIRST) + (NUM_ANALOG_INPUTS) - 1)
#define NUMBER_PINS_TOTAL ((NUM_DIGITAL_PINS) + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS))
#define VALID_PIN(P) (WITHIN(P, 0, (NUM_DIGITAL_PINS) - 1) || TERN0(HAS_HIGH_ANALOG_PINS, WITHIN(P, NUM_ANALOG_FIRST, NUM_ANALOG_LAST)))
#else
#define NUMBER_PINS_TOTAL (NUM_DIGITAL_PINS)
#define VALID_PIN(P) (WITHIN(P, 0, (NUM_DIGITAL_PINS) - 1))
#endif
#define NUM_ANALOG_LAST ((NUM_ANALOG_FIRST) + (NUM_ANALOG_INPUTS) - 1)
#define NUMBER_PINS_TOTAL ((NUM_DIGITAL_PINS) + TERN0(HAS_HIGH_ANALOG_PINS, NUM_ANALOG_INPUTS))
#define VALID_PIN(P) (WITHIN(P, 0, (NUM_DIGITAL_PINS) - 1) || TERN0(HAS_HIGH_ANALOG_PINS, WITHIN(P, NUM_ANALOG_FIRST, NUM_ANALOG_LAST)))
#define digitalRead_mod(Ard_num) extDigitalRead(Ard_num) // must use Arduino pin numbers when doing reads
#define PRINT_PIN(Q)
#define PRINT_PIN_ANALOG(p) do{ sprintf_P(buffer, PSTR(" (A%2d) "), DIGITAL_PIN_TO_ANALOG_PIN(pin)); SERIAL_ECHO(buffer); }while(0)
Expand Down Expand Up @@ -169,8 +195,11 @@ bool GET_PINMODE(const pin_t Ard_num) {
}

int8_t digital_pin_to_analog_pin(const pin_t Ard_num) {
if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
return Ard_num - NUM_ANALOG_FIRST;

#ifdef NUM_ANALOG_FIRST
if (WITHIN(Ard_num, NUM_ANALOG_FIRST, NUM_ANALOG_LAST))
return Ard_num - NUM_ANALOG_FIRST;
#endif

const uint32_t ind = digitalPinToAnalogInput(Ard_num);
return (ind < NUM_ANALOG_INPUTS) ? ind : -1;
Expand Down Expand Up @@ -208,10 +237,13 @@ void port_print(const pin_t Ard_num) {

// Print number to be used with M42
int calc_p = Ard_num;
if (Ard_num > NUM_DIGITAL_PINS) {
calc_p -= NUM_ANALOG_FIRST;
if (calc_p > 7) calc_p += 8;
}
#ifdef NUM_ANALOG_FIRST
if (Ard_num > NUM_DIGITAL_PINS) {
calc_p -= NUM_ANALOG_FIRST;
if (calc_p > 7) calc_p += 8;
}
#endif

SERIAL_ECHOPGM(" M42 P", calc_p);
SERIAL_CHAR(' ');
if (calc_p < 100) {
Expand Down
27 changes: 27 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_ARTILLERY_RUBY.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
thinkyhead marked this conversation as resolved.
Show resolved Hide resolved
#define NUM_ANALOG_FIRST 50
#endif
27 changes: 27 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_BTT002.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
#define NUM_ANALOG_FIRST 35
#endif
27 changes: 27 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_E3_RRF.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
#define NUM_ANALOG_FIRST 35
#endif
27 changes: 27 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_GTR_V1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
#define NUM_ANALOG_FIRST 35
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
#define NUM_ANALOG_FIRST NUM_DIGITAL_PINS
#endif
27 changes: 27 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_OCTOPUS_V1.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
#define NUM_ANALOG_FIRST NUM_DIGITAL_PINS
#endif
27 changes: 27 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_BIGTREE_SKR_PRO_11.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
#define NUM_ANALOG_FIRST 35
#endif
27 changes: 27 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_BTT_SKR_SE_BX.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
#define NUM_ANALOG_FIRST 108
#endif
22 changes: 22 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_F103Rx.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once
27 changes: 27 additions & 0 deletions Marlin/src/HAL/STM32/platdefs/MARLIN_F401RC.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Marlin 3D Printer Firmware
* Copyright (c) 2023 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
*
* Based on Sprinter and grbl.
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
*/
#pragma once

#ifndef NUM_ANALOG_FIRST
#error "NUM_ANALOG_FIRST is not defined??"
#define NUM_ANALOG_FIRST 192
#endif
Loading