Skip to content

Commit

Permalink
Merge branch 'apache:master' into feature/move-s3-qemu-toywasm
Browse files Browse the repository at this point in the history
  • Loading branch information
fdcavalcanti authored Feb 24, 2025
2 parents ebc490e + 425ddc7 commit 94b3cb2
Show file tree
Hide file tree
Showing 134 changed files with 16,299 additions and 203 deletions.
10 changes: 3 additions & 7 deletions Documentation/applications/interpreters/python/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ How Does it Work?

1. Python for NuttX target initially the ``rv-virt`` (RISC-V QEMU) board.
2. Python modules are stored in `pyc <https://docs.python.org/3/glossary.html#term-bytecode>`_ (byte-code format) and are loaded from a ROMFS image at startup.
3. Environment variables like ``PYTHONHOME`` and ``PYTHON_BASIC_REPL`` need to be set accordingly.
3. The Python wrapper application on NuttX mounts the ROMFS partition which contains the Python modules and sets the required environment variables (``PYTHONHOME`` and ``PYTHON_BASIC_REPL``) automatically.

Building Python NuttX
=====================
Building Python on NuttX
========================

Use the ``rv-virt:python`` config to build Python for NuttX. Note that the CMake scripts don't work for this configuration. For now, please use the makefile build instead:

Expand Down Expand Up @@ -66,10 +66,6 @@ Then, run RISC-V QEMU with the following command:
telnetd [4:100]
NuttShell (NSH) NuttX-10.4.0
nsh> python_mount_modules
Mounting ROMFS filesystem at target=/usr/local/lib/ with source=/dev/ram1
nsh> export PYTHONHOME /usr/local
nsh> export PYTHON_BASIC_REPL 1
nsh> python
Python 3.13.0 (main, Dec 4 2024, 17:00:42) [GCC 13.2.0] on nuttx
Type "help", "copyright", "credits" or "license" for more information.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=============
XIAO nRF52840
=============
==========================
Seeed Studio XIAO nRF52840
==========================

The `Seeed Studio XIAO nRF52840 <https://wiki.seeedstudio.com/XIAO_BLE/>`_ is a general purpose board supplied by
Seeed Studio and it is compatible with the Nordic nRF52840 ecosystem as they share the same MCU.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,29 @@ You can scan for all I2C devices using the following command::

nsh> i2c dev 0x00 0x7f

i2schar
-------

This configuration enables the I2S character device and the i2schar example
app, which provides an easy-to-use way of testing the I2S peripheral,
enabling both the TX and the RX for those peripherals.

**I2S pinout**

============ ========== =========================================
ESP32-C3 Pin Signal Pin Description
============ ========== =========================================
0 MCLK Master Clock
4 SCLK Bit Clock (SCLK)
5 LRCK Word Select (LRCLK)
18 DOUT Data Out
19 DIN Data In
============ ========== =========================================

After successfully built and flashed, run on the boards's terminal::

nsh> i2schar

nimble
------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,29 @@ You can scan for all I2C devices using the following command::

nsh> i2c dev 0x00 0x7f

i2schar
-------

This configuration enables the I2S character device and the i2schar example
app, which provides an easy-to-use way of testing the I2S peripheral,
enabling both the TX and the RX for those peripherals.

**I2S pinout**

============ ========== =========================================
ESP32-C3 Pin Signal Pin Description
============ ========== =========================================
0 MCLK Master Clock
4 SCLK Bit Clock (SCLK)
5 LRCK Word Select (LRCLK)
18 DOUT Data Out
19 DIN Data In
============ ========== =========================================

After successfully built and flashed, run on the boards's terminal::

nsh> i2schar

motor
-------

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,29 @@ You can scan for all I2C devices using the following command::

nsh> i2c dev 0x00 0x7f

i2schar
-------

This configuration enables the I2S character device and the i2schar example
app, which provides an easy-to-use way of testing the I2S peripheral,
enabling both the TX and the RX for those peripherals.

**I2S pinout**

============ ========== =========================================
ESP32-C3 Pin Signal Pin Description
============ ========== =========================================
0 MCLK Master Clock
4 SCLK Bit Clock (SCLK)
5 LRCK Word Select (LRCLK)
18 DOUT Data Out
19 DIN Data In
============ ========== =========================================

After successfully built and flashed, run on the boards's terminal::

nsh> i2schar

mcuboot_nsh
--------------------

Expand Down
6 changes: 3 additions & 3 deletions Documentation/platforms/risc-v/esp32c6/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ eFuse Yes
GPIO Yes
HMAC No
I2C Yes
I2S No
Int. Temp. No
I2S Yes
Int. Temp. Yes
LED No
LED_PWM Yes
MCPWM Yes
Pulse Counter Yes
RMT No
RMT Yes
RNG No
RSA No
RTC Yes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,29 @@ You can scan for all I2C devices using the following command::

nsh> i2c dev 0x00 0x7f

i2schar
-------

This configuration enables the I2S character device and the i2schar example
app, which provides an easy-to-use way of testing the I2S peripheral,
enabling both the TX and the RX for those peripherals.

**I2S pinout**

============ ========== =========================================
ESP32-C3 Pin Signal Pin Description
============ ========== =========================================
0 MCLK Master Clock
4 SCLK Bit Clock (SCLK)
5 LRCK Word Select (LRCLK)
10 DOUT Data Out
11 DIN Data In
============ ========== =========================================

After successfully built and flashed, run on the boards's terminal::

nsh> i2schar

mcuboot_nsh
--------------------

Expand Down
6 changes: 3 additions & 3 deletions Documentation/platforms/risc-v/esp32h2/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ eFuse Yes
GPIO Yes
HMAC No
I2C Yes
I2S No
Int. Temp. No
I2S Yes
Int. Temp. Yes
LED No
LED_PWM Yes
MCPWM No
Pulse Counter Yes
RMT No
RMT Yes
RNG No
RSA No
RTC Yes
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
156 changes: 156 additions & 0 deletions Documentation/platforms/xtensa/esp32s3/boards/esp32s3-lcd-ev/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
===============
ESP32-S3-LCD-EV
===============

The `ESP32-S3-LCD-EV-Board <https://docs.espressif.com/projects/esp-dev-kits/en/latest/esp32s3/esp32-s3-lcd-ev-board/user_guide.html>`_ is a small-sized AI development board from Espressif featuring the ESP32-S3 CPU with a touchscreen LCD display, dual microphone, an 16 MB Octal PSRAM and an 16 MB flash.

.. list-table::
:align: center

* - .. figure:: esp32s3_lcd_ev.png
:align: center

Features
========

- ESP32-S3 WROOM-1 Module
- USB Type-C ports
- Power LED
- LCD Display
- MEMS Microphone
- 16MB Octal PSRAM
- 16MB SPI Flash
- RST and BOOT buttons (BOOT accessible to user)

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
-------------

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
----------

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.
Another WS2812 LED is connected to GPIO4.

Configurations
==============

All of the configurations presented below can be tested by running the following commands::

$ ./tools/configure.sh esp32s3-lcd-ev:<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.

audio
-----

This configuration uses the I2S0 peripheral and an externally connected audio
codec to play an audio file streamed over an HTTP connection while connected
to a Wi-Fi network.

**Audio Codec Setup**

The CS4344 audio codec is connected to the following pins:

============ ========== ============================================
ESP32-S3 Pin CS4344 Pin Description
============ ========== ============================================
5 MCLK Master Clock
16 SCLK Serial Clock
7 LRCK Left Right Clock (Word Select)
6 SDIN Serial Data In on CS4344. (DOUT on ESP32-S3)
============ ========== ============================================

**Simple HTTP server**

Prepare a PCM-encoded (`.wav`) audio file with 16 or 24 bits/sample (sampled at
16~48kHz). This file must be placed into a folder in a computer that could
be accessed on the same Wi-Fi network the ESP32 will be connecting to.

Python provides a simple HTTP server. ``cd`` to the audio file folder on the
PC and run::

$ python3 -m http.server
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)

Look for your PC IP address and test playing the prepared audio on your
browser:

.. figure:: esp32s3-audio-config-file.png
:align: center

After successfully built and flashed, connect the board to the Wi-Fi network::

nsh> wapi psk wlan0 mypasswd 3
nsh> wapi essid wlan0 myssid 1
nsh> renew wlan0

Once connected, open NuttX's player and play the file according to the filename
and the IP address of the HTTP server::

nsh> nxplayer
nxplayer> play http://192.168.1.239:8000/tones.wav

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

lvgl
----

This is a demonstration of the LVGL graphics library running on the NuttX LCD
driver. You can find LVGL here::

https://www.lvgl.io/
https://github.com/lvgl/lvgl

This configuration uses the LVGL demonstration at `apps/examples/lvgldemo`.

nsh
---

Basic NuttShell configuration (console enabled in UART0, exposed via
USB connection by means of CP2102 converter, at 115200 bps).

ws2812
------

This configuration enables the usage of the RMT peripheral and the example
``ws2812`` to drive addressable RGB LEDs::

nsh> ws2812

Please note that this board contains an on-board WS2812 LED connected to GPIO38
and, by default, this config configures the RMT transmitter in the same pin.
24 changes: 24 additions & 0 deletions Documentation/platforms/xtensa/esp32s3/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,30 @@ using WPA2.

The ``dhcpd_start`` is necessary to let your board to associate an IP to your smartphone.

PSRAM
-----

The external PSRAM is supported in ESP32-S3. The PSRAM is mapped to the data bus during
the boot process. The PSRAM is used as a heap memory and is available for the application.

Please check the following examples for more information:

* :ref:`esp32s3-devkit:psram_octal <platforms/xtensa/esp32s3/boards/esp32s3-devkit/index:psram_octal>`
* :ref:`esp32s3-devkit:psram_quad <platforms/xtensa/esp32s3/boards/esp32s3-devkit/index:psram_quad>`

Moving not initialized data to the external PSRAM
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Static or global not-initialized data can be moved to the external PSRAM. Usually allocated at the
``.bss`` memory segment, this data can be set to another section in the external PSRAM.
Set the attribute ``__attribute__ ((section (".ext_ram.bss")))`` to the variable. For example::

__attribute__ ((section (".ext_ram.bss"))) static uint8_t my_data[1024];

``my_data`` will be allocated in the external PSRAM and can be explicitly initialized on runtime.

This is particularly useful when the internal RAM is not enough to hold all the data.

Supported Boards
================

Expand Down
Loading

0 comments on commit 94b3cb2

Please sign in to comment.