Skip to content

Conversation

@lucarin91
Copy link
Contributor

@lucarin91 lucarin91 commented Oct 27, 2025

Motivation

We need to be sure that he zephyr bootloader on the board is aligned with the version of the core installed. After a fresh installation of the OS, the core installed might be different from the bootloader on the micro, so we need to reflash it.

Change description

Add a new service that runs only the first boot to flash the bootloader.

Additional Notes

Reviewer checklist

  • PR addresses a single concern.
  • PR title and description are properly filled.
  • Changes will be merged in main.
  • Changes are covered by tests.
  • Logging is meaningful in case of troubleshooting.

@Xayton Xayton linked an issue Oct 27, 2025 that may be closed by this pull request
@dido18
Copy link
Contributor

dido18 commented Oct 27, 2025

NOTE: during the burn of the bootloader, the boot animation is interrupted and the LED matrix goes black (no heart animation is shown in the LED matrix).

The burnbootloader service took 30seconds to complete

Oct 27 13:34:31 teressa systemd[1]: Starting arduino-burn-bootloader.service - Burn arduino zephyr bootloader on first boot...
Oct 27 13:34:35 teressa arduino-cli[411]: Open On-Chip Debugger 0.12.0+dev-ge6a2c12f4 (2025-05-22-15:51)
Oct 27 13:34:35 teressa arduino-cli[411]: Licensed under GNU GPL v2
Oct 27 13:34:35 teressa arduino-cli[411]: For bug reports, read
Oct 27 13:34:35 teressa arduino-cli[411]:         http://openocd.org/doc/doxygen/bugs.html
Oct 27 13:34:35 teressa arduino-cli[411]: debug_level: 2
Oct 27 13:34:35 teressa arduino-cli[411]: clock_config
Oct 27 13:34:35 teressa arduino-cli[411]: /tmp/remoteocd/sketch.elf-zsk.bin
Oct 27 13:34:35 teressa arduino-cli[411]: Info : Linux GPIOD JTAG/SWD bitbang driver (libgpiod v2)
Oct 27 13:34:35 teressa arduino-cli[411]: Info : Note: The adapter "linuxgpiod" doesn't support configurable speed
Oct 27 13:34:35 teressa arduino-cli[411]: Info : SWD DPIDR 0x0be12477
Oct 27 13:34:35 teressa arduino-cli[411]: Info : [stm32u5.ap0] Examination succeed
Oct 27 13:34:35 teressa arduino-cli[411]: Info : [stm32u5.cpu] Cortex-M33 r0p4 processor detected
Oct 27 13:34:35 teressa arduino-cli[411]: Info : [stm32u5.cpu] target has 8 breakpoints, 4 watchpoints
Oct 27 13:34:35 teressa arduino-cli[411]: Info : [stm32u5.cpu] Examination succeed
Oct 27 13:34:35 teressa arduino-cli[411]: Info : [stm32u5.ap0] gdb port disabled
Oct 27 13:34:35 teressa arduino-cli[411]: Info : [stm32u5.cpu] starting gdb server on 3333
Oct 27 13:34:35 teressa arduino-cli[411]: Info : Listening on port 3333 for gdb connections
Oct 27 13:34:35 teressa arduino-cli[411]: CPU in Non-Secure state
Oct 27 13:34:35 teressa arduino-cli[411]: [stm32u5.cpu] halted due to debug-request, current mode: Thread
Oct 27 13:34:35 teressa arduino-cli[411]: xPSR: 0x41000000 pc: 0x0801748c psp: 0x2002ccf8
Oct 27 13:34:35 teressa arduino-cli[411]: Info : device idcode = 0x30076482 (STM32U57/U58xx - Rev U : 0x3007)
Oct 27 13:34:35 teressa arduino-cli[411]: Info : TZEN = 0 : TrustZone disabled by option bytes
Oct 27 13:34:35 teressa arduino-cli[411]: Info : RDP level 0 (0xAA)
Oct 27 13:34:35 teressa arduino-cli[411]: Info : flash size = 2048 KiB
Oct 27 13:34:35 teressa arduino-cli[411]: Info : flash mode : dual-bank
Oct 27 13:34:35 teressa arduino-cli[411]: Info : Padding image section 2 at 0x080373ac with 4 bytes (bank write end alignment)
Oct 27 13:34:35 teressa arduino-cli[411]: Warn : Adding extra erase range, 0x080373b0 .. 0x08037fff
Oct 27 13:34:52 teressa arduino-cli[411]: shutdown command invoked
Oct 27 13:34:53 teressa systemd[1]: Finished arduino-burn-bootloader.service - Burn arduino zephyr bootloader on first boot.

During the second reboot, the command is skipped correctly:

Oct 27 13:37:19 teressa systemd[1]: arduino-burn-bootloader.service - Burn arduino zephyr bootloader on first boot was skipped because of an unmet condition check (ConditionPath>

@lucarin91 lucarin91 merged commit 37f6f9d into main Oct 27, 2025
5 checks passed
@lucarin91 lucarin91 deleted the add-boot-loader-service branch October 27, 2025 14:47
@per1234 per1234 added the bug Something isn't working label Oct 27, 2025
lucarin91 added a commit that referenced this pull request Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure the bootloader is flashed at first boot

3 participants