|
| 1 | +.. _stamp_c3: |
| 2 | + |
| 3 | +M5Stack STAMP-C3 |
| 4 | +################## |
| 5 | + |
| 6 | +Overview |
| 7 | +******** |
| 8 | + |
| 9 | +STAMP-C3 featuring ESPRESSIF ESP32-C3 RISC-V MCU with Wi-Fi connectivity |
| 10 | +for IoT edge devices such as home appliances and Industrial Automation. |
| 11 | + |
| 12 | +For more details see the `M5Stack STAMP-C3`_ page. |
| 13 | + |
| 14 | +Supported Features |
| 15 | +================== |
| 16 | + |
| 17 | +The STAMP-C3 board configuration supports the following hardware features: |
| 18 | + |
| 19 | ++-----------+------------+------------------+ |
| 20 | +| Interface | Controller | Driver/Component | |
| 21 | ++===========+============+==================+ |
| 22 | +| PMP | on-chip | arch/riscv | |
| 23 | ++-----------+------------+------------------+ |
| 24 | +| INTMTRX | on-chip | intc_esp32c3 | |
| 25 | ++-----------+------------+------------------+ |
| 26 | +| PINMUX | on-chip | pinctrl_esp32 | |
| 27 | ++-----------+------------+------------------+ |
| 28 | +| USB UART | on-chip | serial_esp32_usb | |
| 29 | ++-----------+------------+------------------+ |
| 30 | +| GPIO | on-chip | gpio_esp32 | |
| 31 | ++-----------+------------+------------------+ |
| 32 | +| UART | on-chip | uart_esp32 | |
| 33 | ++-----------+------------+------------------+ |
| 34 | +| I2C | on-chip | i2c_esp32 | |
| 35 | ++-----------+------------+------------------+ |
| 36 | +| SPI | on-chip | spi_esp32_spim | |
| 37 | ++-----------+------------+------------------+ |
| 38 | +| TWAI | on-chip | can_esp32_twai | |
| 39 | ++-----------+------------+------------------+ |
| 40 | + |
| 41 | + |
| 42 | +Prerequisites |
| 43 | +------------- |
| 44 | + |
| 45 | +Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command |
| 46 | +below to retrieve those files. |
| 47 | + |
| 48 | +.. code-block:: console |
| 49 | +
|
| 50 | + west blobs fetch hal_espressif |
| 51 | +
|
| 52 | +.. note:: |
| 53 | + |
| 54 | + It is recommended running the command above after :file:`west update`. |
| 55 | + |
| 56 | +Building & Flashing |
| 57 | +------------------- |
| 58 | + |
| 59 | +Build and flash applications as usual (see :ref:`build_an_application` and |
| 60 | +:ref:`application_run` for more details). |
| 61 | + |
| 62 | +.. zephyr-app-commands:: |
| 63 | + :zephyr-app: samples/hello_world |
| 64 | + :board: stamp_c3 |
| 65 | + :goals: build |
| 66 | + |
| 67 | +The usual ``flash`` target will work with the ``stamp_c3`` board |
| 68 | +configuration. Here is an example for the :ref:`hello_world` |
| 69 | +application. |
| 70 | + |
| 71 | +.. zephyr-app-commands:: |
| 72 | + :zephyr-app: samples/hello_world |
| 73 | + :board: stamp_c3 |
| 74 | + :goals: flash |
| 75 | + |
| 76 | +Open the serial monitor using the following command: |
| 77 | + |
| 78 | +.. code-block:: shell |
| 79 | +
|
| 80 | + west espressif monitor |
| 81 | +
|
| 82 | +After the board has automatically reset and booted, you should see the following |
| 83 | +message in the monitor: |
| 84 | + |
| 85 | +.. code-block:: console |
| 86 | +
|
| 87 | + ***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx ***** |
| 88 | + Hello World! stamp_c3 |
| 89 | +
|
| 90 | +Debugging |
| 91 | +--------- |
| 92 | + |
| 93 | +As with much custom hardware, the ESP32 modules require patches to |
| 94 | +OpenOCD that are not upstreamed yet. Espressif maintains their own fork of |
| 95 | +the project. The custom OpenOCD can be obtained at `OpenOCD ESP32`_ |
| 96 | + |
| 97 | +The Zephyr SDK uses a bundled version of OpenOCD by default. You can overwrite that behavior by adding the |
| 98 | +``-DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts>`` |
| 99 | +parameter when building. |
| 100 | + |
| 101 | +Here is an example for building the :ref:`hello_world` application. |
| 102 | + |
| 103 | +.. zephyr-app-commands:: |
| 104 | + :zephyr-app: samples/hello_world |
| 105 | + :board: stamp_c3 |
| 106 | + :goals: build flash |
| 107 | + :gen-args: -DOPENOCD=<path/to/bin/openocd> -DOPENOCD_DEFAULT_PATH=<path/to/openocd/share/openocd/scripts> |
| 108 | + |
| 109 | +You can debug an application in the usual way. Here is an example for the :ref:`hello_world` application. |
| 110 | + |
| 111 | +.. zephyr-app-commands:: |
| 112 | + :zephyr-app: samples/hello_world |
| 113 | + :board: stamp_c3 |
| 114 | + :goals: debug |
| 115 | + |
| 116 | +References |
| 117 | +********** |
| 118 | + |
| 119 | +.. target-notes:: |
| 120 | + |
| 121 | +.. _`M5Stack STAMP-C3`: https://docs.m5stack.com/en/core/stamp_c3 |
| 122 | +.. _`ESP32C3 Technical Reference Manual`: https://espressif.com/sites/default/files/documentation/esp32-c3_technical_reference_manual_en.pdf |
| 123 | +.. _`ESP32C3 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf |
| 124 | +.. _`OpenOCD ESP32`: https://github.com/espressif/openocd-esp32/releases |
0 commit comments