Tool/software:
Hello,
we use the MCU PLUS SDK 09.02, since the industrial comms SDK also uses this one. the current industrial comms sdk version we use is 09.02.00.15.
in a thread with the help of George, I did find out how to "overwrite" sdk.functions with our own implementations: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1383392/mcu-plus-sdk-am243x-not-stripping-symbol-x-because-it-is-named-in-a-relocation/5313715?tisearch=e2e-sitesearch&keymatch=%2525252525252520user%252525252525253A453845#5313715
This worked pretty fine all the time. SO in general we did overwrite the abort-handlers with our own implementation. This worked by providing the implementation AND the sdk-files (copied) additionally in our application-build. When linking the sdk, in this case the freertos-library of the sdk, our abort-handlers were used. The thing is that our implementation will call c++-code and thus is placed inside a .cpp-file (surrounded with extern "C").
It looks like this in the sdk:
and like this in our folder:
where the "TIAbortImplTIFREERTOS.cpp" contains the copied code of the HwiP_armv7r_handlers_freertos.c-file. (with the extern "C" around and calls to C++-code).
The section .text.hwi is placed in the TCMA like this:
GROUP { .text.hwi: palign(8) } > MCU1_0_TCMA
As already said that worked pretty fine. But we noticed as soon as we directly link the freeRtos-library in the linker-script like this:
GROUP { .code: { -l "freertos.am243x.r5f.ti-arm-clang.debug.lib"(.text), } } > MCU1_0_SRAM_DATA
the whole .text.hwi-section is also moved there and is NOT placed in the TCMA and our whole abort-handler implementations are not present. It uses the one from the freertos-library. That's also noticable in the map-file.
we tried it like this:
GROUP { .text.hwi: { *(.text.hwi), } palign(8) } > MCU1_0_TCMA
but that's also not working.
It only seems to work if we place it explicitly like this:
GROUP { .text.hwi: { -l "libti-implementation-mcu1_0.a"(.text.hwi), } palign(8) } > MCU1_0_TCMA
We made sure that the freertos.am243x.r5f.ti-arm-clang.debug.lib is linked at last in our linking-order.
What's the explanation for this behaviour and is there a way around to prevent explicitly linking the library again in the linker-script? The point is that the whole package which also includes the sdk and our implementations is used by multiple projects and we do not want to modify every linker-script in every project if the freertos-library is placed somewhere explicitly. We also try to minimize the modification of the sdk-files and instead provide our own implementations in the package.
Best regards
Felix