Advanced Users can post their questions and comments here for the not so Newbie crowd.

Moderator: eriksl

User avatar
By eriksl
#81343 I have fought with this for years, because all my functions (about 200-300, less about 10) need to go to IROM (flash) not IRAM. I have had all these functions prefixed with "irom" (#defined to section "irom0.test") and of course forgot one or two occasionally and then IRAM space magically disappeared.

I know some projects have managed to have all functions end up in IROM by default so I knew it would be possible and dove into it.

All sources say you can't fix this in the compiler (for a complete source file), that's a pity, it would be the neatest solution IMHO.

But you can do it in the linker script. You can't say: put all references to .text.* into IROM, because all libraries assume .text functions go to IRAM. It will make your image crash. So I've done some experimenting, got it working, in a few steps also less and less complex. I think I now have the simplest solution (but feedback appreciated).

1) add to linker script, in the "irom0_0_seg" segment section the following line (exact position isn't that important):
Code: Select all      :*.o(.literal .text .literal.* .text.*)


2) add to linker script, in the "iram1_0_seg" segment section the following line (exact position isn't that important):
Code: Select all      :*.o(.iram_text .iram_text.*)


3) define this macro and use it where appropriate:
Code: Select all#define iram __attribute__((section(".iram_text")))


That should be enough, really!
User avatar
By davydnorris
#81349 I found it a bit strange that the RTOS SDK does this by default, while the NonOS SDK is exactly the opposite.

There's a lot I want to do to make things consistent between the two, but then Espressif's admission that they are going to EOL the NonOS SDK makes me wonder if it's worth it.
User avatar
By eriksl
#81381 I think it's one of the things I just referred to in another post; at some point they decide to go in another direction but never cleanup the old approach. In this case, indeed, they should have adjusted the sources for this + load script. I think it can be done in one hour's work.

BTW they have been saying to end support for NONOS for some time now, I think over a year. Still the last commit is from a few weeks ago.

I think they mostly mean no new features will be added. I am perfectly fine with that. All non-WLAN-specific features I can really make myself (and I'd prefer that) and the WLAN stuff is working sufficiently for me.

The only thing that would make me really happy is if they'd open up the sources, I'd happily take the burden for maintenance then ;-) I'm afraid it'll be a rewrite then...