How do I use extram_bss in CMakeLists?

jsam589
Posts: 74
Joined: Sat Aug 17, 2019 9:31 pm

How do I use extram_bss in CMakeLists?

Postby jsam589 » Wed Feb 02, 2022 11:37 pm

The API guide for external RAM mentions that extram_bss "linker fragment scheme" can be used to force all bss of a component into external RAM. Can someone show the code syntax to use this technique? I am on 4.0 and 4.4 IDFs using cmake.

Here is an example CMakeLists.txt for one of my application components:

Code: Select all

set(srcs "ca_wifi.c" "wifi_scan.c" "ble_init.c" "gatt_svr.c")

idf_component_register(SRCS "${srcs}"
            INCLUDE_DIRS "." "../../main/include"
            "../bme680/include" 
            "../ca_drivers/include" "../ca_sound/include"           
            "../mqtt/include" "../partition_mgt/include" 
            REQUIRES spiffs fatfs bt nvs_flash app_update esp-tls 
            esp_adc_cal port mqtt)

franzhoepfinger
Posts: 21
Joined: Wed Mar 04, 2020 7:14 pm

Re: How do I use extram_bss in CMakeLists?

Postby franzhoepfinger » Sun Apr 03, 2022 11:03 am

seem to be a Typo in Wiki.

.ext_ram.bss

seem to be the right one.

EXT_RAM_ATTR definition points to _SECTION_ATTR_IMPL(".ext_ram.bss", __COUNTER__)

matsumoto
Posts: 2
Joined: Fri Oct 14, 2022 3:13 pm

Re: How do I use extram_bss in CMakeLists?

Postby matsumoto » Thu Aug 29, 2024 2:24 pm

Hi,

you have to create a linker fragment file and tell CMake where it is within your CMakeLists.txt.

See ESP-IDF API - Linker Script Generation. There you can also read about the different schemes and how to create your own.

See also ESP-IDF/components/esp_system/app.lf for the "default" scheme, which is used for all archives (components) and object files (source files) by default.

Best regards.

Who is online

Users browsing this forum: Google [Bot] and 110 guests