Improve documentation around SPIRAM_USE_MALLOC versus SPIRAM_USE_MMAP on esp32.
Opened this issue · 1 comments
mocleiri commented
For implementing person detection we got a change made in upstream micropython so that building the firmware using the SPIRAM_USE_MALLOC=y sdk config enables a sharing PSRAM mode where 1/2 of PSRAM goes into the Micropython Heap and the other 1/2 is available for other idf components.
For esp32s3 accelerated ops a scratch pad is also allocated and if your model is large enough you would want it allocated from PSRAM instead of DRAM.
Lets change the ESP32 documentation for person detection but also for ESP32 at the top level should add a section about this option.
MichaelDu9226 commented
Hi @mocleiri This is my step
- Under this branch, https://github.com/mocleiri/tensorflow-micropython-examples/tree/feature/9-add-accelerated-esp-tflm-kernels
- Merge this bugfix into esp-nn espressif/esp-tflite-micro#11
- Refer to this pull, edit micropython/ports/esp32/main.chttps://github.com/micropython/micropython/pull/8219. Maybe updating micropython submodule is a better way
- Based on my board, config esp32 s3 SPIRAM to CONFIG_SPIRAM_MODE_OCT=y & CONFIG_SPIRAM_USE_MALLOC=y
- Custom sd card support in micropython, save model into sd card, run dectection.py. Remember edit bytearray of model and tensor_area_len.
- The attached file is my custom model and detection.py
custom_model.zip
.