Skip to content

Conversation

bugadani
Copy link
Contributor

@bugadani bugadani commented Oct 15, 2025

As the reclaimed RAM is a consequence of the esp-idf bootloader, this PR adds documentation, and gates the ram(reclaimed) attributed by esp-bootloader-esp-idf.

@bugadani bugadani added the skip-changelog No changelog modification needed label Oct 15, 2025
reserved_rom_stack_app : ORIGIN = 0x3ffe5230, len = 11264

dram2_seg : ORIGIN = 0x3ffe7e30, len = 98767 /* the rest of DRAM after the rom data segments and rom stacks in the middle */
dram2_seg : ORIGIN = 0x3ffe7e30, len = 98768 /* the rest of DRAM after the rom data segments and rom stacks in the middle */
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off by one, new length now places the end at exactly 0x40000000

@bugadani
Copy link
Contributor Author

bugadani commented Oct 15, 2025

This PR, especially adding chip features to esp-alloc seems entirely unreasonable. The data itself is pretty useful, though, as nothing really documents how much memory can be used. Should we maybe add the sizes to somewhere in the readme, similar to the peripheral support table?

@bjoernQ
Copy link
Contributor

bjoernQ commented Oct 15, 2025

Maybe a first step to (some day) have all the relevant information to generate memory.x

Should we maybe add the sizes to somewhere in the readme, similar to the peripheral support table?

I first thought we could just list it for all chips in the docs but we usually don't do that, so the README might be a better idea?

@bugadani
Copy link
Contributor Author

bugadani commented Oct 15, 2025

We can also have a constant in esp-hal or esp-bootloader-esp-idf so that the users don't have to know the value, or they/we can simplify supporting multiple devices.

Listing the info on the ram macro should be all right as well - it is indeed a bit out of place, but that's not a big deal.

@bjoernQ
Copy link
Contributor

bjoernQ commented Oct 15, 2025

We can also have a constant in esp-hal or esp-bootloader-esp-idf so that the users don't have to know the value, or they/we can simplify supporting multiple devices.

Interesting idea - probably esp-bootloader-esp-idf would be a good place for that

@bugadani
Copy link
Contributor Author

Can we somehow get esp-bootloader-esp-idf to create the memory region for the linker scripts?

@bjoernQ
Copy link
Contributor

bjoernQ commented Oct 15, 2025

Can we somehow get esp-bootloader-esp-idf to create the memory region for the linker scripts?

That should work, yes

@bjoernQ
Copy link
Contributor

bjoernQ commented Oct 16, 2025

Can we somehow get esp-bootloader-esp-idf to create the memory region for the linker scripts?

We can just add our out directory to the to the search-path and create memory.x there - linkall.x will include it

The only "drawback" is users will get a slightly confusing linker error (file not found) - maybe we could use SEARCH_DIR to append to the search path and provide a memory.x with just an assert telling the user they need a bootloader support crate 🤔

@bugadani bugadani force-pushed the dram2 branch 2 times, most recently from 7ec9996 to 5c9971d Compare October 17, 2025 11:59
@bugadani
Copy link
Contributor Author

I didn't do the linker script changes, but now it's the bootloader crate that enables the attribute, and documents the available memory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog No changelog modification needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants