Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dummy retargeting for the SYS IO functions #510

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

marcoaccame
Copy link
Contributor

@marcoaccame marcoaccame commented Sep 5, 2024

This PR adds retargeting of the system IO functions, so that we can use the armclang compiler with versions > v6.19.

The addition of these functions is required because:

  • I noticed that if we used compiler v 6.20 and beyond the applications when debugged stepped in several breakpoints before entering in main(). And even worse, when not in debug it did not bootstrap;
  • So, we have made sure to use V6.19 and I started an investigation.
  • It ended up that it was responsibility of the compiler because (from ARM):

    ... since the change [SDCOMP-64440] described in the release note of v6.22 https://developer.arm.com/documentation/109472/6-22/?lang=en
    Such a change seems to make armlink to link many additional Arm C/C++ standard lib components like printf, vfprintf or abort etc.
    When your debug session stuck at breakpoint 0xAB, usually it indicates a semihosting issue: https://developer.arm.com/documentation/ka002219/latest/

  • told that they would have fixed this:

    Hi Marco, our compiler team has confirmed this is indeed something we should investigate further and implement some improvement if possible.

  • and in the meantime thy suggested as a quick workaround:

    I know how to get rid of the debug issue caused by the unexpected semihosting. You can implement your own retarget file or use the one provided in the Arm::CMSIS-Compiler pack as described on the page I sent you.

So, in here I add the workaround.

I have added the functions in two existing files files that are used by all the projects, so that we don't need to change a humongous number of projects:

  • EOMtheSystem.c for the legacy projects (ems, ...)
  • embot_hw_sys.cpp for the embot projects.

And I have reverted some projects for the use of the installed compiler version.

I have tested the changes w/ some boards and everything works fine.

@marcoaccame marcoaccame changed the title Fix/retargeting.sys.io Added dummy retargeting for the SYS IO functions Sep 5, 2024
@marcoaccame marcoaccame merged commit 1fde01c into robotology:devel Sep 5, 2024
marcoaccame added a commit to simeonedussoni/icub-firmware that referenced this pull request Oct 30, 2024
…gy#510 we can safely use the latest armclang compiler version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant