1.. zephyr:board:: swan_r5 2 3Overview 4******** 5 6Swan is a low-cost embeddable STM32L4-based microcontroller designed to 7accelerate the development and deployment of battery-powered solutions. 8It is especially useful for applications requiring large memory or a high 9degree of I/O expandability at an affordable cost, such as edge inferencing 10and remote monitoring. 11 12Uniquely for Feather-compatible boards, Swan is designed to satisfy 13developers' needs that span from early prototyping through high-volume 14deployment. Developers may begin to use Swan in conjunction with 15Adafruit's myriad sensors and FeatherWing-compatible carriers. 16Due to its novel design, for high-volume deployment the low-cost Swan 17can also be soldered directly to a parent PCB integrating those sensors, 18utilizing the full range of Swan's I/O capabilities. 19 20The board has three independent power options---USB, Battery, or Line 21power---and provides a software-switchable 2 Amp regulator for powering external 22sensors. When operating in its low-power operating mode, the entire Swan 23board commonly draws only about 8uA while retaining all of its memory, 24making it quite suitable for battery-powered devices. 25 26The Swan board features an ARM Cortex-M4 based STM32L4R5ZI MCU 27with a wide range of connectivity support and configurations. Here are 28some highlights of the board: 29 30- STM32 microcontroller in WLCSP144 package 31- 2MB of flash and 640KB of RAM 32- Two types of extension resources: 33 34 - Adafruit Feather-compatible connectivity 35 - Access to 36 additional STM32 pins (beyond the Feather pins) via 0.05" castellated edge headers 36 37- On-board ST-LINKV3 debugger/programmer with SWD connector 38 39- One Red User LED (LD1) 40- Two push-buttons: USER and RESET 41 42- Castellated-edge access to 55 GPIO ports including: 43 44 - 8 analog 45 - 16 digital 46 - 4x I2C, 3x SPI 47 - USB OTG full speed 48 - 1x 14-channel DMA 49 - tRNG 50 - 12-bit ADC, 2 x 12-bit DAC 51 - low-power RTC, and CRC calculation peripherals 52 53More information about the board can be found at the `Swan Product Page`_. 54 55Hardware 56******** 57 58The STM32L4R5ZI SoC provides the following hardware IPs: 59 60- Ultra-low-power with FlexPowerControl (down to 130 nA Standby mode 61 and 100 uA/MHz run mode) 62- Core: ARM |reg| 32-bit Cortex |reg|-M4 CPU with FPU, adaptive 63 real-time accelerator (ART Accelerator) allowing 0-wait-state 64 execution from Flash memory, frequency up to 120 MHz, MPU, 150 65 DMIPS/1.25 DMIPS/MHz (Dhrystone 2.1), and DSP instructions 66 67- Memories 68 69 - 2-Mbyte Flash, 2 banks read-while-write, proprietary code readout protection 70 - 640 Kbytes of SRAM including 64 Kbytes with hardware parity check 71 - External memory interface for static memories supporting SRAM, 72 PSRAM, NOR, NAND and FRAM memories 73 - 2 x OctoSPI memory interface 74 75- True random number generator 76- CRC calculation unit, 96-bit unique ID 77- Development support: serial wire debug (SWD), JTAG, Embedded Trace 78 Macrocell (ETM) 79 80More information about Swan can be found here: 81 82- `Swan Quickstart Guide`_ 83- `Swan Datasheet`_ 84 85Supported Features 86================== 87 88The Zephyr Swan board configuration supports the following 89hardware features: 90 91+-----------+------------+-------------------------------------+ 92| Interface | Controller | Driver/Component | 93+===========+============+=====================================+ 94| NVIC | on-chip | nested vector interrupt controller | 95+-----------+------------+-------------------------------------+ 96| UART | on-chip | serial port-polling; | 97| | | serial port-interrupt | 98+-----------+------------+-------------------------------------+ 99| PINMUX | on-chip | pinmux | 100+-----------+------------+-------------------------------------+ 101| GPIO | on-chip | gpio | 102+-----------+------------+-------------------------------------+ 103| I2C | on-chip | i2c | 104+-----------+------------+-------------------------------------+ 105| PWM | on-chip | pwm | 106+-----------+------------+-------------------------------------+ 107| SPI | on-chip | spi | 108+-----------+------------+-------------------------------------+ 109| USB | on-chip | usb | 110+-----------+------------+-------------------------------------+ 111| ADC | on-chip | adc | 112+-----------+------------+-------------------------------------+ 113 114Other hardware features are not yet supported on this Zephyr port. 115 116The default configuration can be found in the defconfig file: 117:zephyr_file:`boards/blues/swan_r5/swan_r5_defconfig` 118 119 120Connections and IOs 121=================== 122 123Default Zephyr Peripheral Mapping: 124---------------------------------- 125 126.. rst-class:: rst-columns 127 128- A0 : PA3 129- A1 : PA1 130- A2 : PC3 131- A3 : PC1 132- A4 : PC4 133- A5 : PC5 134- D4 : PE3 135- D5 : PE11 136- D6 : PE9 137- D9 : PD15 138- D10 : PA4 139- D11 : PA7 140- D12 : PA6 141- D13 : PA5 142- UART_1_TX : PA9 143- UART_1_RX : PA10 144- UART_2_TX : PA2 145- UART_2_RX : PD6 146- UART_3_TX : PB10 147- UART_3_RX : PB11 148- LPUART_TX : PG7 149- LPUART_RX : PG8 150- I2C_1_SCL : PB6 151- I2C_1_SDA : PB7 152- I2C_2_SCL : PF1 153- I2C_2_SDA : PF0 154- I2C_3_SCL : PC0 155- I2C_3_SDA : PC9 156- SPI_1_NSS : PA4 157- SPI_1_SCK : PA5 158- SPI_1_MISO : PA6 159- SPI_1_MOSI : PA7 160- SPI_2_NSS : PD0 161- SPI_2_SCK : PD1 162- SPI_2_MISO : PB14 163- SPI_2_MOSI : PB15 164- SPI_3_NSS : PA15 165- SPI_3_SCK : PC10 166- SPI_3_MISO : PC11 167- SPI_3_MOSI : PC12 168- PWM_2_CH1 : PA0 169- USER_PB : PC13 170- LD1 : PE2 171- USB DM : PA11 172- USB DP : PA12 173- ADC1 : PA1 174 175System Clock 176------------ 177 178Swan System Clock could be driven by internal or external 179oscillator, as well as main PLL clock. By default, the System clock is 180driven by the PLL clock at 80MHz, driven by a 16MHz high speed 181internal oscillator. 182 183Serial Port 184----------- 185 186Swan has 4 U(S)ARTs. The Zephyr console output is 187assigned to LPUART. Default settings are 115200 8N1. 188 189Programming and Debugging 190************************* 191 192Connect Swan to your host computer using the USB port. 193Then build and flash an application. Here is an example for the 194:zephyr:code-sample:`hello_world` application. 195 196Run a serial host program to connect with your Swan: 197 198.. code-block:: console 199 200 $ minicom -D /dev/ttyACM0 201 202Then build and flash the application. 203 204.. zephyr-app-commands:: 205 :zephyr-app: samples/hello_world 206 :board: swan_r5 207 :goals: build flash 208 209You should see the following message on the console: 210 211.. code-block:: console 212 213 Hello World! arm 214 215References 216********** 217 218.. target-notes:: 219 220.. _Swan Product Page: 221 https://blues.io/products/swan 222 223.. _Swan Quickstart Guide: 224 https://dev.blues.io/start/swan/swan-quickstart 225 226.. _Swan Datasheet: 227 https://dev.blues.io/hardware/swan-datasheet/ 228