This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Dear community
We just migrated our application from the coff ABI to the EABI format.
We set the default Heap to 16384 so it just fits our application needs by using following command in the .cfg SYS/BIOS file:
BIOS.heapSize = 16384;
We built a separate heap Buf for some messages we receive as follows, but we highly doubt, this has something in common with the issue. It's just for completion.
var heapBuf0Params = new HeapBuf.Params(); heapBuf0Params.instance.name = "MessageBuffer"; heapBuf0Params.numBlocks = 8; heapBuf0Params.blockSize = 128; heapBuf0Params.align = 8; Program.global.MessageBuffer = HeapBuf.create(heapBuf0Params);
In the picture below one can see, that the heapMem are set correctly by SYS/BIOS (0x4000 = 16384). But the totalFreeSize is 0 and therefore, the allocation of static generated objects fail and the application reboots.
Furthermore, both heaps are stored in the RAM. We summarized all RAMGSX into one big RAM section. Furthermore, the HeapMem is within the .bss:taskStackSection.
We are wondering, why since the static allocation worked before we migrated to eabi format.
We are using following settings:
- runtime-library: rts2800_fpu32_eabi.lib (we used libc.a in coff format)
- SYS/BIOS 6.83.0.18
- XDC-tools 3.62.1.16_core
- Compiler TI. v22.6.1.LTS
If heapStd is added in the SYS/BIOS config file, the application starts and we get into the main, which means it could allocate static created objects. Also it can be seen, that the heapMem object has a totalFreeSize of about 0x3D7A or something similar. There are some allocated objects, but should have plenty space left.
var HeapStd = xdc.useModule('xdc.runtime.HeapStd');
However, if dynamic created objects are created, after a while our application runs out of heap memory and it resets (according to the screenshot). A research on this forum said, that adding heapStd into the .cfg file overwrites the SYS/BIOS malloc functions by the "normal" runtime function malloc. So this cannot be the solution. Also we want to SYS/BIOS take care of the heap. When heapStd implemented, the malloc function of SYS/BIOS is not in the map file, this is the logical consequence.
There are some questions we raised ourselves:
- How does the migration to EABI influence the heap allocation behaviour of SYS/BIOS?
- Did we miss something to include? Is the rts2800_fpu32_eabi.lib maybe wrong?
- Did we forget to add an underline at any point so an important object is not created in the map file?
Best regards, Robert
I imported the SYS/BIOS "memory" example and tried playing with it a bit. Switching from coff to EABI didn't cause any difference in behavior. Reviewing the COFF to EABI migration guide doesn't raise likely causes for me, although you could try playing with some of the related settings like toggling --zero_init=off to see if it makes any difference.
Have you tried seeing if turning off optimization makes any difference (if you have the flash space to try it)? You of course should be able to keep it on, but it might help us narrow down the cause of the issue if it makes a difference.
May I ask the motivation for porting to EABI? Are there EABI features that you're hoping to use?
Whitney
Hi Whitney
Thanks for the reply. I feared your answer. We of course followed the migration guide, but there is no hint if the application uses SYS/BIOS or is implemented bare-metal. Theoretically it should not make any difference. I played around with the settings --zero_init, unused_sections_elimination and more and it did not work out. I did not try disabling optimizations, I doubt we have enough space, but reducing to level 1 or 2 might be possible.
Our motivation is to use ROV, have fast integer division and more importantly, the coff format won't be supported in future, isn't it?
Where do I find the SYS/BIOS example?
Regards, Robert
Hi Robert--Thanks for your patience. I was out of the office last week.
There are instructions here on how to find and import SYS/BIOS examples. Look for one called "memory."
I believe CCS still allows you to use ROV Classic which works with coff. It can still display a lot of the same information as the newer ROV.
Whitney