Board Support Package For Arduino Uno Q

Introduction

uno_r4_minima.jpg

 

uno_r4_wifi.jpg

 

This board support package (BSP) supports both MCU and MPU of Arduino Uno Q SBC board as two separate targets. The MCU target is listed as ‘ArduinoUnoQ_MCU’ under target architecture ‘32bit/64bit uC (FPU)’ and the MPU target is listed as ‘ArduinoUnoQ_MPU’ under target architecture ‘Embedded OS‘. Both shall be modelled, build and deployed separately.

 

The MCU part of BSP is based on modified version of STM32duino core (and does not use Arduino Core over Zephyr OS) and uses ARM compiler tool chain for generating required binaries. The MPU part of BSP support Debian Linux OS that is running on the MPU with GCC ARM ARCH64 native compiler tool chain used for generating 64-bit binaries. The MPU BSP supports CASP simulation panel (SimPanel) and uses CASP’s remote build capabilities to build and deploy CASP models on the target hardware

 

The BSP along with supported 3rd party tools are designed to build and deploy CASP models on Arduino Uno Q in remote headless mode through WiFi.

Preparing the Board

To prepare Arduino Uno Q for remote headless mode, minimum features such as remote desktop, remote file sharing and programming MPU and MCU remotely from the host computer shall be enabled. Please follow the step by step procedure mentioned in the ..\mpu\bin\uno_q_aarch64\readme_setup.txt file to configure the board for remote headless mode. The readme file briefly contains steps to

·       Install and configure 3rd party software for remote desktop, remote file sharing and SSH features on Arduino Uno Q.

·       Install GCC tool chain for CASP remote build compilation.

·       Install CASP remote build (RBuild) tool chain on Arduino Uno Q from host computer.

·       Disable Arduino services related to MPU-MCU serial bridge

To factory reset the board, please follow instructions in the ..\mpu\bin\uno_q_aarch64\readme_factory_reset.txt.

Programming Arduino Uno Q MCU (from Windows PC)

·       Arduino Uno Q uses WinUSB driver which comes by default with Windows OS, so no need to install drivers separately.

·       Run CASP and select the target as ‘ArduinoUnoQ_MCU’. Create your desired model using CASP blocks.

·       CASP can upload the generated binary file to Arduino Uno Q MCU either through USB via ADB or through WiFi via SSH.

·       To upload the model through USB port, connect the board to the host computer. After the board OS has booted (indicated by steady blue light) select ‘Programmer0’ in CASP on the host computer and click on ‘Run’ button to build the model and program the board through USB port.

 ·      To upload the model through WiFi, open the file ‘flags_prog1.txt’ from ‘hardware\arduino_sbc\mcu\uno_q\casp’ directory in a text editor such as Notepad. Replace ‘abcdef’ with your Arduino Uno Q login password and save the file. From CASP main tool bar click on ‘Setup Simulation’, select ‘Target Programmer’ as ‘Programmer1’ and set ‘Target Programmer Port’ to the board’s IP address. Click on ‘Run’ button to build the model and program the board through WiFi.

·       The uploaded binary will overwrite the existing Arduino Zephyr core software present on the MCU. To revert back to existing Arduino Zephyr core, connect the board to the host computer via USB, wait till the board boots up. Set the device serial number (not the serial port) in place of ‘123456789’ in the batch file ‘flash_zephyr_adb.bat’ located at ‘hardware\arduino_sbc\mcu\uno_q\arduino_flash’ and double click on the file to program the board with the original Arduino Zephyr core. The device serial number can be obtained from the device parent property in Device Manager (in Windows OS).

Programming Arduino Uno Q MPU (from Windows PC)

·      Ensure host computer and the target board are connected through LAN. Try pinging the board from the host PC.

·      On Arduino Uno Q board, open the ‘casp_rbuild’ folder mentioned in the previous sections. Open terminal in the folder and type ‘./casp_rbuild.sh’ to run CASP remote build program.

·      On the host PC run CASP and load the project. From ‘Setup Simulation’ window select the Target Hardware as ‘ArduinoUnoQ_MPU‘. From the ‘Target HW -> Remote Build & RTV’ tab set ‘Remote Target IP Address’ as the board’s IP address. Save and close the window. Click on ‘Run’ button to build and deploy the model on the target board.

Usage Notes

·       CASP BSP for MCU support PWM on all the pins from D2 to D13 except on pin D4.

·       D4 pin (PA12) cannot be used for PWM but can be used for Servo as the internal timer can only be triggered externally.

·       SPI1 is available as SPI_1 within CASP software (and not as a regular SPI1 due to internal issues).

Board Configuration

·      General Configuration

Configuration Parameter

Arduino Uno Q MCU

Arduino Uno Q MPU

Board Title

ArduinoUnoQ_MCU

ArduinoUnoQ_MPU

Tool Chain Type

Local Build

Remote Build & Deploy

Board Preprocessor Symbol

_BUILD_BRD_ARD_UNO_Q_MCU

_BUILD_BRD_ARD_UNO_Q_MPU

Platform Preprocessor Symbol

_BUILD_PLT_ARD32_FPU

_BUILD_PLT_ARM64

Compiler Preprocessor Symbol

_BUILD_CMP_ARM_GCC

_BUILD_CMP_ARM_LINUX_GCC

C++11 Standard Support

No

Yes

File System Support

No

Yes

OpenMP/OpenCL/CUDA Support

No/No/No

No/No/No

Simulation Panel Support

No

Yes

 

·      Hardware Configuration

Configuration Parameter

Arduino Uno Q MCU

Arduino Uno Q MPU

Number of CPU cores

1

4

Dynamic Memory Support

Yes

Yes

Prefer Fixed/Floating Point

Floating Point

Floating Point

DI/DO Pins

0[PB7], 1[PB6], 2[PB3], 3[PB0], 4[PA12], 5[PA11], 6[PB1], 7[PB2], 8[PB4], 9[PB8], 10[PB9], 11[PB15], 12[PB14], 13[PB13], A0(DAC0)[PA4], A1(DAC1)[PA5], A2[PA6], A3[PA7], A4[PC1], A5[PC0], SDA[PB11], SCL[PB10], LED3_R[PH10], LED3_G[PH11], LED3_B[PH12], LED4_R[PH13], LED4_G[PH14], LED4_B[PH15]

-

ADC Default Resolution

12

-

ADC Pins

A0(DAC0)[PA4], A1(DAC1)[PA5], A2[PA6], A3[PA7], A4[PC1], A5[PC0]

-

PWM Default Resolution

12

-

PWM Pins

2[PB3], 3[PB0], 4[PA12], 5[PA11], 6[PB1], 7[PB2], 8[PB4], 9[PB8], 10[PB9], 11[PB15], 12[PB14], 13[PB13], LED3_R[PH10], LED3_G[PH11], LED3_B[PH12], LED4_R[PH13], LED4_G[PH14], LED4_B[PH15], SDA[PB11], SCL[PB10]

-

DAC Default Resolution

12 (should be same as PWM)

-

DAC Pins

A0(DAC0)[PA4], A1(DAC1)[PA5]

-

UART0 Pins (Serial)

Pin 0 (RX) and Pin 1 (TX)

Serial port ‘ttyHS1’ is available to communicate with MCU .

UART1 Pins (Serial1)

For MPU communication

-

UART2 Pins

-

-

UART3 Pins

-

-

SPI Pins

10(SS), 11(MOSI), 12(MISO), !3(CLK)

-

SPI_1 Pins

Available on board’s SPI2 pin header

-

I2C Pins

SDA (A4), SCL (A5)

-

I2C1 Pins

SDA1 (D20), SCL1 (D21)

-

I2C2 Pins (QWIIC)

SDA2 QWIIC (pin 3), SCL2 QWIIC (pin 4)

-

WiFi

-

WiFi supported with ‘Simulation Panel IP’ block

Programmer

·        CASP supports Programmer0 for uploading generated binary file to the MCU via USB and Programmer1 for uploading generated binary file to the MCU via WiFi.

Debugging

Debugging is supported over ‘Serial1’ that is accessible from MPU’s serial port ‘ttyHS1’..

Known Issues & Limitations

-