Skip to content

boards: ruiside: art-pi2: add minimum support #88185

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

Merged
merged 1 commit into from
Apr 24, 2025

Conversation

bricle
Copy link
Contributor

@bricle bricle commented Apr 5, 2025

Changes proposed:

  • Add support for new vendor Shanghai Ruiside Electronic Technology Co., Ltd.
    • Update dts/bindings/vendor-prefixes.txt with rt-threat prefix
  • Add ART-PI2 board basic support
    • Board features STM32H7R7L8HxH microcontroller
    • Configure for POWER_SUPPLY_DIRECT_SMPS operation mode

Testing:

Hello World Sample Output

*** Booting Zephyr OS build v4.1.0-1907-g415ab379a8af ***
Hello World! art_pi2/stm32h7r7xx

# Required HAL Changes:
- Need to add SMPS define in hal_stm32 to enable POWER_SUPPLY_DIRECT_SMPS, otherwise this won't build
with flollowing error

/home/user/zephyrproject/zephyr/soc/st/stm32/stm32h7rsx/soc.c: In function 'soc_early_init_hook':
/home/user/zephyrproject/zephyr/soc/st/stm32/stm32h7rsx/soc.c:47:2: error: #error Unsupported configuration: Selected SoC do not support SMPS
   47 | #error Unsupported configuration: Selected SoC do not support SMPS
      |  ^~~~~

Questions for Maintainers:

  • Seeking guidance on the HAL changes implementation path:
    1. Should these HAL changes be implemented by ST staff directly?
    2. Or can I submit a separate PR to hal_stm32 repository and update the HAL revision?

@bricle
Copy link
Contributor Author

bricle commented Apr 5, 2025

@kartben @FRASTM could you take a look please? it seems like the bot missed the platform: STM32 label, thank you!

@@ -578,6 +578,7 @@ ronbo Ronbo Electronics
ronoth Ronoth
roofull Shenzhen Roofull Technology Co, Ltd
roseapplepi RoseapplePi.org
rt-thread RT-Thread
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recommend using the foundation's name, if available.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a company, Shanghai Ruiside Electronic Technology Co., Ltd. https://www.rt-thread.org/about.html

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weirdly, there is another entity Real-Thread Information Technology Limited mentioned here https://www.rt-thread.org/account/user/terms.html
and here https://www.rt-thread.io/account/user/policy.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Shanghai Ruiside Electronic Technology Co., Ltd. is the correct company name. RT-Thread is a trademark owned by this company, as states in this official article (in Chinese). Also in China, this company is the official distributor and manufacturer of RT-Thread boards, including the ART-Pi2.

@@ -0,0 +1,6 @@
board:
name: art_pi2
full_name: RT-Thread ART-Pi2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
full_name: RT-Thread ART-Pi2
full_name: ART-Pi2

What's more, I cannot find any reference to this board online -- is this really how the board is named or is this a "rev. 2" of the ART-Pi?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer taking this as separate board named "ART-Pi2", distinct from ART-Pi with different mcu and other features.

Documentation can be found here: sdk-bsp-stm32h7r-realthread-artpi2
Schematics are available here: schematics

For clarity:

  • ART-Pi2:
    • New board featuring STM32H7R7 (this PR)
    • Just released in February, 2025, so there is not much reference online
    • Will be available on AliExpress and Mouser soon
  • ART-Pi:
    • Different board featuring STM32H750, released in 2020
    • Available on AliExpress and Mouser

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, thanks for clarifying!

Copy link
Collaborator

@JarmouniA JarmouniA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this vendor using the name RT-Thread, which is a well-known open-source RTOS? https://en.m.wikipedia.org/wiki/RT-Thread
Is this coming from the same company?

@bricle
Copy link
Contributor Author

bricle commented Apr 5, 2025

Yes, this board comes from the same company that created RT-Thread RTOS. These development boards (ART-Pi and ART-Pi2) are officially designed and produced by the RT-Thread team to showcase their RTOS capabilities and provide reference hardware for developers.

While the board's original SDK is based on RT-Thread RTOS, I'm working on porting it to Zephyr to provide users with an alternative RTOS option.

:goals: debug

.. _ART-Pi2 website:
https://github.com/RT-Thread-Studio/sdk-bsp-stm32h7r-realthread-artpi2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be referencing repos dedicated to other RTOSs in Zephyr?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not?

Copy link
Collaborator

@JarmouniA JarmouniA Apr 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not?

@kartben just wondering if it's really necessary, that's all.

https://www.st.com/resource/en/reference_manual/rm0477-stm32h7rx7sx-armbased-32bit-mcus-stmicroelectronics.pdf

.. _ART-Pi2 board documents:
https://github.com/RT-Thread-Studio/sdk-bsp-stm32h7r-realthread-artpi2/tree/master/documents
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the info found here is specific to RT-Thread RTOS (plus not in English). Info that is relevant to Zephyr should be added in the board's doc directly & this reference should be removed.

https://github.com/RT-Thread-Studio/sdk-bsp-stm32h7r-realthread-artpi2/tree/master/documents

.. _OpenOCD installing Debug Version:
https://github.com/zephyrproject-rtos/openocd
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used, to be removed.

https://github.com/zephyrproject-rtos/openocd

.. _OpenOCD installing with ST-LINK V3 support:
https://mbd.kleier.net/integrating-st-link-v3.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used.

https://mbd.kleier.net/integrating-st-link-v3.html

.. _STM32CubeIDE:
https://www.st.com/en/development-tools/stm32cubeide.html
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used

Debugging
=========

You can debug an application in the usual way. Here is an example for the
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with OpenOCD? if yes, is it the one included with Zephyr SDK on Linux?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually debuging and flashing don't work with the OpenOCD included with Zephyr SDK on Linux, removed it, thank you

The board is configured to be flashed using west `STM32CubeProgrammer`_ runner,
so its :ref:`installation <stm32cubeprog-flash-host-tools>` is required.

Alternatively, pyocd or openocd can also be used to flash the board using
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pyOCD, OpenOCD

@bricle bricle force-pushed the art-pi2 branch 2 times, most recently from 83df3b9 to b6bee33 Compare April 5, 2025 12:54
@@ -578,6 +578,7 @@ ronbo Ronbo Electronics
ronoth Ronoth
roofull Shenzhen Roofull Technology Co, Ltd
roseapplepi RoseapplePi.org
rt-thread Shanghai Ruiside Electronic Technology Co., Ltd.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rt-thread -> ruiside, the same for board folder name.

#include <zephyr/dt-bindings/input/input-event-codes.h>

/ {
model = "RT-Thread ART-Pi2 board";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
model = "RT-Thread ART-Pi2 board";
model = "Ruiside Electronic ART-Pi2 board";

@bricle bricle changed the title boards: rt-thread: art-pi2: add minimum support boards: ruiside: art-pi2: add minimum support Apr 5, 2025

/ {
model = "Ruiside Electronic ART-Pi2 board";
compatible = "Ruiside,art-pi2";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
compatible = "Ruiside,art-pi2";
compatible = "ruiside,art-pi2";

- watchdog
- adc
- entropy
vendor: Ruiside
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
vendor: Ruiside
vendor: ruiside

# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y

# enable uart driver
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use proper capitalization of nouns in code comments (e.g. UART and not uart, CMake and not cmake).
And use capitals for first letter of comments

@erwango
Copy link
Member

erwango commented Apr 9, 2025

About:

Need to add SMPS define in hal_stm32 to enable POWER_SUPPLY_DIRECT_SMPS, otherwise this won't build
with flollowing error

The commit you're pointing at is merged in hal_stm32 already. Can you clarify the expectation here ?

@bricle
Copy link
Contributor Author

bricle commented Apr 9, 2025

About:

Need to add SMPS define in hal_stm32 to enable POWER_SUPPLY_DIRECT_SMPS, otherwise this won't build
with flollowing error

The commit you're pointing at is merged in hal_stm32 already. Can you clarify the expectation here ?

It seems like this commit anly add SMPS define in stm32cube/stm32h7rsxx/soc/stm32h7s7xx.h, while this boards is based on STM32H7R7L8HxH mcu, which don't have this define in corresponding stm32h7r7xx.h, thank you for your reply!

Comment on lines 39 to 129
- Core: ARM |reg| 32-bit Cortex |reg| -M7 CPU with TrustZone |reg| and FPU.
- Performance benchmark:

- 1284 DMPIS/MHz (Dhrystone 2.1)

- Security

- Arm |reg| TrustZone |reg| with ARMv8-M mainline security extension
- Up to 8 configurable SAU regions
- TrustZone |reg| aware and securable peripherals
- Flexible lifecycle scheme with secure debug authentication
- Preconfigured immutable root of trust (ST-iROT)
- SFI (secure firmware installation)
- Secure data storage with hardware unique key (HUK)
- Secure firmware upgrade support with TF-M
- 2x AES coprocessors including one with DPA resistance
- Public key accelerator, DPA resistant
- On-the-fly decryption of Octo-SPI external memories
- HASH hardware accelerator
- True random number generator, NIST SP800-90B compliant
- 96-bit unique ID
- Active tampers
- True Random Number Generator (RNG) NIST SP800-90B compliant

- Clock management:

- 24 MHz crystal oscillator (HSE)
- 32768 Hz crystal oscillator for RTC (LSE)
- Internal 64 MHz (HSI) trimmable by software
- Internal low-power 32 kHz RC (LSI)( |plusminus| 5%)
- Internal 4 MHz oscillator (CSI), trimmable by software
- Internal 48 MHz (HSI48) with recovery system
- 3 PLLs for system clock, USB, audio, ADC

- Power management

- Embedded regulator (LDO) with three configurable range output to supply the digital circuitry
- Embedded SMPS step-down converter

- RTC with HW calendar, alarms and calibration
- Up to 152 fast I/Os, most 5 V-tolerant, up to 10 I/Os with independent supply down to 1.08 V
- Up to 16 timers and 2 watchdogs

- 16x 16-bit
- 4x 32-bit timers with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input
- 5x 16-bit low-power 16-bit timers (available in Stop mode)
- 2x watchdogs
- 1x SysTick timer

- Memories

- Up to 64KB Flash, 2 banks read-while-write
- 1 Kbyte OTP (one-time programmable)
- 640 KB of SRAM including 64 KB with hardware parity check and 320 Kbytes with flexible ECC
- 4 Kbytes of backup SRAM available in the lowest power modes
- Flexible external memory controller with up to 16-bit data bus: SRAM, PSRAM, FRAM, SDRAM/LPSDR SDRAM, NOR/NAND memories
- 2x OCTOSPI memory interface with on-the-fly decryption and support for serial PSRAM/NAND/NOR, Hyper RAM/Flash frame formats
- 1x HEXASPI memory interface with on-the-fly decryption and support for serial PSRAM/NAND/NOR, Hyper RAM/Flash frame formats
- 2x SD/SDIO/MMC interfaces

- Rich analog peripherals (independent supply)

- 2x 12-bit ADC with up to 5 MSPS in 12-bit
- 1x Digital temperature sensor

- 35x communication interfaces

- 1x USB Type-C / USB power-delivery controller
- 1x USB OTG full-speed with PHY
- 1x USB OTG high-speed with PHY
- 3x I2C FM+ interfaces (SMBus/PMBus)
- 1x I3C interface
- 7x U(S)ARTS (ISO7816 interface, LIN, IrDA, modem control)
- 2x LP UART
- 6x SPIs including 3 muxed with full-duplex I2S
- 2x SAI
- 2x FDCAN
- 2x SD/SDIO/MMC interface
- 2x 16 channel DMA controllers
- 1x 8- to 16- bit camera interface
- 1x HDMI-CEC
- 1x Ethernel MAC interface with DMA controller
- 1x 16-bit parallel slave synchronous-interface
- 1x SPDIF-IN interface
- 1x MDIO slave interface

- CORDIC for trigonometric functions acceleration
- FMAC (filter mathematical accelerator)
- CRC calculation unit
- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell |trade|

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is taking 2 pages on the documentation page, I would just remove it. People should click on "More information..." links if they need more info, and doc page shouldn't be unnecessarily cluttered by these.

Suggested change
- Core: ARM |reg| 32-bit Cortex |reg| -M7 CPU with TrustZone |reg| and FPU.
- Performance benchmark:
- 1284 DMPIS/MHz (Dhrystone 2.1)
- Security
- Arm |reg| TrustZone |reg| with ARMv8-M mainline security extension
- Up to 8 configurable SAU regions
- TrustZone |reg| aware and securable peripherals
- Flexible lifecycle scheme with secure debug authentication
- Preconfigured immutable root of trust (ST-iROT)
- SFI (secure firmware installation)
- Secure data storage with hardware unique key (HUK)
- Secure firmware upgrade support with TF-M
- 2x AES coprocessors including one with DPA resistance
- Public key accelerator, DPA resistant
- On-the-fly decryption of Octo-SPI external memories
- HASH hardware accelerator
- True random number generator, NIST SP800-90B compliant
- 96-bit unique ID
- Active tampers
- True Random Number Generator (RNG) NIST SP800-90B compliant
- Clock management:
- 24 MHz crystal oscillator (HSE)
- 32768 Hz crystal oscillator for RTC (LSE)
- Internal 64 MHz (HSI) trimmable by software
- Internal low-power 32 kHz RC (LSI)( |plusminus| 5%)
- Internal 4 MHz oscillator (CSI), trimmable by software
- Internal 48 MHz (HSI48) with recovery system
- 3 PLLs for system clock, USB, audio, ADC
- Power management
- Embedded regulator (LDO) with three configurable range output to supply the digital circuitry
- Embedded SMPS step-down converter
- RTC with HW calendar, alarms and calibration
- Up to 152 fast I/Os, most 5 V-tolerant, up to 10 I/Os with independent supply down to 1.08 V
- Up to 16 timers and 2 watchdogs
- 16x 16-bit
- 4x 32-bit timers with up to 4 IC/OC/PWM or pulse counter and quadrature (incremental) encoder input
- 5x 16-bit low-power 16-bit timers (available in Stop mode)
- 2x watchdogs
- 1x SysTick timer
- Memories
- Up to 64KB Flash, 2 banks read-while-write
- 1 Kbyte OTP (one-time programmable)
- 640 KB of SRAM including 64 KB with hardware parity check and 320 Kbytes with flexible ECC
- 4 Kbytes of backup SRAM available in the lowest power modes
- Flexible external memory controller with up to 16-bit data bus: SRAM, PSRAM, FRAM, SDRAM/LPSDR SDRAM, NOR/NAND memories
- 2x OCTOSPI memory interface with on-the-fly decryption and support for serial PSRAM/NAND/NOR, Hyper RAM/Flash frame formats
- 1x HEXASPI memory interface with on-the-fly decryption and support for serial PSRAM/NAND/NOR, Hyper RAM/Flash frame formats
- 2x SD/SDIO/MMC interfaces
- Rich analog peripherals (independent supply)
- 2x 12-bit ADC with up to 5 MSPS in 12-bit
- 1x Digital temperature sensor
- 35x communication interfaces
- 1x USB Type-C / USB power-delivery controller
- 1x USB OTG full-speed with PHY
- 1x USB OTG high-speed with PHY
- 3x I2C FM+ interfaces (SMBus/PMBus)
- 1x I3C interface
- 7x U(S)ARTS (ISO7816 interface, LIN, IrDA, modem control)
- 2x LP UART
- 6x SPIs including 3 muxed with full-duplex I2S
- 2x SAI
- 2x FDCAN
- 2x SD/SDIO/MMC interface
- 2x 16 channel DMA controllers
- 1x 8- to 16- bit camera interface
- 1x HDMI-CEC
- 1x Ethernel MAC interface with DMA controller
- 1x 16-bit parallel slave synchronous-interface
- 1x SPDIF-IN interface
- 1x MDIO slave interface
- CORDIC for trigonometric functions acceleration
- FMAC (filter mathematical accelerator)
- CRC calculation unit
- Development support: serial wire debug (SWD), JTAG, Embedded Trace Macrocell |trade|

:maybe-skip-config:
:goals: debug

.. _ART-Pi2 website:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
.. _ART-Pi2 website:
References
**********
.. target-notes::
.. _ART-Pi2 website:

@decsny decsny removed their request for review April 14, 2025 17:17
@bricle bricle force-pushed the art-pi2 branch 3 times, most recently from a85e82f to cc45cc9 Compare April 24, 2025 12:21
@bricle
Copy link
Contributor Author

bricle commented Apr 24, 2025

rebased to main to address dependency issue, dear reviewers please revisits.

nordicjm
nordicjm previously approved these changes Apr 24, 2025
@nordicjm
Copy link
Collaborator

For future note: to get reviewers to know they need to check things, in the top right under reviewers, click the refresh button next to the names, have done it for you

rruuaanng
rruuaanng previously approved these changes Apr 24, 2025
- introduced a new vendor ruiside, updated
`dts/bindings/vendor-prefixes.txt`
- add art-pi2 board basic support

Signed-off-by: Shan Pen <[email protected]>
@kartben kartben merged commit 46f5e7b into zephyrproject-rtos:main Apr 24, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants