-->
Page 2 of 3

Re: Freeing up some iram0

PostPosted: Sun Jul 12, 2015 3:02 am
by cal
The ROM contains some floating point stuff, too.
Using those has the additional advantage that its interrupt safe.

Cal

Re: Freeing up some iram0

PostPosted: Wed Jul 15, 2015 8:20 am
by eriksl
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.

Re: Freeing up some iram0

PostPosted: Wed Jul 15, 2015 8:21 am
by eriksl
cal wrote:The ROM contains some floating point stuff, too.
Using those has the additional advantage that its interrupt safe.

That code is used automatically, the symbols from the rom are pulled in at the bottom of the ld scripts.

Re: Freeing up some iram0

PostPosted: Wed Jul 15, 2015 3:06 pm
by jcmvbkbc
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.