Micro-ROS application for controlling LED strips as an embedded HMI on the Arduino Portenta H7.
- MCU: Arduino Portenta H7 (STM32H747 MCU)
Portenta H7 documentation - Baseboard: Arduino Portenta Hat Carrier
Portenta Hat documentation - LED Strip: Adafruit NeoPixel
NeoPixel LED strip - Programmer: ST-Link V2
ST-Link V2 documentation
Note:
The NeoPixel LED strip requires a 5V power supply. The Portenta H7 provides 3.3V on SPI pins, which may not be sufficient for reliable operation. Use a level shifter or a separate 5V supply for the NeoPixel strip.
SPI Pinout (Portenta Hat J5):
- Pin 19 (SPI1_MOSI) - Data line for NeoPixel
- Pin 23 (SPI1_SCK) - Clock line for NeoPixel
This project is built using the Zephyr RTOS and micro-ROS framework.
For setting up micro-ROS on Zephyr, we build upon the micro-ros-zephyr-module repository micro-ros-zephyr-module.
The micro-ROS framework is used to communicate with a ROS 2 system over Ethernet (UDP/IP).
The micro-ros-agent bridges the embedded application and the ROS 2 system.
Start the agent:
docker run -it --rm -v /dev:/dev --privileged --net=host microros/micro-ros-agent:jazzy udp4 --port 8888 -v6
The host machine should be configured with IP address 10.42.0.1
.
Prerequisites:
- Zephyr SDK and toolchain
- Python 3.x
- STM32CubeProgrammer (for flashing)
- West (Zephyr meta-tool)
Initialize workspace (if not already done):
west init -l .
west update
pip install -r zephyr/scripts/requirements.txt
Configure udev rules for ST-Link (Linux):
# Copy rules from CubeProgrammer Drivers/rules to /etc/udev/rules.d/
sudo udevadm control --reload-rules
sudo udevadm trigger
Build the firmware:
west build -d build_caripu_app -b arduino_portenta_h7_m7 applications/caripu
Flash the firmware (using ST-Link):
west flash -d build_caripu_app
or use STM32CubeProgrammer GUI/CLI.