eriksl wrote:With -ffunction-sections you get each function in its own section...
For MY code. But MY code is not the problem. The code in the libraries is the problem. I don't have functions in iram0. As long as the libraries (gcc/c) are not properly divided over iram and irom, this will remain a problem.
I think gcc libraries and libc are written in the spirit of C, i.e. one function per source file, which makes the result equivalent to one achievable with -ffunction-sections. But feel free to submit patches for the gcc/libc anyway.
Regarding IRAM/FLASH division, I think it must start in the SDK, clearly separating IRAM-only code from the rest, then clearly marking callback functions as IRAM-only. Then applications may have some hope to automate moving the rest of code to IRAM or FLASH. Without that I can only think of manual case-by-case function moving. Or some hacks like that:
https://github.com/anakod/Sming/blob/ma ... rq_check.s applicable only to our code again.
Maybe somebody should suggest SDK developers to think about doing that.