This repository is an OpenWRT feed dedicated to supporting the STMicroelectronics STM32MP1 platforms.
-
STM32MP157F-DK2
: minimal support for the STM32MP157F-DK2 -
STM32MP135F-DK
: minimal support for the STM32MP135F-DK -
STM32MP157F-DK2-DEMO
: based on theSTM32MP157F-DK2
device including additional packages like a web interface to configure the device. -
STM32MP135F-DK-DEMO
: based on theSTM32MP135F-DK
device including additional packages like a web interface to configure the device.
Supported features | STM32MP157F-DK2 | STM32MP135F-DK |
---|---|---|
Sysupgrade | yes | yes |
Ethernet | yes | yes |
Watchdog | yes | yes |
RTC | yes | yes |
RNG (Optee) | yes | yes |
LED | yes | yes |
Button | no | yes (USER2) |
Wifi | yes | yes |
USB Type-A | yes | yes |
This feed is based on the STPM32MP1 BSP v5.0
.
Components | Version |
---|---|
TF-A | v2.8-stm32mp-r1 |
U-Boot | v2022.10-stm32mp-r1 |
OPTEE | 3.19.0-stm32mp-r1 |
Linux | OpenWRT kernel + v6.1-stm32mp-r1 |
For the kernel, the patches from the v6.1-stm32mp branch until the tag
v6.1-stm32mp-r1 were added.
They are available in target/linux/stm32/patches-6.1/
.
In order to use OpenWRT, you need to have a Linux or Unix like distribution installed on your workstation. And you need to install a set of packages as described in the OpenWRT Build system setup.
The feed is designed to work with the master
branch of OpenWRT (last tested
commit is cffd3ad8d7).
$ git clone -b master https://git.openwrt.org/openwrt/openwrt.git
$ cd openwrt
$ git checkout cffd3ad8d7
Next step is to add the STMicroelectronics feed in the
feeds.conf.default
file.
$ cat feeds.conf.default
src-git st https://github.com/bootlin/openwrt-feed-st.git
src-git packages https://git.openwrt.org/feed/packages.git
src-git luci https://git.openwrt.org/project/luci.git
src-git routing https://git.openwrt.org/feed/routing.git
src-git telephony https://git.openwrt.org/feed/telephony.git
#src-git video https://github.com/openwrt/video.git
#src-git targets https://github.com/openwrt/targets.git
#src-git oldpackages http://git.openwrt.org/packages.git
#src-link custom /usr/src/openwrt/custom-feed
Then fetch the code of all feeds
$ ./scripts/feeds update -a
Install stm32 target
$ ./scripts/feeds install stm32
Install all other packages
$ ./scripts/feeds install -a -f
(Some overriding warnings can occur, if you used -f
please ignore them).
Run make menuconfig
$ make menuconfig
Then select STMicroelectronics STM32
for the Target System
, STM32MP1 boards
for the Subtarget
, and select the Target Profile
corresponding to
your hardware (for example STMicroelectronics STM32MP135F-DK
).
Then to start the build.
$ make -j$(nproc)
All images generated for the subtarget stm32mp1
are stored in
bin/targets/stm32/stm32mp1/
.
The images to flash on the SDCard are
openwrt-stm32-stm32mp1-stm32mpXXXXX-ext4-factory.img.gz
.
$ gzip -d -c bin/targets/stm32/stm32mp1/openwrt-stm32-stm32mp1-stm32mp135f-dk-ext4-factory.img.gz | dd of=/dev/sdX
(Note: this assumes your SD card appears as /dev/sdX
on your system.)
Then:
-
Insert the microSD card
- STM32MP157: connector CN15
- STM32MP135: connector CN3
-
Plug a micro-USB cable and run your serial communication program on /dev/ttyACM0.
- STM32MP157: connector CN11
- STM32MP135: connector CN10
-
Configure the SW1 switch to boot on SD card
- STM32MP157: BOOT0 and BOOT2 to ON
- STM32MP135: BOOT0 to ON, BOOT1 to OFF, BOOT2 to ON
-
Plug a USB-C cable to power-up the board
- STM32MP157: connector CN6
- STM32MP135: connector CN12
-
The system will start, with the console on UART. The default user is root with no password. The login is automatic.
BusyBox v1.36.1 (2024-02-14 15:44:53 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt SNAPSHOT, r24943+13-3a073a0212
-----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:/#
This chapter contains some informations which are specific to the stm32 target. For the generic informations, please refer to the Official OpenWRT documentation.
The configuration of Ethernet interfaces is the default OpenWRT configuration:
STM32MP157F-DK2
:lan
interfaceSTM32MP135F-DK
:lan
interface (ETH1
) andwan
interface (ETH2
)
The lan
interface is configured with a static ip address 192.168.1.1 and a
dhcp server is running.
The wan
interface is in dhcp mode.
By default the management protocols are only accessible from the lan interface.
For a system upgrade, an upgrade image shall be used (image labelled ...-sysupgrade.img.gz).
The demo and non-demo profiles are compatible, it means you can update a
STM32MP135F-DK
profile with a STM32MP135F-DK-DEMO
image (vice versa) for
example.
By default, the sysupgrade mechanism updates the partitions one by one. If the partition table is different (for example the rootfs partition is 10MiB bigger), the full image is written.
The U-Boot environment variables are always preserved during an upgrade.
To erase the environment variables, flash the factory image on the SDCard or
use the env erase
command from U-Boot.
Useful link: Upgrading OpenWrt firmware using LuCI and CLI
The kernel module gpio-button-hotplug
is used to support buttons.
The STM32MP135F-DK
has one supported button: USR2
(key BTN_1
).
To easily test the button:
mkdir -p /etc/hotplug.d/button
cat << "EOF" > /etc/hotplug.d/button/buttons
logger "the button was ${BUTTON} and the action was ${ACTION}"
EOF
root@OpenWrt:/# logread -f
Fri Mar 15 14:28:09 2024 user.notice root: the button was BTN_1 and the action was pressed
Fri Mar 15 14:28:09 2024 user.notice root: the button was BTN_1 and the action was released
Useful link: Attach functions to a push button
One LED is defined and labelled blue:heartbeat
(LD8
for STM32MP157F-DK2
and
LD3
for STM32MP135F-DK
). By default it is configured to use the heartbeat
trigger.
Useful link: LED Configuration
Only mass storage are supported on the USB Type-A by default.