Common problems¶
USB not detected, or can't reconnect¶
Due to the architecture of the Arduino Uno Q, the USB remains unpowered if the board is supplied through the VIN pins (which are the ones we use in our PLC). Without the extra scripts in the GNU/Linux system, two symptoms can arise:
- The USB port remains unpowered after boot. So, when you connect the PLC, the PC never detects the device, until a reboot is issued.
- Disconnecting the USB after a first successful connection from the host prevents any subsequent connection. Unless, the Ardbox Q is either rebooted, or the ADB service is restarted via SSH.
You should encounter these problems whenever you updated the GNU/Linux image with the Arduino flashing tool. This tool wipes all the contents of the eMMC memory, including our custom configurations that enables USB usage at all times.
To re-apply the fixes for this problem, please boot the Ardbox Q PLC through the
USB (without the 12-24 Vdc supply), connect through ADB with the adb shell
command, and set-up the scripts located in the custom configurations of the
Qualcomm Dragonwing™.
The STM32 sketch doesn't compile/start¶
There are a couple of reasons why this error could occur:
-
If this is the first time you have installed the Industrial Shields Zephyr boards, or if you have installed an update, you must update the Uno Q bootloader. If you do not do this, you may experience serious boot issues, such as a program that previously worked will not even start.
-
If you try to use
_DEFINEmacros of Zephyr OS (such asK_THREAD_STACK_DEFINE(my_stack_area, MY_STACK_SIZE)), you will either run into a region overlapped compilation error, or an invisible runtime error that doesn't let your sketch start. Because these macros use build-time magic from<zephyr/sys/iterable_sections.h>(which isn't available after the main Zephyr binary is built), they can't be easily supported in the Zephyr way. You can check more details at the upstream issue #243. -
If the solutions above didn't fix your problem, it's possible that your program contains UB (undefined behaviour), like de-referencing a null/invalid pointer, buffer overflows, or some type of coding error...
I can't use Q0.X/A0.X as digital/PWM outputs¶
If you need to use an output pin as a digital output only (i.e. HIGH or LOW),
you must call pinMode(Q0_X, OUTPUT) before any digitalWrite. However, if you
need to use the output as a PWM or analog output, do not call the pinMode
function. Otherwise, the pin will lose its capabilities until a reset is issued.
I can't use I0.X as digital/analog inputs¶
If you need to use an input pin as a digital input only you must call
pinMode(I0_X, INPUT) before any digitalRead. However, if you need to use it
as an analog input, do not call the pinMode function. Otherwise, the pin will
lose its capabilities until a reset is issued.
I can't print anything from my sketch¶
Because of the Uno Q’s architecture, using Serial does not display data in the
serial monitor as you might expect. To make debugging just as easy as on other
Arduino boards, a Monitor object is provided, which you can use to print
debugging messages, sensor readings, or any other information directly to the
serial monitor:
// Support for Monitor (Ardbox Q)
#include <Arduino_RouterBridge.h>
void setup() {
// Initialize the Monitor
Monitor.begin();
}
void loop() {
// Transmit the string "Hello UNO Q" followed by a newline character
Monitor.println("Hello UNO Q");
delay(1000);
}
The LED of I0.8 or I0.9 stays off (Ardbox Q AD)¶
On the Ardbox Q AD, the LEDs of the inputs I0.8 and I0.9 light up with signals of about 15 V or higher (24 V signals). With 12 V signals or 0-10 V analog signals the LED stays off, even though the input is read correctly. This is normal operation.