Tool/software:
Hello,
we are using MCU PLUS SDK 09.01, CCS 12.5 and tiarmclang LTS 3.2.0 and I tried this one also with the LTS 3.2.2, since there was this issue: https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1341376/mcu-plus-sdk-am243x-combination-of-__attribute__-weak-and-section-produces-two-symbols/5151847?tisearch=e2e-sitesearch&keymatch=%252520user%25253A453845#5151847
So the idea was to only use our own abort-handlers, not those of the SDK. My first attempt was to declare the sdk-abort-handlers weak. There was - or still is - an issue, which is handled in the link above. The toolchain-update did not solve this problem. Unfortunately it also happened, depending on the project-link-order, that the weak symbols were not overwritten somehow. So our solution was now to strip those abort-handler symbols. This is not possible, as mentioned in the related thread to this one here.
The alternative is to rename them, but then they will stay in the compilation. But our abort-handlers get called so far. We renamed them to the name of the abort-handler + "_unused".
We renamed the symbols the following way:
tiarmobjcopy --redefine-sym HwiP_reserved_handler=HwiP_reserved_handler_unused --redefine-sym HwiP_undefined_handler=HwiP_undefined_handler_unused --redefine-sym HwiP_prefetch_abort_handler=HwiP_prefetch_abort_handler_unused --redefine-sym HwiP_data_abort_handler_c=HwiP_data_abort_handler_c_unused <path_to_sdk_libs>/freertos.am243x.r5f.ti-arm-clang.release.lib
We use only a static compiled sdk-library from which we rename the symbols. This is the only library linked against our target, so it's not possible for any symbols somehow reoccur.
There is still an issue with CCS:
CCS shows the old and the new abort-handlers:
our one is the one starting with "::". Notice that the address of the wrong one is 0xA52! This is important for later.
But this doesn't make any sense. Only our Abort-handler symbols are occuring in the map-file as well as in the readelf. Also the "_unused"-symbols occur:
in map-file:
But there is no definition for any symbol at address 0x00000A52. Still if I click there it opens the SDK-c-file:
on the other hand, if you have a look at the dissassembly, regarding this 0xA52-address, it shows the unused symbol correctly?!
what we also noticed, when we booted from flash and ran into an abort, CCS shows exactly this "wrong" function, which is not an available symbol in the compilation. We are really confused how this could happen.
What is the correct way to get rid of the Handlers in the SDK and to get it shown correctly in CCS? or are we doing something wrong from the beginning?
Best regards
Felix