MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.03k stars 19.13k forks source link

[FR] Porting Marlin to the new STM32MP1 MPU series with integrated MCU? #14413

Open Gamester17 opened 5 years ago

Gamester17 commented 5 years ago

Can I suggest that you port Marlin firmware to the new STM32MP1 MPUs which has an integrated MCU?

https://blog.st.com/stm32mp1-mpu-stm32mp157a-ev1-stm32mp157c-dk2/

https://blog.st.com/introduction-to-the-stm32mp1-microprocessor-series/

https://www.stmicroelectronics.com.cn/content/dam/AME/2019/developers-conference-2019/presentations/STDevCon19_1.5_STM32MP1.pdf

I am only a technology enthusiast myself and I do not actually know if anyone else is already working on a 3D-printer controller board based on the new STM32MP1 MPU series or not, however reading about it I can not help think that it would fit perfect for 3D-printer controller boards as it combines a single very fast 32-bit Cortex-M4 MCU core @ 209MHz alongside one or two 32-bit Cortex-A7 MPU cores @ 650Mhz.

I read that STMicroelectronics claims that the MCU core in STM32MP1 architecture is backwards compatible so it enables developers to use the same software made for their STM32F7 MCU series (STM32 F7 microcontroller like example STM32F0 and STM32F1 that are already common in many newer 3D-printer controllers boards today), and theoretically, with the STM32MP1 MPU series which now have an integrated MCU core you could for example run both Marlin firmware as well a full Linux distribution like OctoPi with OctoPrint on the same board in a single chip package, keeping cost down and making it a uniformed platform running in only one single chip package (a.k.a. chiplet).

Regarding running Marlin on different SRM32 see the somewhat related https://github.com/MarlinFirmware/Marlin/pull/14309

It should be noted though that even the fastest Dual Cortex-A model of STM32MP1 only run at 650MHz per MPU core and only supports up to 1GB of external RAM so that part is on paper maybe only twice as powerful as a Raspberry Pi Zero W, however when considering STM32MP1 integrates on an ARMv7 based Cortex-A7 instead of the older ARMv6 it should still be enough to enable users to run a full Linux distribution similar to OctoPi with OctoPrint smoothly on, and again the Marlin firmware would run on the integrated MCU core alone.

Support for STM32MP1 M4 MPU was added to stm32duino Arduino Core STM32 HAL via https://github.com/stm32duino/Arduino_Core_STM32/pull/717

_" The M4 coprocessor of STM32MP1 has two operating modes: Engineering mode and Production mode (or normal mode). Engineering mode is for debugging the M4 while disabling the Linux A7 core. In this mode you can use ST-Link to upload and debug the M4, but the M4 doesn't have a flash memory: the firmware will disappear in the next boot. To avoid the confusion to the users I focus on Production mode only and made a necessary tools for Production mode. The new run_arduino_gen.sh tool is explained in Arduino-Tools#47. In the Production mode, the core clock configuration is done by the Linux/U-Boot host so we need simply ignore related functions like SystemClock_Config(). The new IS_ENGINEERING_BOOT_MODE() from HAL is used to detect the Production mode. https://github.com/kbumsik/Arduino_Core_STM32/blob/aebcddff59375b4ac53134babc61dd655b028414/variants/STM32MP157_DK/variant.cpp#L147-L149 "_

For technical specification on summery on the new STM32MP1 MCU series checkout:

https://www.cnx-software.com/2019/02/21/stmicro-stm32mp1-cortex-a7-m4-mpu/

There are already a few developer boards and evaluation kit available for developers:

STM32MP157A-DK1 and STM32MP157C-DK2 Discovery kits with a devboard is only $69 without LCD or $99 with an LCD

STM32MP157A-EV1 Evaluation kit with breakout board and STM32MP115X-EVAL evaluation board made for PCB engineers:

https://www.st.com/en/evaluation-tools/stm32mp157a-ev1.html

STM32MP157C-EV1 Evaluation kit with breakout board and STM32MP115X-EVAL evaluation board made for PCB engineers:

https://www.st.com/en/evaluation-tools/stm32mp157c-ev1.html

PanGu board from I2Som

Gamester17 commented 5 years ago

Theoretically, with an STM32MP1 based board you could, for example, run both Marlin Firmware and OctoPrint on the same board.

Marlin Firmware would run on the 209MHz Cortex-M4 MCU core and OctoPrint would run on 650Mhz Dual Cortex-A7 MPU cores.

github-actions[bot] commented 4 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label / comment or this will be closed in 5 days.

Gamester17 commented 4 years ago

FYI, STMicro Updates STM32MP1 family with faster 800MHz Cortex-A7 processors, though the Cortex-M4 core still runs at 209 MHz:

https://www.cnx-software.com/2020/02/27/stmicro-updates-stm32mp1-family-with-800-mhz-cortex-a7-processors/

"STMicro has now announced 24 more parts whose main and only difference compared to the STM32MP1 processors launched last year us the bump of the Cortex-A7 core CPU frequency to 800 MHz from 650 MHz. The names are the same but “A” 650 MHz parts become “D” 800 MHz parts, and “C” processors with security become “F” processors @ 800 MHz. The new STM3MP1 800 MHz processors are software and pin-to-pin compatible with the 650MHz equivalent."

https://newsroom.st.com/media-center/press-item.html/p4236.html

The company also mentioned software support in the press release with the OpenSTLinux Distribution to follow long term Linux kernel releases for the years ahead. STMicro is putting resources into development, as explained by Michael Opdenacker, CEO of Bootlin:

"ST’s active participation to the Linux kernel community always impressed us. The simultaneous Linux & STM32MP1 availability made this launch attractive"

...

"In our opinion, ST understood what the customer’s interests are: mainline versions support of open-source projects, freedom to upgrade to newer versions, zero-cost availability of security updates, community support and security of their long-term investments. By sharing the same open-source DNA, Bootlin is proud to be an ST Authorized Partner and to offer to worldwide customers its engineering and training services on this platform."

Hedda commented 3 years ago

STM32MP157A-DK1 is still probably best board to try but some more STM32MP1 boards (and SoM modules) are now available:

Seeed Studio ODYSSEY-STM32MP157C SBC based on Seeed Studio SoM-STM32MP157C SoM

https://www.cnx-software.com/2020/01/21/odyssey-stm32mp157c-sbc-feature-stmicro-stm32mp157c-cortex-a7-m4-soc/

Emtrion emSBC-Argon

https://www.cnx-software.com/2019/07/18/emtrion-emsbc-argon-stm32mp1-dual-cortex-a7-m4-processor/

i2Som PanGu board from I2Som:

https://www.cnx-software.com/2019/06/25/pangu-board-stm32mp1-sbc/

MYIR MYD-YA157C development board based on their MYiR MYC-YA157C STM32MP1 CPU Module

https://www.cnx-software.com/2020/01/07/myir-launches-som-development-board-based-on-stm32mp1-microprocessor/

Avenger96 96Boards CE Extended Board Features an STMicro STM32MP1 SoM

https://www.cnx-software.com/2019/02/23/avenger96-96boards-stmicro-stm32mp1-som/

Shiratech Stinger96 board (96Boards board design)

https://www.cnx-software.com/2020/05/15/stinger96-nb-iot-emtc-and-avenger96-96boards-stm32mp1-sbcs-giveaway/

Direct Insight / Ka-Ro STM32MP1 QSMP 1570 / 157C SoM module and development kit with thier reference devboard/devkit:

https://www.cnx-software.com/2020/06/26/linux-powered-stmicro-stm32mp1-solder-down-qfn-style-som-measures-27x27mm/

Hedda commented 3 years ago

FYI, Olimex has just announced the availability of three "STMP15X-SOM" SoM (System-on-Module) models based on STM32MP151, STM32MP153, and STM32MP157 as well as compatible evaluation board (carrior board / breakout board) called "STMP1(A13)-EVB".

https://www.cnx-software.com/2021/06/21/olimex-stm32mp1-som-and-evaluation-board-support-linux-5-10/

The evaluation board (carrior board / breakout board) is released as open source hardware with schematics on OLIMEX GitHub:

https://www.olimex.com/Products/SOM/STMP1/STMP157-SOM-512/

https://www.olimex.com/Products/SOM/STMP1/STMP1-A13--EVB/open-source-hardware

https://github.com/OLIMEX/STMP1-A13-EVB

STMP157-SOM-512-IND and STMP157-SOM-512-EXT (the SOM models based on the faster STM32MP157) cost €30, while slower SoMs based on STM32MP151 and STM32MP153 cost €20 and €25 respectivly, and the matching evaluation board cost about €20.

STMP157-SOM-512-IND has an internal WiFi antenna and STMP157-SOM-512-EXT has an external WiFi antenna. Both those have a dual-core ARM Cortex-A7 @ 800MHz for Linux OS plus a single-core ARM Cortex-M4 microcontroller @ 209 MHz for real-time.

image image image