This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cmse_nonsecure_entry Functions dont have SG instruction

Hi,

I am currently using IAR for developing a Secure and Non Secure application on an STM32U575.

I am calling a function on the secure app from the non-secure app. The function has an added __attribute__( ( cmse_nonsecure_entry ) ) to it which are required for secure entry functions.

Upon examining the disassembly of the instruction the entry function doesnt have a Secure Gateway (SG) instruction but instead tagged as "DC32".

This causes a Bus Fault error as expected since the program wasnt able to transition from non-secure to secure without the SG instruction.

There seems to be no problem with the linker files and the compiler options. 

Would anyone be able to know what the problem is here?

Parents
  • Hi Renan

    I work in the Arm DS team here at Arm.

    This forum is for users of the Arm Development Studio tools.  For assistance with IAR products, please contact IAR directly:
    https://www.iar.com/support

    The opcode for the SG instruction is 0xE97FE97F, which is the same as you see at 0xC030010.  So it looks like the IAR tools are generating an SG instruction correctly, but it is being displayed as data in the debugger rather than as an instruction.

    Sorry, I can't explain why a data abort is occurring, but I suggest that you check the MPU is setup correctly to allow access to instructions around 0xC030010.

    Hope this helps

    Stephen

Reply
  • Hi Renan

    I work in the Arm DS team here at Arm.

    This forum is for users of the Arm Development Studio tools.  For assistance with IAR products, please contact IAR directly:
    https://www.iar.com/support

    The opcode for the SG instruction is 0xE97FE97F, which is the same as you see at 0xC030010.  So it looks like the IAR tools are generating an SG instruction correctly, but it is being displayed as data in the debugger rather than as an instruction.

    Sorry, I can't explain why a data abort is occurring, but I suggest that you check the MPU is setup correctly to allow access to instructions around 0xC030010.

    Hope this helps

    Stephen

Children