Unable to upload sketch on Arduino Uno Q

Hello folks,
My Arduino Q seems stuck.
When I try to upload even empty sketch I get this:

Starting app "Test1"
Sketch profile configured: Name="default", Port=""
Sketch uses 241 bytes (0%) of program storage space. Maximum is 1966080 bytes.
Global variables use 0 bytes (0%) of dynamic memory, leaving 523624 bytes for local variables. Maximum is 523624 bytes.
Open On-Chip Debugger 0.12.0+dev-ge6a2c12f4 (2025-05-22-15:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
clock_config
/tmp/remoteocd/sketch.elf-zsk.bin
Info : Linux GPIOD JTAG/SWD bitbang driver (libgpiod v2)
Info : Note: The adapter "linuxgpiod" doesn't support configurable speed
Info : SWD DPIDR 0x0be12477
Info : [stm32u5.ap0] Examination succeed
Info : [stm32u5.cpu] Cortex-M33 r0p4 processor detected
Info : [stm32u5.cpu] target has 8 breakpoints, 4 watchpoints
Info : [stm32u5.cpu] Examination succeed
Info : [stm32u5.ap0] gdb port disabled
Info : [stm32u5.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
CPU in Non-Secure state
[stm32u5.cpu] halted due to debug-request, current mode: Handler BusFault
xPSR: 0x09000005 pc: 0x0801b846 msp: 0x2002caf0
Info : SWD DPIDR 0x0be12477
Error: error running OpenOCD: exit status 1
Error: Failed to write memory at 0x00000000
00000000
Open On-Chip Debugger 0.12.0+dev-ge6a2c12f4 (2025-05-22-15:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
clock_config
/tmp/remoteocd/sketch.elf-zsk.bin
Info : Linux GPIOD JTAG/SWD bitbang driver (libgpiod v2)
Info : Note: The adapter "linuxgpiod" doesn't support configurable speed
Info : SWD DPIDR 0x0be12477
Info : [stm32u5.ap0] Examination succeed
Info : [stm32u5.cpu] Cortex-M33 r0p4 processor detected
Info : [stm32u5.cpu] target has 8 breakpoints, 4 watchpoints
Info : [stm32u5.cpu] Examination succeed
Info : [stm32u5.ap0] gdb port disabled
Info : [stm32u5.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
CPU in Non-Secure state
[stm32u5.cpu] halted due to debug-request, current mode: Handler BusFault
xPSR: 0x09000005 pc: 0x0801b846 msp: 0x2002caf0
Info : device idcode = 0x30076482 (STM32U57/U58xx - Rev U : 0x3007)
Info : TZEN = 0 : TrustZone disabled by option bytes
Info : RDP level 0 (0xAA)
Error: error running OpenOCD: exit status 1
Info : flash size = 2048 KiB
Info : flash mode : dual-bank
Info : Padding image section 0 at 0x080f0032 with 14 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x080f0040 .. 0x080f1fff
Error: failed erasing sectors 120 to 120
auto erase enabled
Failed uploading: uploading error: exit status 1

I did a complete reflashing with the following command:

arduino-flasher-cli flash latest

And installed the updates after that, however I still am unable to upload Arduino sketches from the App Lab, including empty new sketch.
The Arduino core seems stuck. There is also no animation when I power the board.
Any suggestions?

Cheers,
Boian

I also tried this in the terminal:

arduino-cli burn-bootloader -b arduino:zephyr:unoq -P jlink

Getting this:

Open On-Chip Debugger 0.12.0+dev-ge6a2c12f4 (2025-05-22-15:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
clock_config
/tmp/remoteocd/sketch.elf-zsk.bin
Info : Linux GPIOD JTAG/SWD bitbang driver (libgpiod v2)
Info : Note: The adapter "linuxgpiod" doesn't support configurable speed
Info : SWD DPIDR 0x0be12477
Info : [stm32u5.ap0] Examination succeed
Info : [stm32u5.cpu] Cortex-M33 r0p4 processor detected
Info : [stm32u5.cpu] target has 8 breakpoints, 4 watchpoints
Info : [stm32u5.cpu] Examination succeed
Info : [stm32u5.ap0] gdb port disabled
Info : [stm32u5.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
CPU in Non-Secure state
[stm32u5.cpu] halted due to debug-request, current mode: Handler BusFault
xPSR: 0x09000005 pc: 0x0801b846 msp: 0x2002caf0
Error: error running OpenOCD: exit status 1
Info : device idcode = 0x30076482 (STM32U57/U58xx - Rev U : 0x3007)
Info : TZEN = 0 : TrustZone disabled by option bytes
Info : RDP level 0 (0xAA)
Info : flash size = 2048 KiB
Info : flash mode : dual-bank
Info : Padding image section 2 at 0x08031a1c with 4 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x08031a20 .. 0x08031fff
Error: failed erasing sectors 0 to 24
auto erase enabled
Error during Upload: Failed to burn bootloader: uploading error: exit status 1

Follow systematic steps:

1. Use IDE 2.3.7.
2. Include Arduino UNO Q in the IDE as board.
3. Upload the following sketch to see that LED3_R (bottom right: STM 3) blinks and Hello message appears on Monitor Console.

#include <Arduino_RouterBridge.h>

void setup() {
  Bridge.begin();
  Monitor.begin();
  delay(5000);

  pinMode(LED_BUILTIN, OUTPUT);
  }

void loop() {

  Monitor.println("Hello");
  digitalWrite(LED_BUILTIN, LOW);   // active LOW; turn LED on
  delay(1000);                      //1000 ms
  digitalWrite(LED_BUILTIN, HIGH);  // active low,LED off
  delay(1000);                      // wait for a second
}

4. To see the difference between Monitor Console and the traditional Serial Monitor and the uploading mechanism, you may look into the following diagrams which I have created for my own understanding.


Figure-1:


Figure-2:

Use IDE 2.3.7.
Include Arduino UNO Q in the IDE as board.

…

When I try to upload I get this error:

Sketch uses 20800 bytes (1%) of program storage space. Maximum is 1966080 bytes.
Global variables use 4756 bytes (0%) of dynamic memory, leaving 518868 bytes for local variables. Maximum is 523624 bytes.
Open On-Chip Debugger 0.12.0+dev-ge6a2c12f4 (2025-05-22-15:51)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
clock_config
/tmp/remoteocd/sketch.elf-zsk.bin
Info : Linux GPIOD JTAG/SWD bitbang driver (libgpiod v2)
Info : Note: The adapter "linuxgpiod" doesn't support configurable speed
Info : SWD DPIDR 0x0be12477
Info : [stm32u5.ap0] Examination succeed
Info : [stm32u5.cpu] Cortex-M33 r0p4 processor detected
Info : [stm32u5.cpu] target has 8 breakpoints, 4 watchpoints
Info : [stm32u5.cpu] Examination succeed
Info : [stm32u5.ap0] gdb port disabled
Info : [stm32u5.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
CPU in Non-Secure state
[stm32u5.cpu] halted due to debug-request, current mode: Handler BusFault
xPSR: 0x09000005 pc: 0x0801b846 msp: 0x2002caf0
Error: error running OpenOCD: exit status 1
Info : device idcode = 0x30076482 (STM32U57/U58xx - Rev U : 0x3007)
Info : TZEN = 0 : TrustZone disabled by option bytes
Info : RDP level 0 (0xAA)
Info : flash size = 2048 KiB
Info : flash mode : dual-bank
Info : Padding image section 0 at 0x080fd45c with 4 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x080fd460 .. 0x080fdfff
Error: failed erasing sectors 120 to 126
auto erase enabled
Failed uploading: uploading error: exit status 1

Now, @ptillisch may come up with ideas for next actions.

@mitov

It looks like that the preinstalled operating system (Linux) and other support services have gone corrupted in your UNO Q.

In thhe meantime, you may try Step-12 of this link. You may be lucky if it works.

Nothing can be uploaded.

I have reflashed the Linux image as described here:

https://docs.arduino.cc/tutorials/uno-q/update-image/

This did not help.

The Linux side is functioning perfectly fine, but I am unable to upload any sketch on the Arduino/TM32U585 side.

I have used the board for a while, and I have uploaded number of sketches, and I have used the external serial, so I am familiar with it. The problem is that it suddenly stopped accepting new sketches to be uloaded.

Re-check functioning of the Linux MPU by uploading the sketch of Step-5(2) of the link given in post #7.

How to upload?

Every single upload fails. Even empty sketch.

I can’t upload no matter what sketch.

I can turn LED on from Linux with:
echo 1 | tee /sys/class/leds/red:user/brightness # set HIGH/ON
So the Linux core is perfectly fine. It is the Arduino one that is stuck and can’t get into boot mode.

But, as I understand, during upload process, sketch goes to MPU (Fig-1, 2 of #3) and then to Flash/RAM of MCU/STM. So, you can't say that the MCU is bad. It looks like the problem is with uploading!

When you connect UNO Q with PC, do you hear a dong sound and then a COM port is assigned. For me it is: COM7.

Did you see the Successful message during image updating/reinstalling process?

The Reinstall went well.

I see com port on the PC when the Linux boots.

As I said I have tried uploading both from the PC (Arduino IDE, and Visuino), as well as from the App Lab Linux Shell, including calling the Arduino-CLI on the shell to flash a new bootloader with the hope to recover it.

Same for me.

First, my device was disconnecting from usb / wasn't listed in adb devices. Then I flashed OS (to newest Debian). Then my STM sketch Arduino_LED_Matrix/Basic started, but ttyACM0 device started disconnecting. Then I tried to flash sketch once again, and the process stuck on:

xPSR: 0x09000005 pc: 0x0801b846 msp: 0x2002caf0
Error: error running OpenOCD: exit status 1
Info : device idcode = 0x30076482 (STM32U57/U58xx - Rev U : 0x3007)
Info : TZEN = 0 : TrustZone disabled by option bytes
Info : RDP level 0 (0xAA)
Info : flash size = 2048 KiB
Info : flash mode : dual-bank
Info : Padding image section 0 at 0x080f7aac with 4 bytes (bank write end alignment)
Warn : Adding extra erase range, 0x080f7ab0 .. 0x080f7fff
Error: failed erasing sectors 120 to 123
auto erase enabled
Failed uploading: uploading error: exit status 1

I cannot burn bootloader:

arduino@uno-q:/$ arduino-cli burn-bootloader --fqbn arduino:zephyr:unoq --programmer jlink
Open On-Chip Debugger 0.12.0+dev-ge6a2c12f4 (2025-05-22-15:51)
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
debug_level: 2
clock_config
/tmp/remoteocd/sketch.elf-zsk.bin
Info : Linux GPIOD JTAG/SWD bitbang driver (libgpiod v2)
Info : Note: The adapter "linuxgpiod" doesn't support configurable speed
Info : SWD DPIDR 0x0be12477
Info : [stm32u5.ap0] Examination succeed
Info : [stm32u5.cpu] Cortex-M33 r0p4 processor detected
Info : [stm32u5.cpu] target has 8 breakpoints, 4 watchpoints
Info : [stm32u5.cpu] Examination succeed
Info : [stm32u5.ap0] gdb port disabled
Info : [stm32u5.cpu] starting gdb server on 3333
Info : Listening on port 3333 for gdb connections
CPU in Non-Secure state
[stm32u5.cpu] halted due to debug-request, current mode: Handler BusFault
xPSR: 0x09000005 pc: 0x0801b846 msp: 0x2002caf0
Error: error running OpenOCD: exit status 1
Info : device idcode = 0x30076482 (STM32U57/U58xx - Rev U : 0x3007)
Info : TZEN = 0 : TrustZone disabled by option bytes
Info : RDP level 0 (0xAA)
Info : flash size = 2048 KiB
Info : flash mode : dual-bank
Warn : Adding extra erase range, 0x08039740 .. 0x08039fff
Error: failed erasing sectors 0 to 28
auto erase enabled
Error during Upload: Failed to burn bootloader: uploading error: exit status 1

After that, the LED matrix no longer displays anything. There is no more animation during startup. Nothing.

After that, the LED matrix no longer displays anything. There is no more animation during startup. Nothing.

Same here :-(

It seems the Uno Q could break within an hour or two of following the official instructions. I'm disappointed.

My one lasted a bit longer, but I was lucky I guess… :frowning:

Good news. I've got STM32 working again.

flashing the OS

First, flashed the linux OS (skip, if done already):

arduino-flasher-cli flash ./arduino-unoq-debian-image-20251229-457.tar.zst

or

arduino-flasher-cli flash latest

Then power off and power up the board.

burning the bootloader

Second, connect Arduino Q Uno and run adb shell.
Then run sudo systemctl start arduino-burn-bootloader.service.
Check journalctl if the service succeed, you should see something like that:

Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : SWD DPIDR 0x0be12477
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.ap0] Examination succeed
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.cpu] Cortex-M33 r0p4 processor detected
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.cpu] target has 8 breakpoints, 4 watchpoints
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.cpu] Examination succeed
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.ap0] gdb port disabled
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.cpu] starting gdb server on 3333
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : Listening on port 3333 for gdb connections
Feb 23 12:41:43 uno-q arduino-cli[1495]: Error: [stm32u5.cpu] clearing lockup after double fault
Feb 23 12:41:43 uno-q arduino-cli[1495]: CPU in Non-Secure state
Feb 23 12:41:43 uno-q arduino-cli[1495]: [stm32u5.cpu] halted due to debug-request, current mode: Handler HardFault
Feb 23 12:41:43 uno-q arduino-cli[1495]: xPSR: 0xf9000003 pc: 0xeffffffe msp: 0xffffffd8
Feb 23 12:41:43 uno-q arduino-cli[1495]: Error: [stm32u5.cpu] Polling failed, trying to reexamine
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.cpu] Cortex-M33 r0p4 processor detected
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.cpu] target has 8 breakpoints, 4 watchpoints
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : [stm32u5.cpu] Examination succeed
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : device idcode = 0x30076482 (STM32U57/U58xx - Rev U : 0x3007)
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : TZEN = 0 : TrustZone disabled by option bytes
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : RDP level 0 (0xAA)
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : flash size = 2048 KiB
Feb 23 12:41:43 uno-q arduino-cli[1495]: Info : flash mode : dual-bank
Feb 23 12:41:43 uno-q arduino-cli[1495]: Warn : Adding extra erase range, 0x08039740 .. 0x08039fff
Feb 23 12:42:00 uno-q arduino-cli[1495]: shutdown command invoked
Feb 23 12:42:01 uno-q systemd[1]: Finished arduino-burn-bootloader.service - Burn arduino zephyr bootloader on first boot.
░░ Subject: A start job for unit arduino-burn-bootloader.service has finished successfully
░░ Defined-By: systemd
░░ Support: https://www.debian.org/support
░░ 
░░ A start job for unit arduino-burn-bootloader.service has finished successfully.
░░ 
░░ The job identifier is 4262.

does not work?

If that doesn't work, you'll probably need to erase the STM32 first. I did that too, but I can't say if it's mandatory.

Also GPT wrote that /opt/openocd/openocd_gpiod.cfg could have wrong config, because there are srst and trst both bound to gpio 38:

root@uno-q:/# cat /opt/openocd/openocd_gpiod.cfg
adapter driver linuxgpiod

adapter gpio srst 38 -chip 1
adapter gpio swclk 26 -chip 1
adapter gpio swdio 25 -chip 1
adapter gpio trst 38 -chip 1

transport select swd
source [find stm32u5x.cfg]

I've copied the config, removed adapter gpio trst 38 -chip 1 line from /tmp/openocd_gpiod.cfg (a copy), and erased STM32 by using modified config:

/opt/openocd/bin/openocd -s /opt/openocd -s /opt/openocd/share/openocd/scripts -f /tmp/openocd_gpiod_notrst.cfg -c "init; reset halt; flash erase_address 0x08000000 0x200000; reset; exit"

Then I've burned the bootloader.

But as I said - I'm not sure if erasing is necessary.