What is the expected behavior of UNO Q when “Blink LED” and “Run” buttons in App Lab are clicked?

I have partially tested the STM MCU of UNO Q board by uploading the blink sketch from IDE 2.3.7 examples. After that I have tried to blink the same led (led-3) from App Lab 0.3.2 by clicking on the Blink LED and Run buttons; but, the led-3 does not blink; instead, the following error message has appeared. Would appreciate to receive guidance to resolve te issue.

Starting app "Blink LED"
Sketch profile configured: Name="default", Port=""
unexpected end of JSON input

You should see something like this, showing the build log:

Starting app "Blink LED"
Sketch profile configured: Name="default", Port=""
The library ArxContainer has been automatically added from sketch project.
The library ArxTypeTraits has been automatically added from sketch project.
The library DebugLog has been automatically added from sketch project.
The library MsgPack has been automatically added from sketch project.
Sketch uses 19316 bytes (0%) of program storage space. Maximum is 1966080 bytes.
Global variables use 4676 bytes (0%) of dynamic memory, leaving 518948 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
… /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: Thread
xPSR: 0x41000000 pc: 0x08019392 psp: 0x2002ccf8
[stm32u5.cpu] halted due to breakpoint, current mode: Thread
xPSR: 0x09000000 pc: 0x08006374 psp: 0x20034a70
shutdown command invoked
20035490
python provisioning
python downloading
Container local-share-arduino-app-cli-examples-blink-main-1  Created
Container local-share-arduino-app-cli-examples-blink-main-1  Starting
Container local-share-arduino-app-cli-examples-blink-main-1  Started

The above text will then go green on screen, and the LED should start blinking.

Sounds like something needs to be updated maybe..

did you see this post??

I’ve been running mine completely in sbc mode and haven’t been using AppLab all that much, less so now that I’ve started using cli..

I’m hoping it’s just a simple update for you..

I did do a bunch of updates first time I logged into it..

let everyone know how you are running the board SBC or connected USB and running AppLab on your PC as it might actually matter..

good luck.. ~q

1 Like

That does not appear.

I visited that link; but, I could not use the information.

Problem is Solved!

Q1: What is the expected output when "Blink LED"/"Run" buttons of App Lab 0.3.2 are clicked?
A1: The onboard led-3 will be continuously blinking at 2 sec interval.

Q2: Was that happening in my UNO Q board?
A2: No.

Q3: What have I done to make it work?
A4: I have carried out the following steps from this Arduino Documents https://docs.arduino.cc/tutorials/uno-q/update-image/) to update the Debian Linux Operating System in my UNO Q board :

1. I have downloaded Arduino Flasher CLI software and have unziped it under the same folder where the zip file is saved.

2. I have unplugged the board from PC.

3. I have shorted the following two-pins (red wire, Fig-1) to bring the board into OS updating mode.


Figure-1:
4. I have connected back the UNO Q board with PC.

5. From the Start icon of the PC, I have executed cmd.exe to get text screen.

6. I have changed the directory to:
C:\arduino-flasher-cli-0.4.0-windows-amd64>

7. From the command prompt of Step-6, I have executed the following command:
arduino-flasher-cli

8. After a while, the prompt has come back and then I have executed the folloiwng command from the prompt:
arduino-flasher-cli flash latest

9. That statred the downloading of the Debian image of size 2.4 GB.
10. I have waited until the image is completely downloaded and then have entered yes in response to queries.

11. Ulltimately, the image was flashed into UNO Q board with the following message:
The board has been successfully flashed. You can now power-cycle the board (unplug and re-plug). Remember to remove the jumper.

12. I have taken out the board from PC, removed the jumper, and connected back the board with PC.

13. I have launced the App Lab and then have clicked on Blink LED icon and then on Run button. After a while, the led-3 has started blinking.

1 Like

It is very important to verify that the Blink LED command of App Lab works, in order to understand the following issues:

1. How the corresponding logic of the “Blink LED” command (originating from App Lab, implemented in Python at the application level) is transmitted to the Linux MPU, and how the LED ON/OFF states along with the blinking timing parameters are then communicated to the STM MCU, to which LED-3 is physically connected.

2. Since the blinking LED sketch is not pre-loaded (by me) into the STM MCU before clicking the Blink LED command in App Lab, from where does the required code originate, and how is it made available in the flash memory of the STM MCU?

3. In the App Lab's Blink LED application, the following Arduino Sketch is avialable. Is it loaded into STM MCU before the actual command goes to Linux MPU? If yes, then how is the single USB-A to USB-C cable shared by both Linux MPU (to receive phthon command) and STM MCU (to receive Arduino sketch)?

#include "Arduino_RouterBridge.h"

void setup() 
{
    pinMode(LED_BUILTIN, OUTPUT);

    Bridge.begin();
    Bridge.provide("set_led_state", set_led_state);
}

void loop() 
{

}

void set_led_state(bool state) 
{
    // LOW state means LED is ON
    digitalWrite(LED_BUILTIN, state ? LOW : HIGH);
}
1 Like

did you not have to click on the Run button top left corner to load and execute the sketch??

~q

O yes -- the Run button has to be clicked and I did. Thank you.

1 Like

Here you are using the Router bridge..

One of the Uarts of the MCU is connected to the MPU, bridge software is running on the MPU that routes from MCU-MPU then out to you..

Read about it in the user manual but again have not used it so much..

~q

Do you mean that the following Arduino sketch (which I have taken from the Blink LED application of App Lab) is loaded into the STM MCU before the blinking command is received from the Linux MPU over the router bridge (UART / I2C / SPI / CAN)? (I don't inderstand how this sketch keeps blinking the led-3 when the loop() functon is empty!)

#include "Arduino_RouterBridge.h"

void setup() 
{
    pinMode(LED_BUILTIN, OUTPUT);

    Bridge.begin();
    Bridge.provide("set_led_state", set_led_state);
}

void loop() 
{

}

void set_led_state(bool state) 
{
    // LOW state means LED is ON
    digitalWrite(LED_BUILTIN, state ? LOW : HIGH);
}

If I understand you correctly, then yes..

this sketch when loaded into the MCU does not actually do the blinking, the sketch has asked the Bridge to provide it..

There should also be a python sketch that goes along with it that run MPU side and tells the MCU when to blink..

~q

You are right. This is that python codes (taken from Blink LED application of App Lab) that goes to Linux MPU over the USB-A/USB-C cable.

from arduino.app_utils import *
import time

led_state = False

def loop():
    global led_state
    time.sleep(1)    
    led_state = not led_state
    Bridge.call("set_led_state", led_state)

App.run(user_loop=loop)
1 Like

I have now started to believe that, near the USB-C connector of UNO Q board, there must be an electronic switching mechanism that routes the USB-A connection either to the STM MCU during Arduino sketch uploading or to the Linux MPU during Python sketch uploading (Fig-1, conceptual).


Figure-1:

1 Like

I don’t think so..

Have you run your Uno Q in SBC mode yet..

I have a monitor, keyboard, mouse hooked up to that port, more switches??

It’s probably the RPC software I dropped a link to in post #11..

~q

Single USB-A to USB-C of PC cable must furnish three tasks:
1. Upload Arduino skecth into STM.
2. Upload Python script into MPU.
3. Keep interactive communicatio with MPU.

When communicating with the MCU, electrical isolation from the MPU should be maintained using a tri-state–based switching mechanism which I have conceptually termed as an electronic switching mechanism.

A natural question then arises as to how a 1-to-11 dongle is able to provide multiple independent data-channel services. It's behavior is conceptually similar to a 74LS138 decoder, which selects one SPI device while de-selecting the remaining seven SPI devices.

In practice, the RPC (Remote Procedure Call) software (the Arduino_RouterBridge.h) layer ultimately controls the underlying hardware resources which is here the UART2.

Planning to do it soon!

@qubits-us
Is it MPU or MCU with which the onboard 12x8 led matrix display physically connected?

The led matrix is connected to the MCU.

~q

Thank you!

I was confused from the diagram of Fig-1 (taken from App Lab examples) if the led matrix display unit belongs to MPU.


Figue-1:

Page 13 of the datasheet has a nice block diagram..

~q

1 Like

I have got it. Thnak you!

From the diagram of #20, t appears that there are IO lines attached with the MPU. Are these lines available to the users via the edge connectors located underneath the board?