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 88.. zephyr:board-supported-hw:: 89 90Connections and IOs 91=================== 92 93Default Zephyr Peripheral Mapping: 94---------------------------------- 95 96.. rst-class:: rst-columns 97 98- A0 : PA3 99- A1 : PA1 100- A2 : PC3 101- A3 : PC1 102- A4 : PC4 103- A5 : PC5 104- D4 : PE3 105- D5 : PE11 106- D6 : PE9 107- D9 : PD15 108- D10 : PA4 109- D11 : PA7 110- D12 : PA6 111- D13 : PA5 112- UART_1_TX : PA9 113- UART_1_RX : PA10 114- UART_2_TX : PA2 115- UART_2_RX : PD6 116- UART_3_TX : PB10 117- UART_3_RX : PB11 118- LPUART_TX : PG7 119- LPUART_RX : PG8 120- I2C_1_SCL : PB6 121- I2C_1_SDA : PB7 122- I2C_2_SCL : PF1 123- I2C_2_SDA : PF0 124- I2C_3_SCL : PC0 125- I2C_3_SDA : PC9 126- SPI_1_NSS : PA4 127- SPI_1_SCK : PA5 128- SPI_1_MISO : PA6 129- SPI_1_MOSI : PA7 130- SPI_2_NSS : PD0 131- SPI_2_SCK : PD1 132- SPI_2_MISO : PB14 133- SPI_2_MOSI : PB15 134- SPI_3_NSS : PA15 135- SPI_3_SCK : PC10 136- SPI_3_MISO : PC11 137- SPI_3_MOSI : PC12 138- PWM_2_CH1 : PA0 139- USER_PB : PC13 140- LD1 : PE2 141- USB DM : PA11 142- USB DP : PA12 143- ADC1 : PA1 144 145System Clock 146------------ 147 148Swan System Clock could be driven by internal or external 149oscillator, as well as main PLL clock. By default, the System clock is 150driven by the PLL clock at 80MHz, driven by a 16MHz high speed 151internal oscillator. 152 153Serial Port 154----------- 155 156Swan has 4 U(S)ARTs. The Zephyr console output is 157assigned to LPUART. Default settings are 115200 8N1. 158 159Programming and Debugging 160************************* 161 162Connect Swan to your host computer using the USB port. 163Then build and flash an application. Here is an example for the 164:zephyr:code-sample:`hello_world` application. 165 166Run a serial host program to connect with your Swan: 167 168.. code-block:: console 169 170 $ minicom -D /dev/ttyACM0 171 172Then build and flash the application. 173 174.. zephyr-app-commands:: 175 :zephyr-app: samples/hello_world 176 :board: swan_r5 177 :goals: build flash 178 179You should see the following message on the console: 180 181.. code-block:: console 182 183 Hello World! arm 184 185References 186********** 187 188.. target-notes:: 189 190.. _Swan Product Page: 191 https://blues.io/products/swan 192 193.. _Swan Quickstart Guide: 194 https://dev.blues.io/start/swan/swan-quickstart 195 196.. _Swan Datasheet: 197 https://dev.blues.io/hardware/swan-datasheet/ 198