Seeeduino Lotus Cortex-M0+

Overview

The Seeeduino Lotus Cortex-M0+ is an Arduino form factor development board based on an Atmel SAMD21 ARM with onboard LEDs, USB port, and range of 14 digital I/O (10 of which support PWM) and 6 analog I/O broken out onto Arduino UNO R3 header and multiple Grove connectors.

Seeeduino Lotus Cortex-M0+

Hardware

  • ATSAMD21G18A [4] ARM Cortex-M0+ processor at 48 MHz

  • 32.768 kHz crystal oscillator

  • 256 KiB flash memory and 32 KiB of RAM

  • 3 user LEDs (blue/Rx/Tx)

  • One reset button

  • Native USB port

  • 12 Grove connectors

  • Arduino UNO R3 header

  • Arduino ICSP header

  • MP2617B [5], switching battery charger (max. 2A)

  • JST2.0 Li-Po battery connector

Supported Features

The seeeduino_lotus board configuration supports the following hardware features:

Interface

Controller

Driver/Component

ADC

on-chip

Analogue to digital converter

DAC

on-chip

Digital to analogue converter

DMA

on-chip

Direct memory access

Flash

on-chip

Can be used with LittleFS to store files

GPIO

on-chip

I/O ports

HWINFO

on-chip

Hardware info

I2C

on-chip

Inter-Integrated Circuit

NVIC

on-chip

nested vector interrupt controller

PWM

on-chip

Pulse Width Modulation

SPI

on-chip

Serial Peripheral Interface ports

SYSTICK

on-chip

systick

USART

on-chip

Serial ports

USB

on-chip

USB device

WDT

on-chip

Watchdog

Other hardware features are not currently supported by Zephyr.

The default configuration can be found in the Kconfig file boards/arm/seeeduino_lotus/seeeduino_lotus_defconfig.

Board Revisions

The seeeduino_lotus board can be configured for the following revisions. These are not really specific hardware revisions, rather than specific configurations for different use cases.

seeeduino_lotus@uartcons

Use the serial port SERCOM2 as Zephyr console and for the shell.

seeeduino_lotus@usbcons

Use the USB device port with CDC-ACM as Zephyr console and for the shell.

Connections and IOs

The Seeeduino Lotus Cortex-M0+ wiki [1] has detailed information about the board including pinouts [2] and the schematic [3].

Laced Grove Signal Interface

In addition to the Arduino UNO R3 header, there are also 12 Grove connectors. These are provided by a specific interface for general signal mapping, the Laced Grove Signal Interface.

Following mappings are well known:

  • grove_gpios: GPIO mapping

  • grove_pwms: PWM mapping

This is the GPIO signal line mapping from the Arduino Uno R3 [11] header bindet with arduino-header-r3 to the set of Grove connectors provided as Laced Grove Signal Interface.

phandle index to shield –>

Signal : Meaning

seeeduino_lotus

<&grove_gpios 0 …>

D0: UART-RX (SERCOM5)

<&grove_uart_header 0 …>

<&grove_gpios 1 …>

D1: UART-TX (SERCOM5)

<&grove_uart_header 1 …>

<&grove_gpios 2 …>

D2

<&grove_d2_header 0 …>
<&arduino_header 8 …>

<&grove_gpios 3 …>

D3

<&grove_d3_header 0 …>,
<&grove_d2_header 1 …>
<&arduino_header 9 …>

<&grove_gpios 4 …>

D4

<&grove_d4_header 0 …>,
<&grove_d3_header 1 …>
<&arduino_header 10 …>

<&grove_gpios 5 …>

D5

<&grove_d5_header 0 …>,
<&grove_d4_header 1 …>
<&arduino_header 11 …>

<&grove_gpios 6 …>

D6

<&grove_d6_header 0 …>,
<&grove_d5_header 1 …>
<&arduino_header 12 …>

<&grove_gpios 7 …>

D7

<&grove_d7_header 0 …>,
<&grove_d6_header 1 …>
<&arduino_header 13 …>

<&grove_gpios 8 …>

D8

<&grove_d7_header 1 …>,
<&arduino_header 14 …>

<&grove_gpios 9 …>

D9

not wired

<&grove_gpios 10 …>

D10: SPI-CS

not wired

<&grove_gpios 11 …>

D11: SPI-MOSI

not wired

<&grove_gpios 12 …>

D12: SPI-MISO

not wired

<&grove_gpios 13 …>

D13: SPI-CLK

not wired

<&grove_gpios 14 …>

D14: A0 as GPIO

<&grove_a0_header 0 …>
<&arduino_header 0 …>

<&grove_gpios 15 …>

D15: A1 as GPIO

<&grove_a1_header 0 …>,
<&grove_a0_header 1 …>
<&arduino_header 1 …>

<&grove_gpios 16 …>

D16: A2 as GPIO

<&grove_a2_header 0 …>,
<&grove_a1_header 1 …>
<&arduino_header 2 …>

<&grove_gpios 17 …>

D17: A3 as GPIO

<&grove_a2_header 1 …>,
<&arduino_header 3 …>

<&grove_gpios 18 …>

D18: I2C-SDA

<&grove_i2c_header 1 …>,
<&arduino_header 20 …>

<&grove_gpios 19 …>

D19: I2C-SCL

<&grove_i2c_header 0 …>
<&arduino_header 21 …>

<&grove_gpios 20 …>

D20: ADC6 as GPIO

not wired

<&grove_gpios 21 …>

<&grove_gpios 22 …>

<&grove_gpios 23 …>

<&grove_gpios 24 …>

<&grove_gpios 25 …>

<&grove_gpios 26 …>

<&grove_gpios 27 …>

<&grove_gpios 28 …>

<&grove_gpios 29 …>

<&grove_gpios 30 …>

<&grove_gpios 31 …>

System Clock

The SAMD21 MCU is configured to use the 32 kHz external crystal with the on-chip PLL generating the 48 MHz system clock. The internal APB and GCLK unit are set up in the same way as the upstream Arduino libraries.

GPIO (PWM) Ports

The SAMD21 MCU has 2 GPIO ports, 3 PWM able Timer/Capture-Counter (TCC) and 2 simple Timer/Counter (TC). On the Lotus Cortex-M0+, TCC2 channel 1 is available on first user LED (blue), all other user LEDs can be controlled as GPIO. Only if CONFIG_PWM_SAM0_TCC is enabled then the first user LED (blue) is driven by TCC2 instead of by GPIO. All channels of TCC0 are available on the Arduino UNO R3 header and the Grove connectors (see above, Laced Grove Signal Interface).

ADC/DAC Ports

The SAMD21 MCU has 1 DAC and 1 ADC. On the Lotus Cortex-M0+, the DAC voltage output (VOUT) is available on A0 of the Arduino UNO R3 header. The ADC channels 2-5 and 10 are available on A1-A5 of the Arduino UNO R3 header.

The external voltage reference VREFA can be used optional for the DAC and ADC on same time and is available on AREF of the Arduino UNO R3 header.

SPI Port

The SAMD21 MCU has 6 SERCOM based SPIs. On the Lotus Cortex-M0+, SERCOM1 can be put into SPI mode and used to connect to devices over D11 (MOSI), D12 (MISO), and D13 (SCK) of the Arduino UNO R3 header.

I2C Port

The SAMD21 MCU has 6 SERCOM based I2Cs. On the Lotus Cortex-M0+, SERCOM3 is available only on D18 (SDA) and D19 (SCL) of the Arduino UNO R3 header.

Serial Port

The SAMD21 MCU has 6 SERCOM based USARTs. On the Lotus Cortex-M0+, SERCOM2 is available on D0 (RX) and D1 (TX) of the Arduino UNO R3 header and is the Zephyr console. This is captured by the standard board revision uartcons. SERCOM5 is available on pin 1 (RX) and pin 2 (TX) of the Grove UART connector and is an optional second serial port for applications.

USB Device Port

The SAMD21 MCU has a USB device port that can be used to communicate with a host PC. See the USB device support samples sample applications for more, such as the USB CDC ACM Sample Application sample which sets up a virtual serial port that echos characters back to the host PC. As an alternative to the default Zephyr console on serial port the special board revision usbcons can be used to enable USB device stack CDC ACM support and switch the console to USB:

USB device idVendor=2886, idProduct=8026, bcdDevice= 3.03
USB device strings: Mfr=1, Product=2, SerialNumber=3
Product: Seeeduino_lotus
Manufacturer: Seeed LLC
SerialNumber: 9973734CA4207846

Programming and Debugging

The Lotus Cortex-M0+ ships the BOSSA compatible UF2 bootloader [6] also known as Arduino Zero Bootloader [7], a modern SAM-BA [9] (Boot Assistant) replacement. The bootloader can be entered by pressing the RST button twice:

USB device idVendor=2886, idProduct=0026, bcdDevice= 2.00
USB device strings: Mfr=1, Product=2, SerialNumber=0
Product: Seeeduino_lotus
Manufacturer: Arduino LLC

Additionally, if CONFIG_USB_CDC_ACM is enabled then the bootloader will be entered automatically when you run west flash.

Seeeduino Lotus Cortex-M0+ SWD Programming Port

Tip

When ever you need to restore this original bootloader you should read and following the directions in Flashing the Arduino Bootloader using DAP Link [8]. There is also a backup copy of the original bootloader together with a ready to use Segger JFlash control file inside the Bridel project:

There is also a SWD header (J10, not populated) on board which have to be used with tools like Segger J-Link for programming for bootloader restore or direct programming and debugging.

Flashing

  1. Build the Zephyr kernel and the Hello World sample application:

    west build -b seeeduino_lotus zephyr/samples/hello_world
    
  2. Connect the Lotus Cortex-M0+ to your host computer using USB.

  3. Connect a 3.3 V USB to serial adapter to the board and to the host. See the Serial Port section above for the board’s pin connections.

  4. Run your favorite terminal program to listen for output. Under Linux the terminal should be /dev/ttyUSB0. For example:

    minicom -D /dev/ttyUSB0 -o
    

    The -o option tells minicom not to send the modem initialization string. Connection should be configured as follows:

    • Speed: 115200

    • Data: 8 bits

    • Parity: None

    • Stop bits: 1

  5. Pressing the RST button twice quickly to enter bootloader mode.

  6. Flash the image:

    west build -b seeeduino_lotus zephyr/samples/hello_world
    west flash
    

    You should see “Hello World! seeeduino_lotus” in your terminal.

Debugging

Debugging is only possible over SWD!

  1. Do the for the debug session necessary steps as before except enter the bootloader mode and the flashing.

  2. Connect the Segger J-Link to the SWD header (J10).

  3. Flash the image and attach a debugger to your board:

    west build -b seeeduino_lotus zephyr/samples/hello_world -- -DBOARD_FLASH_RUNNER=openocd
    west debug
    

    You should ends up in a debug console (e.g. a GDB session).

More Samples

LED Blinky

west build -b seeeduino_lotus zephyr/samples/basic/blinky
west flash

LED Fade

west build -b seeeduino_lotus zephyr/samples/basic/fade_led
west flash

Basic Threads

west build -b seeeduino_lotus zephyr/samples/basic/threads
west flash

Hello Shell with USB-CDC/ACM Console

west build -b seeeduino_lotus@usbcons bridle/samples/helloshell
west flash

Simple test execution on target

uart:~$ hello -h
hello - say hello
uart:~$ hello
Hello from shell.

uart:~$ hwinfo devid
Length: 16
ID: 0xefa3ee60dfcb11ed9973734ca4207846

uart:~$ kernel version
Zephyr version 3.3.0

uart:~$ bridle version
Bridle version 3.3.1

uart:~$ bridle version long
Bridle version 3.3.1.0

uart:~$ bridle info
Zephyr: 3.3.0
Bridle: 3.3.1

uart:~$ device list
devices:
- eic@40001800 (READY)
- gpio@41004480 (READY)
- gpio@41004400 (READY)
- cdc-acm-uart-0 (READY)
- sercom@42001c00 (READY)
- sercom@42001000 (READY)
- adc@42004000 (READY)
- dac@42004800 (READY)
- sercom@42001400 (READY)
- tcc@42002800 (READY)
- nvmctrl@41004000 (READY)

uart:~$ history
[  0] history
[  1] device list
[  2] bridle info
[  3] bridle version long
[  4] bridle version
[  5] kernel version
[  6] hwinfo devid
[  7] hello
[  8] hello -h

References