AnsweredAssumed Answered

Mapping assembly code

Question asked by smith.john.021 on Jul 14, 2016
Latest reply on Jul 14, 2016 by Clive One
I'm using an STM32L151 board and I want to know how to map a memory address to its function. For example:
LDR.W           R0, =0x20002A20
MOVS            R2, #4
MOVS            R1, #4
STR             R1, [R0,#0x14]
LDR.W           R1, =0x20002224
STR.W           R2, [R1,#0x1B8]
In a rough translation to pseudocode, we see that:
R0 = *(0x20002A20)
R1 = 4
R2 = 4
The 4 bit is set to one on memory address of R0 + 0x14
R1 = *(0x20002224)
The 4 bit is set to one on memory address of R1 + 0x1B8
But I am having a hard time figuring out what the code is actually doing. I know it is in the SRAM (according to the memory map) but I cannot find the 0x2A20 or 0x2224 address offset does. I've been looking in the header files (like stm32l151xc.h) and cannot find anything. Once I know how to find what these addresses map to, I can see what setting the 4 bit to "on" does. How do I find what 0x2A20 and 0x2224 map to? Where should I look?

Outcomes