Skip to content

Documentation

Firmware, Installation and Flashing

Initial programming, field updates, runtime installation and recovery.

Firmware, Installation and Flashing

Three separate software components

The BE-IIS-HPP-LIN has three distinct software components:

  1. mboot – Bootloader for firmware updates.
  2. MicroPython firmware – STM32 firmware with native LIN and runtime modules.
  3. Runtime applications – Python applications and instance configuration in the STM32 file system.

A normal firmware update does not automatically replace the runtime applications.

Prepare the build environment

bash scripts/prepare.sh
make host
make test

Initial programming via SWD

Build bootloader and application:

make firmware-all

Program using ST-Link/OpenOCD:

make flash-swd

This method is intended for initial programming and low-level recovery.

Firmware update via I²C

Build only the application:

make firmware

When the daemon is not running:

beiis-lin --direct flash \
  build/micropython/ports/stm32/build-BEIIS_LIN_HAT/firmware.bin

Alternatively:

make flash-i2c

Firmware update while the daemon is running

If beiis-lind already owns the I²C endpoint, do not access it concurrently using --direct.

Instead use:

beiis-lin flash \
  build/micropython/ports/stm32/build-BEIIS_LIN_HAT/firmware.bin

The daemon opens this file path on the same Linux system.

Installing the standard runtime

After installing firmware that supports the 16-slot runtime:

python scripts/install-standard-runtime.py

The script installs:

query.py
lin_native.py
logging_native.py

and configures standard slots 0 through 8.

Do runtime applications survive flashing?

Yes. A regular mboot application update programs the application region. The MicroPython file system, containing:

/flash/beiis/apps/
/flash/beiis/instances.json

is located outside this region and remains intact.

The standard runtime therefore does not have to be reinstalled after every regular firmware update.

Direct MicroPython access

The persistent runtime normally owns the MicroPython interpreter.

For low-level debugging, the runtime can be stopped:

from beiis_lin.client import DaemonClient

c = DaemonClient()
c.runtime_call("runtime_stop")

Afterwards, Raw REPL and direct lin commands can be used.

Recovery

If a faulty application blocks the normal update path, SWD/ST-Link remains an independent recovery route.

For development boards, it is therefore advisable to keep SWDIO, SWCLK and GND accessible.