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.
ldrbt`, `ldrsht`, `ldrt
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!
ldrbt, ldrsht, ldrt
Hi Ronan Synnott ,
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!
Nothing comes to mind, my apologies.
If you can locate the exact instruction failing on the 'bad' board, set a breakpoint at that same instruction on the 'good' board, and compare system states?
Were you able to rebuild your code with the latest compiler? Does that resolve the issue?
Apologies for the delay in response> Were you able to rebuild your code with the latest compiler? Does that resolve the issue?
Yes, the crash issue is resolved with the build from Compiler version 6.22.Thanks!