nuttx/Documentation/platforms/xtensa/esp32s3/boards/esp32s3-devkit/index.rst

364 lines
10 KiB
ReStructuredText
Raw Normal View History

2022-06-16 01:00:05 +02:00
==============
ESP32S3-DevKit
==============
The `ESP32S3 DevKit <https://docs.espressif.com/projects/esp-idf/en/latest/esp32s3/hw-reference/esp32s3/user-guide-devkitc-1.html>`_ is a development board for the ESP32-S3 SoC from Espressif, based on a ESP32-S3-WROOM-1 module.
.. list-table::
:align: center
* - .. figure:: esp32-s3-devkitc-1.png
:align: center
Features
========
- ESP32-S3-WROOM-1 Module
- USB-to-UART bridge via micro USB port
- Power LED
- EN and BOOT buttons (BOOT accessible to user)
- SPI FLASH (size varies according to model
Serial Console
==============
UART0 is, by default, the serial console. It connects to the on-board
CP2102 converter and is available on the USB connector USB CON8 (J1).
It will show up as /dev/ttyUSB[n] where [n] will probably be 0.
Buttons and LEDs
================
Board Buttons
-------------
2022-06-16 01:00:05 +02:00
There are two buttons labeled Boot and EN. The EN button is not available
to software. It pulls the chip enable line that doubles as a reset line.
The BOOT button is connected to IO0. On reset it is used as a strapping
pin to determine whether the chip boots normally or into the serial
bootloader. After reset, however, the BOOT button can be used for software
input.
Board LEDs
----------
2022-06-16 01:00:05 +02:00
There are several on-board LEDs for that indicate the presence of power
and USB activity. None of these are available for use by software.
Configurations
==============
All of the configurations presented below can be tested by running the following commands::
$ ./tools/configure.sh esp32s3-devkit:<config_name>
$ make flash ESPTOOL_PORT=/dev/ttyUSB0 -j
Where <config_name> is the name of board configuration you want to use, i.e.: nsh, buttons, wifi...
Then use a serial console terminal like ``picocom`` configured to 115200 8N1.
buttons
-------
This configuration shows the use of the buttons subsystem. It can be used by executing
the ``buttons`` application and pressing on any of the available board buttons::
nsh> buttons
buttons_main: Starting the button_daemon
buttons_main: button_daemon started
button_daemon: Running
button_daemon: Opening /dev/buttons
button_daemon: Supported BUTTONs 0x01
nsh> Sample = 1
Sample = 0
coremark
--------
This configuration sets the CoreMark benchmark up for running on the maximum
number of cores for this system. It also enables some optimization flags and
disables the NuttShell to get the best possible score.
.. note:: As the NSH is disabled, the application will start as soon as the
system is turned on.
cxx
2022-06-16 01:00:05 +02:00
---
Development enviroment ready for C++ applications. You can check if the setup
was successfull by running ``cxxtest``::
nsh> cxxtest
Test ofstream ================================
printf: Starting test_ostream
printf: Successfully opened /dev/console
cout: Successfully opened /dev/console
Writing this to /dev/console
Test iostream ================================
Hello, this is only a test
Print an int: 190
Print a char: d
Test std::vector =============================
v1=1 2 3
Hello World Good Luck
Test std::map ================================
Test C++17 features ==========================
File /proc/meminfo exists!
Invalid file! /invalid
File /proc/version exists!
i2c
---
This configuration can be used to scan and manipulate I2C devices.
You can scan for all I2C devices using the following command::
nsh> i2c dev 0x00 0x7f
knsh
----
This is identical to the nsh configuration except that (1) NuttX
is built as PROTECTED mode, monolithic module and the user applications
are built separately and, as a consequence, (2) some features that are
only available in the FLAT build are disabled.
Protected Mode support for ESP32-S3 relies on the World Controller (WC)
and Permission Control (PMS) peripherals for implementing isolation
between Kernel and Userspace.
By working together with the MMU and Static MPUs of the ESP32-S3, the WC/PMS
is able to restrict the application access to peripherals, on-chip
memories (Internal ROM and Internal SRAM) and off-chip memories (External
Flash and PSRAM).
.. warning:: The World Controller and Permission Control **do not** prevent
the application from accessing CPU System Registers.
mcuboot_nsh
-----------
This configuration is the same as the ``nsh`` configuration, but it generates the application
image in a format that can be used by MCUboot. It also makes the ``make bootloader`` command to
build the MCUboot bootloader image using the Espressif HAL.
nsh
---
Basic NuttShell configuration (console enabled in UART0, exposed via
USB connection by means of CP2102 converter, at 115200 bps).
oneshot
-------
This config demonstrate the use of oneshot timers present on the ESP32-S3.
To test it, just run the ``oneshot`` example::
nsh> oneshot
Opening /dev/oneshot
Maximum delay is 4294967295999999
Starting oneshot timer with delay 2000000 microseconds
Waiting...
Finished
psram_quad
----------
This config tests the PSRAM driver over SPIRAM interface in quad mode.
You can use the mm command to test the PSRAM memory::
nsh> mm
mallinfo:
Total space allocated from system = 8803232
Number of non-inuse chunks = 2
Largest non-inuse chunk = 8388592
Total allocated space = 9672
Total non-inuse space = 8793560
(0)Allocating 5011 bytes
......
(31)Releasing memory at 0x3fc8c088 (size=24 bytes)
mallinfo:
Total space allocated from system = 8803232
Number of non-inuse chunks = 2
Largest non-inuse chunk = 8388592
Total allocated space = 9672
Total non-inuse space = 8793560
TEST COMPLETE
psram_octal
-----------
Similar to the ```psram_quad``` configuration but using the SPIRAM
interface in octal mode.
pwm
---
This configuration demonstrates the use of PWM through a LED connected to GPIO2.
To test it, just execute the ``pwm`` application::
nsh> pwm
pwm_main: starting output with frequency: 10000 duty: 00008000
pwm_main: stopping output
random
------
This configuration shows the use of the ESP32-S3's True Random Number Generator with
entropy sourced from Wi-Fi and Bluetooth noise.
To test it, just run ``rand`` to get 32 randomly generated bytes::
nsh> rand
Reading 8 random numbers
Random values (0x3ffe0b00):
0000 98 b9 66 a2 a2 c0 a2 ae 09 70 93 d1 b5 91 86 c8 ..f......p......
0010 8f 0e 0b 04 29 64 21 72 01 92 7c a2 27 60 6f 90 ....)d!r..|.'`o.
smp
---
Another NSH configuration, similar to nsh, but also enables
SMP operation. It differs from the nsh configuration only in these
additional settings:
SMP is enabled::
CONFIG_SMP=y
CONFIG_SMP_NCPUS=2
CONFIG_SPINLOCK=y
The apps/testing/smp test is included::
CONFIG_TESTING_SMP=y
CONFIG_TESTING_SMP_NBARRIER_THREADS=8
CONFIG_TESTING_SMP_PRIORITY=100
CONFIG_TESTING_SMP_STACKSIZE=2048
spiflash
--------
This config tests the external SPI that comes with the ESP32-S3 module connected
through SPI1.
By default a SmartFS file system is selected.
Once booted you can use the following commands to mount the file system::
nsh> mksmartfs /dev/smart0
nsh> mount -t smartfs /dev/smart0 /mnt
Note that mksmartfs is only needed the first time.
sta_softap
----------
With this configuration you can run these commands to be able
to connect your smartphone or laptop to your board::
nsh> ifup wlan1
nsh> dhcpd_start wlan1
nsh> wapi psk wlan1 mypasswd 3
nsh> wapi essid wlan1 nuttxap 1
In this case, you are creating the access point ``nuttxapp`` in your board and to
connect to it on your smartphone you will be required to type the password ``mypasswd``
using WPA2.
.. tip:: Please refer to :ref:`ESP32 Wi-Fi SoftAP Mode <esp32_wi-fi_softap>`
for more information.
The ``dhcpd_start`` is necessary to let your board to associate an IP to your smartphone.
tickless
--------
This configuration enables the support for tickless scheduler mode.
timer
-----
This config test the general use purpose timers. It includes the 4 timers,
adds driver support, registers the timers as devices and includes the timer
example.
To test it, just run the following::
nsh> timer -d /dev/timerx
Where x in the timer instance.
usbnsh
------
Basic NuttShell configuration console enabled over USB Device (USB CDC/ACM).
Before using this configuration, please confirm that your computer detected
that USB JTAG/serial interface used to flash the board::
usb 3-5.2.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 3-5.2.3: Product: USB JTAG/serial debug unit
usb 3-5.2.3: Manufacturer: Espressif
usb 3-5.2.3: SerialNumber: XX:XX:XX:XX:XX:XX
cdc_acm 3-5.2.3:1.0: ttyACM0: USB ACM device
Then you can run the configuration and compilation procedure::
$ ./tools/configure.sh esp32s3-devkit:usbnsh
$ make flash ESPTOOL_PORT=/dev/ttyACM0 -j8
Then run the minicom configured to /dev/ttyACM0 115200 8n1 and
press <ENTER> three times to force the nsh to show up::
NuttShell (NSH) NuttX-12.1.0
nsh> ?
help usage: help [-v] [<cmd>]
. break dd exit ls ps source umount
[ cat df false mkdir pwd test unset
? cd dmesg free mkrd rm time uptime
alias cp echo help mount rmdir true usleep
unalias cmp env hexdump mv set truncate xd
basename dirname exec kill printf sleep uname
Builtin Apps:
nsh sh
nsh> uname -a
NuttX 12.1.0 38a73cd970 Jun 18 2023 16:58:46 xtensa esp32s3-devkit
nsh>
wifi
----
Enables Wi-Fi support. You can define your credentials this way::
$ make menuconfig
-> Application Configuration
-> Network Utilities
-> Network initialization (NETUTILS_NETINIT [=y])
-> WAPI Configuration
Or if you don't want to keep it saved in the firmware you can do it
at runtime::
nsh> wapi psk wlan0 mypasswd 3
nsh> wapi essid wlan0 myssid 1
nsh> renew wlan0
.. tip:: Please refer to :ref:`ESP32 Wi-Fi Station Mode <esp32_wi-fi_sta>`
for more information.
watchdog
--------
This config test the watchdog timers. It includes the 2 MWDTS,
adds driver support, registers the WDTs as devices and includes the watchdog
example.
To test it, just run the following::
nsh> wdog -i /dev/watchdogx
Where x is the watchdog instance.