I have simulated the below code in IAR.
And it worked!
But I run this code in real KE02.
this code will cause KE02 reset.
could you help find out root cause?
I have changed the macro as below. this macro worked normally.
#define Set16Int(p,d) *(p)=d&0xff; *(p+1)=d>>8
#define Get16Int(p) *((uint16*)(p))
#define Set16Int(p,d) *((uint16*)(p)) = d
u16gT = Get16Int(u8gRxBuff);