The address of the variable is the same
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-05-02 12:53 AM
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
- Labels:
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-05-02 10:13 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-05-06 6:56 PM
thank for reply!
I knew where I was wrong!
