cancel
Showing results for 
Search instead for 
Did you mean: 

The address of the variable is the same

Hoang_Tran
Associate III

0690X000008BA2bQAG.png0690X000008BA2HQAW.png0690X000008BA1xQAG.png

i using FreeRTOS.MB_Coil_Counter is a global variables and tmp is a variable in interrupt function of uart!why the address of tmp matches the address of MB!

thank everyone

2 REPLIES 2
Jack Peacock_2
Senior III

The first code screen shows the contents of the tmp pointer are set to the address of huart->pRxBuffPtr, 8-bit aligned according to printout, which will throw an alignment exception when used as a 16-bit reference. Not a good idea to disable alignment checks, lots of pointer errors are missed.

MB_Coil_Counter declaration doesn't appear, must be a global so you'd have to check the loader memory map to see where the linker resolves its address in relation to huart.

Why do you think the addresses are the same? Your printout doesn't support the conclusion.

Jack

thank for reply!

I knew where I was wrong!