Omnia doesn't boot after MCU upgrade

Hello

recently i updated the mcu tool but now the turris doesnt boot (serial terminal i see constant reboot )Showing this error

"Initializing the system
sh: write error:[ 4.726036] leds omnia-led:all: Setting an LED’s brightness failed (-6)
Operation not permitted
Read error on /dev/mtd0: No error information
R[ 4.739417] leds omnia-led:all: Setting an LED’s brightness failed (-6)
escue mode 21504[ 4.746957] leds omnia-led:power: Setting an LED’s brightness failed (-6)
024 + 1 selected on cmdline
Booting rescue mode for omnia in mode 1
Now is your chance to change a mode from 1 to something else, press the button to do so
sh: write error: Operation not permitted
Waiting for 4s …
4s left
3s left
sh: write error:[ 6.825663] leds omnia-led:power: Setting an LED’s brightness failed (-6)
Operation not permitted
2s left
1s left
[ 8.590075] random: fast init done
0s left
"

How i can reflash the MCU firmware via serial?

I believe MCU is popular STM32/GD32 chip quite common. You may reflash it externally using JTAG (SWD precisely) you just need something like ST-Link v2 programmer.

There are SWDCLK SWDIO 3V3 and GND connections needed to reflash it.

On old wiki there is still pinout:

Edit: But you would also need binary dump and write address. Get ST-Link v2 i recommend the original white one not some chineese clone as they have worse PSU. Ask your local hackerspace they might have one. And I will look on my Omnia for firmware and if not I will dump mine and send you dump and write address.

1 Like

Ok I see there is firmware on my Omnia but there were different revisions:

root@router:~# cd /usr/share/omnia-mcu-firmware/
root@router:/usr/share/omnia-mcu-firmware# ls
gd32-rev23.app.bin
gd32-rev23.boot.bin
gd32-rev32.app.bin
gd32-rev32.boot.bin
mkl-rev32.app.bin
mkl-rev32.boot.bin
stm32-rev23-user-regulator.app.bin
stm32-rev23-user-regulator.boot.bin
stm32-rev23.app.bin
stm32-rev23.boot.bin
stm32-rev32.app.bin
stm32-rev32.boot.bin

Mine is:

root@router:~# omnia-mcutool -v
Bootloader version:  b5a8a24e007eb72be16aeb3fff6f03ec647023e4
Application version: e44032e4c49337f77583d1caaf1b4b3682e878f7
MCU type: STM32
Board firmware type: stm32-rev23-user-regulator
Features: 0x3f6e
  EXT_CMDS
  WDT_PING
  LED_STATE_EXT
  LED_GAMMA_CORRECTION
  NEW_INT_API
  FLASHING
  NEW_MESSAGE_API
  BRIGHTNESS_INT
  POWEROFF_WAKEUP
  CAN_OLD_MESSAGE_API
  TRNG
Application firmware length: 23192 Bytes
Application firmware checksum: 0x96d4e674

So stm32-rev23-user-regulator. Someone from Turris team would have to let you know by your serial number which one you should flash. And I see there is boot and app so probabbly two different write addresses. But I guess just flashing boot will revive your Omnia. And then you may do normal mcu-update to get latest app

Or maybe connect to UART of MCU directly as you can see on the pinout picture maybe it will tell you which one it is. But I guess those pins are 1.27mm raster so smaller standard

Finally i flashed the MCU after change the boot order (i dont know why only was booting rescue image)

i fixed it in uboot with

setenv boot_targets scsi0 mmc0 usb0 pxe dhcp
run distro_bootcmd

for the next can be interesting to interface and document all info for recover from bad Uboot and bad mcu via tools like STM and Jtag

2 Likes