process memory

Discuss how to use the features of Atollic TrueSTUDIO, including the editor, assembler, C/C++ compiler, linker, debugger, static code analysis and team collaboration tools.

Moderators: Markus Girdland, Mattias Norlander

ericyclin
Posts: 3
Joined: Tue Jul 17, 2018 6:35 am

process memory

Postby ericyclin » Tue Jul 17, 2018 6:46 am

Hi, there

This seems to me a very basic question, but I couldn't find any useful information from just googling it.

In the debugging mode, after the program is paused at main function, I go to the memory tab and add a new monitor for the address 0x00000000. Upon stepping forward, I can see the contents starting from address 0x00000000. But, how do I interpret the contents starting at this address ? It doesn't seem to me that it is the initial stack pointer followed by the initial program counter, as I thought in the first place. The user manual use the word "process memory" to describe it. Does anybody know how to interpret the contents ?

Thank you.
Eric

Mattias Norlander
Posts: 273
Joined: Fri Apr 29, 2016 10:01 am

Re: process memory

Postby Mattias Norlander » Thu Aug 09, 2018 12:02 pm

Hi Eric,

The memory view view should show you the memory area you enter. You do however need to interpret the values since the hex values are not printed in the correct order.

Example:
If I enter 0x0 or 0x8000000 into the memory view it would print interrupt vector. You will see that there are multiple entries with the same address, these are for all interrupts that are routed to the Default_Handle.

In my case the memory view may say that Default_Handler is located here:

Code: Select all

5D 09 00 08

You should read this out as:

Code: Select all

0x 08 00 09 5D


Next thing that could throw you off is if you read the map-file and find this:

Code: Select all

.text.Default_Handler
                0x0800095c        0x2 src\startup_stm32f429x.o
                0x0800095c                RTC_Alarm_IRQHandler
                0x0800095c                HASH_RNG_IRQHandler
                0x0800095c                EXTI2_IRQHandler
                0x0800095c                TIM8_CC_IRQHandler
                0x0800095c                UART8_IRQHandler
                0x0800095c                SPI4_IRQHandler
                0x0800095c                TIM1_CC_IRQHandler
                0x0800095c                DMA2_Stream5_IRQHandler
                0x0800095c                DMA1_Stream5_IRQHandler


Map-file says Default_Handler is located at 0x080095C While memory browser says 0x080095D.
Inconsistency?
The code is indeed located on 0x080095C, but it must be called from 0x080095D. So the +1 (from C to D) seen in the memory view is because the processor must execute in thumb state and not ARM state (controlled by the last bit in the instruction).

ericyclin
Posts: 3
Joined: Tue Jul 17, 2018 6:35 am

Re: process memory

Postby ericyclin » Fri Mar 29, 2019 8:15 pm

Hey, Mattias

Thank you very much for the detailed explanation. Sorry for the late response. I didn't receive any automatic email notice from this forum when you replied with such a good explanation.

Cheers,
Eric


Return to “Atollic TrueSTUDIO tool discussions”

Who is online

Users browsing this forum: No registered users and 2 guests