Tool/software:
Hi,
As per my understanding, there are two options for creating a function in RAM:
- __attribute__((ramfunc))
- #pragma CODE_SECTION(ramFuncA, ".TI.ramfunc")
However, both approaches result in different memory allocations.
sharing the sample for the reference
int ramFuncA(int x) { int i = 0; for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} for(i = 0; i < x; i++){} return x * x; }
- Using __attribute__((ramfunc)), results in a memory allocation of 87 bytes.
- Using #pragma CODE_SECTION(ramFuncA, ".TI.ramfunc"); results in a memory allocation of 67 bytes.
Could you please explain why these two methods produce different results? I'd appreciate any insights you can provide.