[ARMCLANG 6.16]: [Cortex-M] Code generation with only privileged instructions

Hi,

Query:

Is there a way to generate object code that avoids using unprivileged instructions - `ldrbt`, `ldrsht`, `ldrt` - using ARMCLANG compiler (version 6.16) ?

Some light on how the compiler chooses to generate one of the two variants (privileged / unprivileged ) instructions for a given code would also be helpful.


Background:

We have a specific case where we see that an application using a library built using ARMCLANG for Cortex-M55 is crashing on our test board.

On debugging the root cause for the crash, we see that the crash is happening at a unprivileged access (ldrbt, ldrsht, ldrt) ARM instruction.

The same library(source) from GCC build works perfectly fine.

We have another observation with ARMCLANG build.

When we break the build steps: a particular C source file is converted to assembly first (using ARMCLANG again) and converted to object code later, the resulting library build does not have unprivileged access instructions and works without any crash.


TL;DR - Same source compiled with GCC build works fine whereas ARMCLANG build produces a crash - suspecting unprivileged access ARM instructions to be root cause. Any suggestions on avoiding such instructions in build is highly appreciated.


Thanks!

Parents
  • Hi  ,

    Thanks for the response!

    I would like to add another observation. The library built using ARMCLAGN 6.16 crashes only on one of our board and does not crash on another. Both the boards have Cortex-M55 core. 

    Is there any specific board / processor setting related to support of privileged / unprivileged access that we are missing during our testing. 

    Can you please let us know your comments / thoughts / observations on this part ? 

    Thanks!

Reply
  • Hi  ,

    Thanks for the response!

    I would like to add another observation. The library built using ARMCLAGN 6.16 crashes only on one of our board and does not crash on another. Both the boards have Cortex-M55 core. 

    Is there any specific board / processor setting related to support of privileged / unprivileged access that we are missing during our testing. 

    Can you please let us know your comments / thoughts / observations on this part ? 

    Thanks!

Children