Hi @Shruthi_C
I tried that in S32 Design Studio and it works as expected. Not sure what's wrong in IAR.
Or you can use something like this:
#define __ASM __asm
#define __INLINE inline
#define __STATIC_INLINE static inline
__attribute__( ( always_inline ) ) __STATIC_INLINE uint32_t __get_LR(void)
{
register uint32_t result;
__ASM volatile ("MOV %0, LR\n" : "=r" (result) );
return(result);
}
And then:
uint32_t lr;
lr = __get_LR();
This also works on my side.
Regards,
Lukas