Is the FreeRTOS in esp-idf utilized to the smallest?
Is the FreeRTOS in esp-idf utilized to the smallest?
Is the FreeRTOS in esp-idf/componnents utilized to the smallest sytem for esp32?
-
- Posts: 15
- Joined: Wed Apr 12, 2017 8:30 pm
Re: Is the FreeRTOS in esp-idf utilized to the smallest?
Can you clarify what you are trying to figure out, or what you mean?
In general, I would say that there is room for ESP-IDF to be better about RAM usage, but also you can slim down ESP-IDF quite a bit through sdkconfig options. Where it comes to Flash, the linker in the esp32 toolchain (ld) does a good job of stripping unused code and data thanks to "-fdata-sections -ffunction-sections" and "-Wl,--gc-sections".
In general, I would say that there is room for ESP-IDF to be better about RAM usage, but also you can slim down ESP-IDF quite a bit through sdkconfig options. Where it comes to Flash, the linker in the esp32 toolchain (ld) does a good job of stripping unused code and data thanks to "-fdata-sections -ffunction-sections" and "-Wl,--gc-sections".
Re: Is the FreeRTOS in esp-idf utilized to the smallest?
Thank you.
I just want to get more RAM on esp32.
Esp32 has 512K RAM, but in fact, only less then 200K can be used by user app(with FreeRTOS).
I want to know how to slim down the RAM userd by esp32 system function and/or FreeRTOS.
I just want to get more RAM on esp32.
Esp32 has 512K RAM, but in fact, only less then 200K can be used by user app(with FreeRTOS).
I want to know how to slim down the RAM userd by esp32 system function and/or FreeRTOS.
-
- Posts: 15
- Joined: Wed Apr 12, 2017 8:30 pm
Re: Is the FreeRTOS in esp-idf utilized to the smallest?
Try building in release mode.
If you're not using WiFi or Bluetooth, disable either or both under "Component config"
If you're only using BLE, not BT Classic, find the "Release DRAM from Classic BT Controller" option and try that out. That's about 30KB according to the documentation for that option.
Under WiFi options, check out "Max number of WiFi dynamic RX buffers" and "Max number of WiFi dynamic TX buffers". You might be able to squeeze another 20-ish KB out of there.
I'm not sure what else to try .. I'm interested to see what other people have to say.
If you're not using WiFi or Bluetooth, disable either or both under "Component config"
If you're only using BLE, not BT Classic, find the "Release DRAM from Classic BT Controller" option and try that out. That's about 30KB according to the documentation for that option.
Under WiFi options, check out "Max number of WiFi dynamic RX buffers" and "Max number of WiFi dynamic TX buffers". You might be able to squeeze another 20-ish KB out of there.
I'm not sure what else to try .. I'm interested to see what other people have to say.
Re: Is the FreeRTOS in esp-idf utilized to the smallest?
Memory is divided into 5 parts. SRAM0-0 (32KB), 0-1(32KB), 0-2(128KB), 1(128KB), 2(200KB).
SRAM0-0 and 0-1 are CPU0 CPU1 instruction cache regions for instructions loaded from flash.
SRAM0-2 is used for instructions too.
SRAM1 and 2 are used for normal malloc's since it's 8bit accessible. Program data, is stored there too. If BT or Wifi are enabled each will reserve 64KB here and will allocate some more at runtime.
I needed a little space too, so I disabled CPU1 which gave me 32KB. You have to use the FreeRTOS functions to malloc in 32bit regions.
Have a look at esp-idf/components/esp32/heap_alloc_caps.c
SRAM0-0 and 0-1 are CPU0 CPU1 instruction cache regions for instructions loaded from flash.
SRAM0-2 is used for instructions too.
SRAM1 and 2 are used for normal malloc's since it's 8bit accessible. Program data, is stored there too. If BT or Wifi are enabled each will reserve 64KB here and will allocate some more at runtime.
I needed a little space too, so I disabled CPU1 which gave me 32KB. You have to use the FreeRTOS functions to malloc in 32bit regions.
Have a look at esp-idf/components/esp32/heap_alloc_caps.c
Re: Is the FreeRTOS in esp-idf utilized to the smallest?
Great!
All the aboves work well.
Is a var declared as const storaged in FLASH?
Or I must add ICACHE_RODATA_ATTR before const?
All the aboves work well.
Is a var declared as const storaged in FLASH?
Or I must add ICACHE_RODATA_ATTR before const?
Re: Is the FreeRTOS in esp-idf utilized to the smallest?
const data is stored in flash by default.
Who is online
Users browsing this forum: No registered users and 73 guests