Skip to main content
Hoang_Tran
Associate III
May 2, 2019 7:53 AM UTC
Question

The address of the variable is the same

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

This topic has been closed for replies.

2 replies

Jack Peacock_2
Associate II
May 2, 2019 5:13 PM UTC

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

Hoang_Tran
Associate III
May 7, 2019 1:56 AM UTC

thank for reply!

I knew where I was wrong!