Micro-ROS powered firmware for STM32F4 microcontroller in ROSbot 2. Embedded, low-level firmware for STM32 microcontroller inside ROSbot. Developed using Mbed Os.
______ _____ _____ _ _ __
| ___ \| _ |/ ___|| | | | / _|
| |_/ /| | | |\ `--. | |__ ___ | |_ | |_ __ __
| / | | | | `--. \| '_ \ / _ \ | __| | _|\ \ /\ / /
| |\ \ \ \_/ //\__/ /| |_) || (_) || |_ | | \ V V /
\_| \_| \___/ \____/ |_.__/ \___/ \__| |_| \_/\_/
Firmware version:
You need to install following tools:
- Dev Containers (
ms-vscode-remote.remote-containers
)
git clone https://github.com/husarion/rosbot_ros2_firmware
Unfortunately, PlatformIO has a bug that impacts libraries configuration. We use git submodules instead.
Git submodules https://git-scm.com/book/en/v2/Git-Tools-Submodules
To import dependencies, in project's root directory run command:
git submodule update --init --recursive
Click the left bottom green button in VS Code and select the Reopen in Container
option.
https://docs.platformio.org/en/latest/frameworks/mbed.html#ignoring-particular-components
In directory ~/.platformio/packages/framework-mbed/features
inside the devcontainer create file called .mbedignore
with the following content:
cellular/*
cryptocell/*
deprecated_warnings/*
lorawan/*
lwipstack/*
nanostack/*
netsocket/*
nfc/*
unsupported/*
Use PlatformIO: Build
task or type
pio run
Use PlatformIO: Upload
task or type
pio run --target upload
You will find firmware.elf
in ./pio/build/core2
.
To flash firmware using core2-flasher
run:
core2-flasher .pio/build/core2/firmware.hex
https://github.com/husarion/stm32loader
This tool allows you to upload firmware using RPi connector.
If you have the bootloader the first two sectors are write protected. Before uploading new firmware you must unlock them (this will erase the bootloader):
$ sudo stm32loader -c <your_sbc> -u -W
To upload new firmware run:
$ sudo stm32loader -c <your_sbc> -e -v -w firmware.bin
where <your_sbc>
:
tinker
for Asus Tinker Boardupboard
for Upboardrpi
for Raspberry Pi
You will find firmware.bin
in ./pio/build/core2
.
To start Micro-ROS communication run:
docker run -it --rm -v /dev:/dev -v /dev/shm:/dev/shm --privileged --net=host microros/micro-ros-agent:humble serial -D <SBC_port_name> serial -b 576000
<SBC_port_name>
:
/dev/ttyS1
for Asus Tinker Board,/dev/ttyAMA0
for Raspberry Pi/dev/ttyS4
for UpBoard
The baudrate should be adjusted for SBC you use. The default value for this firmware is 576000
.
Look ROS_API.md
The easiest way to change the firmware is to work inside a devcontainer.
In VSCode use option Reopen in Container
from extention:
- Dev Containers (ms-vscode-remote.remote-containers)
Release is created automatically after PR with bump command is merged to the master branch. Available bump commands are: bump::major
, bump::minor
and bump::patch
(simply add them to the description of your PR).
The project uses SemVer for versioning. For the versions available, see the tags on this repository.
See CHANGELOG.md.
Documentation:
- https://github.com/platformio/platform-ststm32/tree/develop/examples/mbed-legacy-examples/mbed-rtos
- https://github.com/platformio/platform-ststm32/blob/develop/boards/olimex_e407.json
- https://github.com/platformio/platform-ststm32/blob/develop/boards/black_f407zg.json
- https://github.com/ARMmbed/mbed-os/tree/mbed-os-5.15.6/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F407xG
- https://docs.platformio.org/en/latest/frameworks/mbed.html
- https://docs.platformio.org/en/latest/platforms/creating_board.html