ESP32-S3: variable(flag) in fixed location of ROM and RAM memory

Kumaresan
Posts: 8
Joined: Thu Oct 13, 2022 8:09 am

ESP32-S3: variable(flag) in fixed location of ROM and RAM memory

Postby Kumaresan » Tue Nov 01, 2022 7:38 am

Hello Team,
How can i add variable(flag) in fixed location of ROM and RAM. Any sample for customized linker and CMake files

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3: variable(flag) in fixed location of ROM and RAM memory

Postby ESP_Sprite » Tue Nov 01, 2022 8:30 am

Generally you don't want to do that... Can you describe what problem you are trying to solve? It sounds like an XY problem to me and there probably is a better way to solve your actual issue.

Kumaresan
Posts: 8
Joined: Thu Oct 13, 2022 8:09 am

Re: ESP32-S3: variable(flag) in fixed location of ROM and RAM memory

Postby Kumaresan » Tue Nov 01, 2022 12:37 pm

Example 1:
in our project,
internal flash - 8MB - esp32-s3-Fn8
external flash - 16MB - Winbond.
During every startup around 32kb of content need to copy from external flash to internal flash(so, here need to allocate 32kb memory in internal flash with fixed location)
Example 2:
We need calculate checksum of application content and need to append end of application file at fixed location.
total application memory allocated assume 0xFFFF, so here, need to checksum calculate during build time and checksumvalue append memory at 0xFFFB.

ESP_Sprite
Posts: 9739
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32-S3: variable(flag) in fixed location of ROM and RAM memory

Postby ESP_Sprite » Tue Nov 01, 2022 11:33 pm

Ah, gotcha. What you'd use in ESP-IDF is a partition of 32K to store the application data in. You can then read and write it using the partition table API, and you can even map the flash (read-only) into memory using spi_flash_mmap().

Who is online

Users browsing this forum: No registered users and 111 guests