1.. zephyr:board:: longan_nano 2 3Overview 4******** 5 6The Sipeed Longan Nano and Longan Nano Lite is an simple and tiny development board with 7an GigaDevice GD32VF103 SoC that based on N200 RISC-V IP core by Nuclei system technology. 8More information can be found on: 9 10- `Sipeed Longan website <https://longan.sipeed.com/en/>`_ 11- `GD32VF103 datasheet <https://www.gigadevice.com/datasheet/gd32vf103xxxx-datasheet/>`_ 12- `GD32VF103 user manual <https://www.gd32mcu.com/data/documents/userManual/GD32VF103_User_Manual_Rev1.4.pdf>`_ 13- `Nuclei website <https://www.nucleisys.com/download.php>`_ 14- `Nuclei Bumblebee core documents <https://github.com/nucleisys/Bumblebee_Core_Doc>`_ 15- `Nuclei ISA Spec <https://doc.nucleisys.com/nuclei_spec/>`_ 16 17Hardware 18******** 19 20- 4 x universal 16-bit timer 21- 2 x basic 16-bit timer 22- 1 x advanced 16-bit timer 23- Watchdog timer 24- RTC 25- Systick 26- 3 x USART 27- 2 x I2C 28- 3 x SPI 29- 2 x I2S 30- 2 x CAN 31- 1 x USBFS(OTG) 32- 2 x ADC(10 channel) 33- 2 x DAC 34 35Supported Features 36================== 37 38.. zephyr:board-supported-hw:: 39 40The microSD card reader in Longan Nano board is connected to SPI1. 41 42Serial Port 43=========== 44 45USART0 is on the opposite end of the USB. 46Connect to TX0 (PA9) and RX0 (PA10). 47 48Programming and debugging 49************************* 50 51Building & Flashing 52=================== 53 54Here is an example for building the :zephyr:code-sample:`blinky` application. 55 56.. zephyr-app-commands:: 57 :zephyr-app: samples/basic/blinky 58 :board: longan_nano 59 :goals: build flash 60 61When using a custom toolchain it should be enough to have the downloaded 62version of the binary in your ``PATH``. 63 64The default runner tries to flash the board via an external programmer using openocd. 65To flash via the USB port, select the DFU runner when flashing: 66 67.. code-block:: console 68 69 west flash --runner dfu-util 70 71Debugging 72========= 73 74You can debug an application in the usual way. Here is an example for the 75:zephyr:code-sample:`blinky` application. 76 77.. zephyr-app-commands:: 78 :zephyr-app: samples/basic/blinky 79 :board: longan_nano 80 :maybe-skip-config: 81 :goals: debug 82