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 Stephen,

    Thank you for your help. I turns out I am debugging in ARM mode when it was compiled in Thumb mode.

    I am currently able to see the correct instructions but still I am encountering bus errors when a PUSH instruction is executed

    This instruction occurs when I am calling a function, which is inside the secure project, from the cmse_nonsecure_entry function.

    The CFSR shows he following bits set

    The BFAR shows this:

    This immediately occurs after the Push instruction

Reply
  • Hi Stephen,

    Thank you for your help. I turns out I am debugging in ARM mode when it was compiled in Thumb mode.

    I am currently able to see the correct instructions but still I am encountering bus errors when a PUSH instruction is executed

    This instruction occurs when I am calling a function, which is inside the secure project, from the cmse_nonsecure_entry function.

    The CFSR shows he following bits set

    The BFAR shows this:

    This immediately occurs after the Push instruction

Children