Skip to content

Commit dd16e3a

Browse files
committed
Merge branch 'docs/update_Platform_module_default_config_table' into 'master'
docs: update how_to_add_a_new_module_configuration See merge request application/esp-at!1594
2 parents bf1aec8 + d4ac576 commit dd16e3a

File tree

4 files changed

+249
-143
lines changed

4 files changed

+249
-143
lines changed
Lines changed: 122 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,33 @@
11
How to Add Support for a Module
2-
================================
2+
============================================
33

44
:link_to_translation:`zh_CN:[中文]`
55

6-
The ESP-AT project supports multiple modules, and provides configuration for them in the :component_file:`factory_param_data.csv <customized_partitions/raw_data/factory_param/factory_param_data.csv>` table and the files in the :project:`module_config` folder. See the table below for the supported platforms (chip series) and modules, as well as locations of the default configuration files.
6+
The ESP-AT project supports multiple modules, and provides configuration for them in the :component_file:`factory_param_data.csv <customized_partitions/raw_data/factory_param/factory_param_data.csv>` table and the files in the :project:`module_config` folder. If you want to add support for an {IDF_TARGET_NAME} module in your ESP-AT project, you need to modify those configuration files. The "{IDF_TARGET_NAME} module" here means:
77

8-
.. list-table:: default configuration files
9-
:header-rows: 1
10-
:widths: 5 10 40
11-
12-
* - Platform
13-
- Module
14-
- Default
15-
* - ESP32
16-
- - WROOM-32
17-
- PICO-D4
18-
- SOLO-1
19-
- MINI-1
20-
- - :project_file:`module_config/module_esp32_default/sdkconfig.defaults`
21-
- :project_file:`module_config/module_esp32_default/sdkconfig_silence.defaults`
22-
* - ESP32
23-
- WROVER-32
24-
- - :project_file:`module_config/module_wrover-32/sdkconfig.defaults`
25-
- :project_file:`module_config/module_wrover-32/sdkconfig_silence.defaults`
26-
* - ESP32
27-
- ESP32-D2WD
28-
- - :project_file:`module_config/module_esp32-d2wd/sdkconfig.defaults`
29-
- :project_file:`module_config/module_esp32-d2wd/sdkconfig_silence.defaults`
30-
* - ESP32-C2
31-
- ESP32C2-2MB (all ESP32-C2 (ESP8684) series with 2 MB flash)
32-
- - :project_file:`module_config/module_esp32c2-2mb/sdkconfig.defaults`
33-
- :project_file:`module_config/module_esp32c2-2mb/sdkconfig_silence.defaults`
34-
* - ESP32-C2
35-
- ESP32C2-4MB (all ESP32-C2 (ESP8684) series with 4 MB flash)
36-
- - :project_file:`module_config/module_esp32c2_default/sdkconfig.defaults`
37-
- :project_file:`module_config/module_esp32c2_default/sdkconfig_silence.defaults`
38-
* - ESP32-C3
39-
- MINI-1
40-
- - :project_file:`module_config/module_esp32c3_default/sdkconfig.defaults`
41-
- :project_file:`module_config/module_esp32c3_default/sdkconfig_silence.defaults`
42-
* - ESP32-C6
43-
- ESP32C6-4MB (all ESP32-C6 series with 4 MB flash)
44-
- - :project_file:`module_config/module_esp32c6_default/sdkconfig.defaults`
45-
- :project_file:`module_config/module_esp32c6_default/sdkconfig_silence.defaults`
46-
47-
.. note::
8+
- Modules that the ESP-AT project has not supported yet, including those of supported platform and not supported platform. However, adding support for the latter requires extra huge work, thus not recommended and not explained in this document.
489

49-
- When the ``silence mode`` in ``./build.py menuconfig`` is ``0``, the default sdkconfig corresponding to the module is ``sdkconfig.defaults``.
50-
- When the ``silence mode`` in ``./build.py menuconfig`` is ``1``, the default sdkconfig corresponding to the module is ``sdkconfig_silence.defaults``.
10+
- Modules that the ESP-AT project supports, but you want to modify the default configuration.
5111

52-
If you want to add support for an {IDF_TARGET_NAME} module in your ESP-AT project, you need to modify those configuration files. The "{IDF_TARGET_NAME} module" here means:
12+
.. only:: esp32c2 or esp32c3 or esp32c6
5313

54-
- Modules that the ESP-AT project has not supported yet, including those of supported platform and not supported platform. However, adding support for the latter requires extra huge work, thus not recommended and not explained in this document.
14+
The document uses an example to explain how to add support for an {IDF_TARGET_NAME} module in the ESP-AT project. The example module is {IDF_TARGET_NAME}-MINI-1 that uses SPI instead of the default UART interface.
5515

56-
- Modules that the ESP-AT project supports, but you want to modify the default configuration.
16+
.. only:: esp32 or esp32s2
5717

58-
The document uses an example to explain how to add support for an {IDF_TARGET_NAME} module in the ESP-AT project. The example module is ESP32-WROOM-32 that uses SDIO instead of the default UART interface.
18+
This document will explain how to add new module support for a {IDF_TARGET_NAME} chip/module that ESP-AT already supports in the ESP-AT project. The following example will enable the default :ref:`FileSystem AT commands <FS-AT>` and add support for a new module.
5919

6020
.. contents::
6121
:local:
6222
:depth: 1
6323

64-
Add Module to factory_param_data.csv
65-
------------------------------------
24+
Step 1: Configure the Factory Parameters for the New Module
25+
-----------------------------------------------------------------------------
6626

67-
Open your local :component_file:`factory_param_data.csv <customized_partitions/raw_data/factory_param/factory_param_data.csv>`, insert a new row at the end, set the parameters as needed. In the example, we set ``platform`` to ``PLATFORM_ESP32``, ``module_name`` to ``WROOM32-SDIO``, as well as other parameters as follows (see :ref:`factory-param-intro` for what each parameter represents):
27+
Open your local :component_file:`factory_param_data.csv <customized_partitions/raw_data/factory_param/factory_param_data.csv>`, insert a new row at the end, and set the relevant parameters as needed. In this example, we set ``platform`` to ``PLATFORM_{IDF_TARGET_CFG_PREFIX}`` and ``module_name`` to ``{IDF_TARGET_CFG_PREFIX}-USER-DEFINED``. The values for other parameters are shown in the table below (for parameter meanings, please refer to :ref:`factory-param-intro`).
6828

69-
- platform: PLATFORM_ESP32
70-
- module_name: WROOM32-SDIO
29+
- platform: PLATFORM_{IDF_TARGET_CFG_PREFIX}
30+
- module_name: {IDF_TARGET_CFG_PREFIX}-USER-DEFINED
7131
- description:
7232
- version: 4
7333
- max_tx_power: 78
@@ -81,8 +41,8 @@ Open your local :component_file:`factory_param_data.csv <customized_partitions/r
8141
- uart_cts_pin: -1
8242
- uart_rts_pin: -1
8343

84-
Modify esp_at_module_info Structure
85-
-----------------------------------
44+
Step 2: Configure OTA for the Newly Added Module
45+
----------------------------------------------------
8646

8747
Add customized module information in the ``esp_at_module_info`` structure in :component_file:`at/src/at_default_config.c`.
8848

@@ -135,33 +95,124 @@ Macro ``CONFIG_ESP_AT_OTA_TOKEN_MY_MODULE`` and macro ``CONFIG_ESP_AT_OTA_SSL_TO
13595
...
13696
#define CONFIG_ESP_AT_OTA_SSL_TOKEN_MY_MODULE CONFIG_ESP_AT_OTA_SSL_TOKEN_DEFAULT
13797
138-
Configure the Module
139-
---------------------
98+
Step 3: Add New Module Configuration
99+
------------------------------------------------
100+
101+
The ESP-AT project supports multiple platforms, each of which supports multiple module configurations and provides configuration files for each module configuration: :component_file:`factory_param_data.csv <customized_partitions/raw_data/factory_param/factory_param_data.csv>` and :project:`module_config`. The table below lists the names of the platforms (i.e., chip series) supported by the ESP-AT project, the names of the module configurations, and the locations of the corresponding configuration files for each module configuration.
102+
103+
.. list-table::
104+
:header-rows: 1
105+
:widths: 5 10 40
106+
107+
* - Platform
108+
- Module Configuration Name
109+
- Corresponding Default Configuration File
110+
* - ESP32
111+
- WROOM-32
112+
- - :project_file:`module_config/module_esp32_default/sdkconfig.defaults`
113+
- :project_file:`module_config/module_esp32_default/sdkconfig_silence.defaults`
114+
* - ESP32
115+
- PICO-D4
116+
- - :project_file:`module_config/module_esp32_default/sdkconfig.defaults`
117+
- :project_file:`module_config/module_esp32_default/sdkconfig_silence.defaults`
118+
* - ESP32
119+
- SOLO-1
120+
- - :project_file:`module_config/module_esp32_default/sdkconfig.defaults`
121+
- :project_file:`module_config/module_esp32_default/sdkconfig_silence.defaults`
122+
* - ESP32
123+
- MINI-1
124+
- - :project_file:`module_config/module_esp32_default/sdkconfig.defaults`
125+
- :project_file:`module_config/module_esp32_default/sdkconfig_silence.defaults`
126+
* - ESP32
127+
- WROVER-32
128+
- - :project_file:`module_config/module_wrover-32/sdkconfig.defaults`
129+
- :project_file:`module_config/module_wrover-32/sdkconfig_silence.defaults`
130+
* - ESP32
131+
- ESP32-D2WD
132+
- - :project_file:`module_config/module_esp32-d2wd/sdkconfig.defaults`
133+
- :project_file:`module_config/module_esp32-d2wd/sdkconfig_silence.defaults`
134+
* - ESP32
135+
- ESP32-SDIO
136+
- - :project_file:`module_config/module_esp32-sdio/sdkconfig.defaults`
137+
- :project_file:`module_config/module_esp32-sdio/sdkconfig_silence.defaults`
138+
* - ESP32-C2
139+
- ESP32C2-2MB
140+
- - :project_file:`module_config/module_esp32c2-2mb/sdkconfig.defaults`
141+
- :project_file:`module_config/module_esp32c2-2mb/sdkconfig_silence.defaults`
142+
* - ESP32-C2
143+
- ESP32C2-BLE-2MB
144+
- - :project_file:`module_config/module_esp32c2-ble-2mb/sdkconfig.defaults`
145+
- :project_file:`module_config/module_esp32c2-ble-2mb/sdkconfig_silence.defaults`
146+
* - ESP32-C2
147+
- ESP32C2-4MB
148+
- - :project_file:`module_config/module_esp32c2_default/sdkconfig.defaults`
149+
- :project_file:`module_config/module_esp32c2_default/sdkconfig_silence.defaults`
150+
* - ESP32-C3
151+
- MINI-1
152+
- - :project_file:`module_config/module_esp32c3_default/sdkconfig.defaults`
153+
- :project_file:`module_config/module_esp32c3_default/sdkconfig_silence.defaults`
154+
* - ESP32-C3
155+
- ESP32C3-SPI
156+
- - :project_file:`module_config/module_esp32c3-spi/sdkconfig.defaults`
157+
- :project_file:`module_config/module_esp32c3-spi/sdkconfig_silence.defaults`
158+
* - ESP32-C3
159+
- ESP32C3_RAINMAKER
160+
- - :project_file:`module_config/module_esp32c3_rainmaker/sdkconfig.defaults`
161+
- :project_file:`module_config/module_esp32c3_rainmaker/sdkconfig_silence.defaults`
162+
* - ESP32-C6
163+
- ESP32C6-4MB
164+
- - :project_file:`module_config/module_esp32c6_default/sdkconfig.defaults`
165+
- :project_file:`module_config/module_esp32c6_default/sdkconfig_silence.defaults`
166+
167+
.. note::
168+
169+
- When the ``silence mode`` in :ref:`python build.py install <esp-at-install-env>` is ``0``, the default sdkconfig corresponding to the module is ``sdkconfig.defaults``.
170+
- When the ``silence mode`` in :ref:`python build.py install <esp-at-install-env>` is ``1``, the default sdkconfig corresponding to the module is ``sdkconfig_silence.defaults``.
140171

141-
Firstly, enter ``module_config`` folder, and create a new folder to store all the configuration files for your module. Note that the folder name should be in lower case. Then, add the configuration files in the new folder: IDF_VERSION, at_customize.csv, partitions_at.csv, sdkconfig.defaults, and sdkconfig_silence.defaults.
172+
Firstly, enter ``module_config`` folder, and create a new folder to store all the configuration files for your module. Note that the folder name should be in lower case. Then, add the configuration files in the new folder: IDF_VERSION, patch, at_customize.csv, partitions_at.csv, sdkconfig.defaults, and sdkconfig_silence.defaults.
142173

143-
In this example, we copy the ``module_esp32_default`` folder as well as the files within it and rename it as ``module_wroom32-sdio``. The copied IDF_VERSION, at_customize.csv, and partitions_at.csv do not need any modification in our case. We only need to modify the sdkconfig.defaults and sdkconfig_silence.defaults:
174+
In this example, we copy the ``module_{IDF_TARGET_PATH_NAME}_default`` folder as well as the files within it and rename it as ``module_{IDF_TARGET_PATH_NAME}-user-defined``. The copied IDF_VERSION, patch, at_customize.csv, and partitions_at.csv do not need any modification in our case. We only need to modify the sdkconfig.defaults and sdkconfig_silence.defaults:
144175

145-
- Modify the two files to use the partition table in the ``module_wroom32-sdio`` folder as follows:
176+
- Modify the two files to use the partition table in the ``module_{IDF_TARGET_PATH_NAME}-user-defined`` folder as follows:
146177

147178
::
148179

149-
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="module_config/module_wroom32-sdio/partitions_at.csv"
150-
CONFIG_PARTITION_TABLE_FILENAME="module_config/module_wroom32-sdio/partitions_at.csv"
151-
CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE="module_config/module_wroom32-sdio/at_customize.csv"
180+
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="module_config/module_{IDF_TARGET_PATH_NAME}-user-defined/partitions_at.csv"
181+
CONFIG_PARTITION_TABLE_FILENAME="module_config/module_{IDF_TARGET_PATH_NAME}-user-defined/partitions_at.csv"
182+
CONFIG_AT_CUSTOMIZED_PARTITION_TABLE_FILE="module_config/module_{IDF_TARGET_PATH_NAME}-user-defined/at_customize.csv"
152183

153-
- Modify the two files to use the SDIO configuration and remove the UART configuration as follows:
184+
.. only:: esp32c2 or esp32c3 or esp32c6
154185

155-
- Remove the UART configuration
186+
- Modify the two files to use the SPI configuration and remove the UART configuration as follows:
156187

157-
::
188+
- Remove the UART configuration
189+
190+
::
191+
192+
CONFIG_AT_BASE_ON_UART=n
193+
194+
- Add the SPI configuration
195+
196+
::
158197

159-
CONFIG_AT_BASE_ON_UART=n
198+
CONFIG_AT_BASE_ON_SPI=y
199+
CONFIG_SPI_STANDARD_MODE=y
200+
CONFIG_SPI_SCLK_PIN=6
201+
CONFIG_SPI_MOSI_PIN=7
202+
CONFIG_SPI_MISO_PIN=2
203+
CONFIG_SPI_CS_PIN=10
204+
CONFIG_SPI_HANDSHAKE_PIN=3
205+
CONFIG_SPI_NUM=1
206+
CONFIG_SPI_MODE=0
207+
CONFIG_TX_STREAM_BUFFER_SIZE=4096
208+
CONFIG_RX_STREAM_BUFFER_SIZE=4096
160209

161-
- Add the SDIO configuration
210+
.. only:: esp32 or esp32s2
162211

163-
::
212+
- Add support for :ref:`FileSystem AT commands <FS-AT>` configuration
164213

165-
CONFIG_AT_BASE_ON_SDIO=y
214+
::
215+
216+
CONFIG_AT_FS_COMMAND_SUPPORT=y
166217

167-
After finishing the above steps, you can recompile the ESP-AT project to generate the firmware for your module. In this example, we choose ``PLATFORM_ESP32`` and ``WROOM32-SDIO`` when configuring the project to generate the firmware for it.
218+
After completing the above steps, you can recompile the ESP-AT project to generate the module firmware. In this example, when we compile the AT firmware locally during :ref:`Step 3: Install Environment <esp-at-install-env>`, we can select ``PLATFORM_{IDF_TARGET_CFG_PREFIX}`` and ``{IDF_TARGET_CFG_PREFIX}-USER-DEFINED`` to generate the AT firmware.

docs/en/Compile_and_Develop/esp-at_firmware_differences.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,8 @@ Hardware Differences
562562
563563
.. [#one] UART pins can be customized. See :doc:`How_to_set_AT_port_pin` for details.
564564
565+
.. _support-modules:
566+
565567
Supported Modules
566568
^^^^^^^^^^^^^^^^^
567569

0 commit comments

Comments
 (0)