Skip to content

Commit c376474

Browse files
committed
docs: FAQ for moving BSS segments to PSRAM for reduced internal memory usage
Also, updated the formatting, moved the links at the bottom. Removed the redundancy which in mentioning raising the github issue. Removed the qr-code rendering faq as we do not showcase it in the firmware.
1 parent 23a9466 commit c376474

File tree

1 file changed

+83
-99
lines changed

1 file changed

+83
-99
lines changed

docs/en/faq.rst

+83-99
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,14 @@ A1.1 Compilation errors
66

77
I cannot build the application:
88

9-
- Make sure you are on the correct esp-idf branch/release. Run ``git submodule
10-
update —init —recursive`` to make sure the submodules are at the
11-
correct heads
12-
- Make sure you have the correct ESP_MATTER_PATH (and any other required paths).
13-
- Delete the build/ directory and also sdkconfig and sdkconfig.old and
9+
- Make sure you are on the correct esp-idf branch/release.
10+
- Run ``git submodule update —init —recursive`` to make sure the submodules are at the
11+
correct heads.
12+
- Make sure you have the correct ``ESP_MATTER_PATH`` (and any other required paths).
13+
- Delete the ``build/`` directory and also ``sdkconfig`` and ``sdkconfig.old`` and
1414
then build again.
1515
- If you are still facing issues, reproduce it on the default
16-
example and then raise it `here <https://github.com/espressif/esp-matter/issues>`__. Please make sure to
17-
share these:
18-
19-
- The complete device logs taken over UART.
20-
- The esp-matter and esp-idf branch you are using.
16+
example and then raise a `Github issue`_.
2117

2218
A1.2 Device commissioning using chip-tool
2319
-----------------------------------------
@@ -26,18 +22,12 @@ I cannot commission a new device through the chip-tool:
2622

2723
- If the ``chip-tool pairing ble-wifi`` command is failing,
2824
make sure the arguments are correct.
25+
- Please check ``chip-tool pairing ble-wifi --help`` for argument help.
2926
- Make sure Bluetooth is turned on, on your client (host).
30-
- If you are still facing issues, reproduce it on the default
31-
example for the device and then raise it `here <https://github.com/espressif/esp-matter/issues>`__. Make sure
32-
to share these:
33-
34-
- The complete device logs.
35-
- The complete chip-tool logs.
36-
- The esp-matter and esp-idf branch you are using.
3727

3828
Bluetooth/BLE does not work on by device:
3929

40-
- There are some `known issues <https://github.com/project-chip/connectedhomeip/issues/13303>`__ where BLE does not work on MacOS.
30+
- There is a known issues `#13303`_ where BLE does not work on MacOS.
4131
- In this case, the following can be done:
4232

4333
- Run the device console command:
@@ -46,12 +36,7 @@ Bluetooth/BLE does not work on by device:
4636
``chip-tool pairing onnetwork 0x7283 20202021``.
4737

4838
- If you are still facing issues, reproduce it on the default
49-
example for the device and then raise it `here <https://github.com/espressif/esp-matter/issues>`__. Make sure
50-
to share these:
51-
52-
- The complete device logs taken over UART.
53-
- The complete chip-tool logs.
54-
- The esp-matter and esp-idf branch you are using.
39+
example for the device and then raise a `Github issue`_.
5540

5641
A1.3 Device crashing
5742
--------------------
@@ -66,31 +51,20 @@ My device is crashing:
6651
- Make sure you are on the correct esp-idf branch. Run ``git submodule
6752
update —init —recursive`` to make sure the submodules are at the
6853
correct heads.
69-
- Make sure you have the correct ESP_MATTER_PATH (and any other paths)
54+
- Make sure you have the correct ``ESP_MATTER_PATH`` (and any other paths)
7055
is (are) exported.
71-
- Delete the build/ directory and also sdkconfig and sdkconfig.old and
56+
- Delete the ``build/`` directory and also ``sdkconfig`` and ``sdkconfig.old`` and
7257
then build and flash again.
7358
- If you are still facing issues, reproduce it on the default
74-
example for the device and then raise it `here <https://github.com/espressif/esp-matter/issues>`__. Make sure
75-
to share these:
59+
example for the device and then raise a `Github issue`_. Along with the
60+
details mentioned in the issue template, please share the following details:
7661

7762
- The steps you followed to reproduce the issue.
78-
7963
- The complete device logs taken over UART.
80-
81-
-
82-
83-
.. raw:: html
84-
85-
<example>
86-
87-
.elf file from the build/ directory.
88-
64+
- The .elf file from the build/ directory.
8965
- If you have gdb enabled, run the command ``backtrace`` and share the
9066
output of gdb too.
9167

92-
- The esp-matter and esp-idf branch you are using.
93-
9468
A1.4 Device not crashed but not responding
9569
------------------------------------------
9670

@@ -101,27 +75,14 @@ My device is not responding to commands:
10175
- Make sure the node_id and the endpoint_id are correct in the command
10276
from chip-tool.
10377
- If you are still facing issues, reproduce it on the default
104-
example for the device and then raise it `here <https://github.com/espressif/esp-matter/issues>`__. Make sure
105-
to share these:
78+
example for the device and then raise a `Github issue`_. Along with the
79+
details mentioned in the issue template, please share the following details:
10680

10781
- The steps you followed to reproduce the issue.
10882
- The complete device logs taken over UART.
109-
- The esp-matter and esp-idf branch you are using.
110-
111-
A1.5 QR code not rendering
112-
--------------------------
11383

114-
The QR code on my device console is not rendering properly:
11584

116-
- Check the below lines on your terminal and copy paste the given URL
117-
in a browser:
118-
119-
::
120-
121-
If QR code is not visible, copy paste the URL in a browser:
122-
https://project-chip.github.io/connectedhomeip/qrcode.html?data=....
123-
124-
A1.6 Onboard LED not working
85+
A1.5 Onboard LED not working
12586
----------------------------
12687

12788
The LED on my devkit is not working:
@@ -131,16 +92,12 @@ The LED on my devkit is not working:
13192
path.
13293
- Check the version of your board, and if it has the LED connected to a
13394
different pin. If it is different, you can change the
134-
led_driver_config_t accordingly in the device.c file.
95+
``led_driver_config_t`` accordingly in the ``device.c`` file.
13596
- If you are still facing issues, reproduce it on the default
136-
example for the device and then raise it `here <https://github.com/espressif/esp-matter/issues>`__. Make sure
137-
to share these:
97+
example for the device and then raise a `Github issue`_.
13898

139-
- The complete device logs taken over UART.
140-
- The esp-matter and esp-idf branch you are using.
141-
- The devkit and its version that you are using.
14299

143-
A1.7 Using Rotating Device Identifier
100+
A1.6 Using Rotating Device Identifier
144101
-------------------------------------
145102

146103
What is Rotating Device Identifier:
@@ -179,25 +136,15 @@ Difference between Rotating ID Unique ID and Unique ID
179136
- it SHALL not be identical to the SerialNumber attribute
180137
- it SHALL not be printed on the product or delivered with the product
181138

182-
The value does not need to be human readable.
183139

184-
**Also check the "Appendix FAQs" sections of the respective examples.**
185-
186-
- :project_file:`Light <examples/light/README.md>`
187-
- :project_file:`Light Switch <examples/light_switch/README.md>`
188-
- :project_file:`Zap Light <examples/zap_light/README.md>`
189-
- :project_file:`Zigbee Bridge <examples/bridge_apps/zigbee_bridge/README.md>`
190-
- :project_file:`BLE Mesh Bridge <examples/bridge_apps/blemesh_bridge/README.md>`
191-
192-
A1.8 ModuleNotFoundError: No module named 'lark'
140+
A1.7 ModuleNotFoundError: No module named 'lark'
193141
------------------------------------------------
194142

195143
Encountering the above error while building the esp-matter example could indicate that the steps outlined in the
196-
`getting the repository <https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html#getting-the-repositories>`__
197-
section of the documentation were not properly followed.
144+
`getting the repository`_ section of the documentation were not properly followed.
198145

199146
The esp-matter example relies on several python dependencies that can be found in the
200-
`requirements.txt <https://github.com/espressif/esp-matter/blob/main/requirements.txt>`__.
147+
:project_file:`requirements.txt <requirements.txt>`.
201148
These dependencies must be installed into the python environment of the esp-idf to ensure that the example builds successfully.
202149

203150
One recommended approach to installing these requirements is by running the command
@@ -217,26 +164,26 @@ However, if the error persists, you can try the following steps to resolve it:
217164
idf.py build
218165

219166

220-
A1.9 Why does free RAM increase after first commissioning
167+
A1.8 Why does free RAM increase after first commissioning
221168
---------------------------------------------------------
222169

223170
After the first commissioning, you may notice that the free RAM increases. This is because, by default,
224171
BLE is only used for the commissioning process. Once the commissioning is complete, BLE is deinitialized,
225172
and all the memory allocated to it is recovered. Here's the link to the
226-
`implementation <https://github.com/espressif/esp-matter/blob/c52fa686d1a3be275b0a5c872ee5f1a3c8f2420d/components/esp_matter/esp_matter_core.cpp#L859-L891>`__ which frees the BLE memory.
173+
:project_file:`implementation which frees the BLE memory <components/esp_matter/esp_matter_core.cpp#L859-L891>`.
227174

228175
However, if you want to continue using the BLE even after the commissioning process, you can disable the
229176
``CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING``. This will ensure that the memory allocated to the BLE functionality
230177
is not released after the commissioning process, and the free RAM won't go up.
231178

232-
A1.10 How to generate Matter Onboarding Codes (QR Code and Manual Pairing Code)
233-
-------------------------------------------------------------------------------
179+
A1.9 How to generate Matter Onboarding Codes (QR Code and Manual Pairing Code)
180+
------------------------------------------------------------------------------
234181

235182
When creating a factory partition using ``esp-matter-mfg-tool``, both the QR code and manual pairing codes are generated.
236183

237184
Along with that, there are two more methods for generating Matter onboarding codes:
238185

239-
- Python script: `generate_setup_payload.py <https://github.com/project-chip/connectedhomeip/tree/master/src/setup_payload/python>`__.
186+
- Python script: `generate_setup_payload.py`_
240187

241188
::
242189

@@ -263,10 +210,10 @@ Along with that, there are two more methods for generating Matter onboarding cod
263210
--vendor-id 0xFFF1 --product-id 0x8004 \
264211
--version 0 --commissioning-mode 1
265212

266-
To create a QR code image, copy the QR code text and paste it into
267-
`CHIP: QR Code <https://project-chip.github.io/connectedhomeip/qrcode.html>`__.
213+
To create a QR code image, copy the QR code text and paste it into `CHIP QR Code`_.
214+
268215

269-
A1.11 Chip stack locking error ... Code is unsafe/racy
216+
A1.10 Chip stack locking error ... Code is unsafe/racy
270217
------------------------------------------------------
271218

272219
::
@@ -304,12 +251,11 @@ To address this, there are two possible approaches:
304251
chip::DeviceLayer::PlatformMgr().ScheduleWork(WorkHandler, <intptr_t>(nullptr));
305252

306253

307-
A1.12 Firmware Version Number
254+
A1.11 Firmware Version Number
308255
-----------------------------
309256

310257
Similar to the ESP-IDF's application versioning scheme, the ESP-Matter SDK provides two options for setting the firmware
311-
version. It depends on `CONFIG_APP_PROJECT_VER_FROM_CONFIG <https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-app-project-ver-from-config>`__
312-
option and by default option is disabled.
258+
version. It depends on `CONFIG_APP_PROJECT_VER_FROM_CONFIG`_ option and by default option is disabled.
313259

314260
If the ``CONFIG_APP_PROJECT_VER_FROM_CONFIG`` option is disabled, you need to set the version and version string by
315261
defining the CMake variables in the project's ``CMakeLists.txt`` file. All the examples use this scheme and have these
@@ -339,7 +285,7 @@ the following configuration options:
339285
version, even though the binary content may match the previous OTA image.
340286

341287

342-
A1.13 Stuck at "Solving dependencies requirements ....."
288+
A1.12 Stuck at "Solving dependencies requirements ....."
343289
--------------------------------------------------------
344290

345291
When building an example, if it is stuck at "Solving dependencies requirements..."
@@ -354,12 +300,12 @@ you can resolve this issue by clearing the component manager cache.
354300
rm -rf ~/Library/Caches/Espressif/ComponentManager
355301

356302

357-
A1.14 ESP32-C2 log garbled, unable to perform Matter commissioning and other abnormal issues
303+
A1.13 ESP32-C2 log garbled, unable to perform Matter commissioning and other abnormal issues
358304
--------------------------------------------------------------------------------------------
359305

360306
When encountering the above issues, the following possible causes may exist:
361-
1. Incorrect baud rate settings. See `UART console baud rate <https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig.html#config-esp-console-uart-baudrate>`__.
362-
2. Incorrect XTAL crystal frequency settings. The default XTAL crystal frequency in the SDK examples is 26 Mhz, if the ESP32-C2 board used for testing is 40 MHz, please change the configuration as `CONFIG_XTAL_FREQ_40=y`. See `Main XTAL frequency <https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig.html#main-xtal-config>`__. You can check the XTAL frequency with this command.
307+
1. Incorrect baud rate settings. See `UART console baud rate`_
308+
2. Incorrect XTAL crystal frequency settings. The default XTAL crystal frequency in the SDK examples is 26 Mhz, if the ESP32-C2 board used for testing is 40 MHz, please change the configuration as `CONFIG_XTAL_FREQ_40=y`. See `Main XTAL frequency`_ You can check the XTAL frequency with this command.
363309

364310
::
365311

@@ -373,7 +319,7 @@ When encountering the above issues, the following possible causes may exist:
373319
Crystal is 26MHz
374320
MAC: 08:3a:8d:49:b3:90
375321

376-
A1.15 Generating Matter Onboarding Codes on the device itself
322+
A1.14 Generating Matter Onboarding Codes on the device itself
377323
-------------------------------------------------------------
378324

379325
The Passcode serves as both proof of possession for the device and the shared secret needed to establish
@@ -383,7 +329,7 @@ For best practices in Passcode generation and storage on the device, refer to
383329
**Section 5.1.7: Generation of the Passcode** in the Core Matter Specification.
384330

385331
Ideally, devices should only store the Spake2p verifier, not the Passcode itself.
386-
If the Passcode is stored on the device, it must be physically separated from the Spake2p verifiers location
332+
If the Passcode is stored on the device, it must be physically separated from the Spake2p verifier's location
387333
and must be accessible only through local interface and must not be accessible to the unit handling the
388334
Spake2p verifier.
389335

@@ -396,15 +342,11 @@ along with the corresponding Spake2p verifier and onboarding payload, directly o
396342

397343
Please check `#1128`_ and `#1126`_ for relevant discussion on Github issue
398344

399-
.. _`#1126`: https://github.com/espressif/esp-matter/issues/1126
400-
.. _`#1128`: https://github.com/espressif/esp-matter/issues/1128
401-
402-
403-
A1.16 Using BLE after Matter commissioning
345+
A1.15 Using BLE after Matter commissioning
404346
------------------------------------------
405347

406348
Most Matter applications do not require BLE after commissioning. By default, BLE is deinitialized after commissioning
407-
to reclaim RAM and increase the available free heap. Refer to `A1.9 Why does free RAM increase after first commissioning`_
349+
to reclaim RAM and increase the available free heap. Refer to `A1.8 Why does free RAM increase after first commissioning`_
408350
for more details.
409351

410352
However, if BLE functionality is needed even after commissioning, you can disable the ``CONFIG_USE_BLE_ONLY_FOR_COMMISSIONING``
@@ -435,10 +377,52 @@ Please refer to the `advance setup`_ section in the programming guide.
435377
This has been demonstrated in the `blemesh_bridge`_ and `light_wifi_prov`_ examples.
436378

437379

380+
A1.16 Moving BSS Segments to PSRAM to Reduce Memory Usage
381+
---------------------------------------------------------
382+
383+
The BSS section of libesp_matter.a and libCHIP.a can consume significant internal memory.
384+
For devices with PSRAM, you can move the BSS segments to external memory to significantly
385+
reduce the internal memory footprint.
386+
387+
To move the BSS segments of libCHIP.a and libesp_matter.a into external RAM:
388+
389+
1. Enable the ``CONFIG_ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY`` option in menuconfig.
390+
391+
2. Create a ``linker.lf`` file in your project's main component, you can check the the example
392+
:project_file:`linker.lf <examples/all_device_types_app/main/linker.lf>` file.
393+
394+
3. Modify your main component's ``CMakeLists.txt`` to include:
395+
396+
::
397+
398+
set(ldfragments linker.lf)
399+
idf_component_register(
400+
...
401+
LDFRAGMENTS "${ldfragments}")
402+
403+
This configuration will move the BSS segments to PSRAM when ``CONFIG_ESP_ALLOW_BSS_SEG_EXTERNAL_MEMORY`` is enabled,
404+
significantly reducing the internal memory usage of your application.
405+
406+
Please check `#1123`_ for relevant discussion on Github issue.
407+
438408
.. _bleprph: https://github.com/espressif/esp-idf/tree/b5ac4fbdf9e9fb320bb0a98ee4fbaa18f8566f37/examples/bluetooth/nimble/bleprph
439409
.. _blecent: https://github.com/espressif/esp-idf/tree/b5ac4fbdf9e9fb320bb0a98ee4fbaa18f8566f37/examples/bluetooth/nimble/blecent
440410
.. _bleprph_advertise(): https://github.com/espressif/esp-idf/blob/b5ac4fbdf9e9fb320bb0a98ee4fbaa18f8566f37/examples/bluetooth/nimble/bleprph/main/main.c#L146
441411
.. _blecent_scan(): https://github.com/espressif/esp-idf/blob/b5ac4fbdf9e9fb320bb0a98ee4fbaa18f8566f37/examples/bluetooth/nimble/blecent/main/main.c#L435
442412
.. _advance setup: https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html#advanced-setup
443413
.. _blemesh_bridge: https://github.com/espressif/esp-matter/tree/main/examples/bridge_apps/blemesh_bridge
444414
.. _light_wifi_prov: https://github.com/espressif/esp-matter/tree/main/examples/light_wifi_prov#4-external-platform
415+
.. _getting the repository: https://docs.espressif.com/projects/esp-matter/en/latest/esp32/developing.html#getting-the-repository
416+
.. _requirements.txt: https://github.com/espressif/esp-matter/blob/main/requirements.txt
417+
.. _implementation which frees the BLE memory: https://github.com/espressif/esp-matter/blob/c52fa686d1a3be275b0a5c872ee5f1a3c8f2420d/components/esp_matter/esp_matter_core.cpp#L859-L891
418+
.. _generate_setup_payload.py: https://github.com/project-chip/connectedhomeip/tree/master/src/setup_payload/python
419+
.. _CHIP QR Code: https://project-chip.github.io/connectedhomeip/qrcode.html
420+
.. _CONFIG_APP_PROJECT_VER_FROM_CONFIG: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/kconfig.html#config-app-project-ver-from-config
421+
.. _UART console baud rate: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig.html#config-esp-console-uart-baudrate
422+
.. _Main XTAL frequency: https://docs.espressif.com/projects/esp-idf/en/latest/esp32c2/api-reference/kconfig.html#main-xtal-config
423+
424+
.. _Github issue: https://github.com/espressif/esp-matter/issues/new?template=issue-template.md
425+
.. _`#1123`: https://github.com/espressif/esp-matter/issues/1123
426+
.. _`#1126`: https://github.com/espressif/esp-matter/issues/1126
427+
.. _`#1128`: https://github.com/espressif/esp-matter/issues/1128
428+
.. _`#13303`: https://github.com/project-chip/connectedhomeip/issues/13303

0 commit comments

Comments
 (0)