Skip to content

Commit 82ac3fa

Browse files
sagisaka0328mbolivar-nordic
authored andcommitted
boards: riscv: longan_nano: Update document
Improve documentation - Add a photo of the board - Add hardware information from the board manual - Fix options for build (set OPENOCD_DEFAULT_PATH to make it valid for also windows environment) - Improve the build instructions to make it easier to understand Signed-off-by: Yuichiro SAGISAKA <[email protected]>
1 parent 45751e2 commit 82ac3fa

File tree

2 files changed

+77
-23
lines changed

2 files changed

+77
-23
lines changed
177 KB
Loading

boards/riscv/longan_nano/doc/index.rst

Lines changed: 77 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Sipeed Longan Nano
44
##################
55

6+
.. image:: img/longan_nano.png
7+
:align: center
8+
:alt: longan_nano
9+
610
Overview
711
********
812

@@ -17,21 +21,68 @@ More information can be found on:
1721
- `Nuclei Bumblebee core documents <https://github.com/nucleisys/Bumblebee_Core_Doc>`_
1822
- `Nuclei ISA Spec <https://doc.nucleisys.com/nuclei_spec/>`_
1923

20-
Programming and debugging
21-
*************************
22-
23-
Building
24-
========
24+
Hardware
25+
********
2526

26-
Applications for the ``logan_nano`` board configuration can be built as usual
27-
(see :ref:`build_an_application`) using the corresponding board name:
27+
- 4 x universal 16-bit timer
28+
- 2 x basic 16-bit timer
29+
- 1 x advanced 16-bit timer
30+
- Watchdog timer
31+
- RTC
32+
- Systick
33+
- 3 x USART
34+
- 2 x I2C
35+
- 3 x SPI
36+
- 2 x I2S
37+
- 2 x CAN
38+
- 1 x USBFS(OTG)
39+
- 2 x ADC(10 channel)
40+
- 2 x DAC
41+
42+
Supported Features
43+
==================
44+
45+
The board configuration supports the following hardware features:
46+
47+
.. list-table::
48+
:header-rows: 1
49+
50+
* - Peripheral
51+
- Kconfig option
52+
- Devicetree compatible
53+
* - GPIO
54+
- :kconfig:option:`CONFIG_GPIO`
55+
- :dtcompatible:`gd,gd32-gpio`
56+
* - Machine timer
57+
- :kconfig:option:`CONFIG_RISCV_MACHINE_TIMER`
58+
- :dtcompatible:`riscv,machine-timer`
59+
* - Nuclei ECLIC Interrupt Controller
60+
- :kconfig:option:`CONFIG_NUCLEI_ECLIC`
61+
- :dtcompatible:`nuclei,eclic`
62+
* - PWM
63+
- :kconfig:option:`CONFIG_PWM`
64+
- :dtcompatible:`gd,gd32-pwm`
65+
* - USART
66+
- :kconfig:option:`CONFIG_SERIAL`
67+
- :dtcompatible:`gd,gd32-usart`
68+
* - I2C
69+
- :kconfig:option:`CONFIG_I2C`
70+
- :dtcompatible:`gd,gd32-i2c`
71+
* - DAC
72+
- :kconfig:option:`CONFIG_DAC`
73+
- :dtcompatible:`gd,gd32-dac`
74+
75+
Serial Port
76+
===========
77+
78+
USART0 is on the opposite end of the USB.
79+
Connect to TX0 (PA9) and RX0 (PA10).
2880

29-
.. zephyr-app-commands::
30-
:board: logan_nano
31-
:goals: build
81+
Programming and debugging
82+
*************************
3283

33-
Flashing
34-
========
84+
Building & Flashing
85+
===================
3586

3687
In order to upload the application to the device, you'll need OpenOCD with
3788
GD32V support. Download the tarball for your OS from the
@@ -40,25 +91,28 @@ GD32V support. Download the tarball for your OS from the
4091

4192
The Zephyr SDK uses a bundled version of OpenOCD by default. You can
4293
overwrite that behavior by adding the
43-
``-DOPENOCD=<path/to/riscv-openocd/bin/openocd>``
94+
``-DOPENOCD=<path/to/riscv-openocd/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/riscv-openocd/share/openocd/scripts>``
4495
parameter when building:
4596

97+
Here is an example for building the :ref:`blinky-sample` application.
98+
4699
.. zephyr-app-commands::
100+
:zephyr-app: samples/basic/blinky
47101
:board: longan_nano
48-
:goals: build
49-
:gen-args: -DOPENOCD=<path/to/riscv-openocd/bin/openocd>
102+
:goals: build flash
103+
:gen-args: -DOPENOCD=<path/to/riscv-openocd/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/riscv-openocd/share/openocd/scripts>
50104

51105
When using a custom toolchain it should be enough to have the downloaded
52106
version of the binary in your ``PATH``.
53107

54-
Now you can flash the application as usual (see :ref:`build_an_application` and
55-
:ref:`application_run` for more details):
56-
57-
.. code-block:: console
58-
59-
west flash
60-
61108
Debugging
62109
=========
63110

64-
Refer to the detailed overview about :ref:`application_debugging`.
111+
You can debug an application in the usual way. Here is an example for the
112+
:ref:`blinky-sample` application.
113+
114+
.. zephyr-app-commands::
115+
:zephyr-app: samples/basic/blinky
116+
:board: longan_nano
117+
:maybe-skip-config:
118+
:goals: debug

0 commit comments

Comments
 (0)