Skip to main content
Carter Lee
Associate III
October 18, 2017
Question

How does memory work in Cortex M3?

  • October 18, 2017
  • 2 replies
  • 1968 views
Posted on October 18, 2017 at 16:21

Hi,

Now I'm trying to understand about how do the memories work.

I've attached STM32F103C8's memory map and I've highlighted each memory in the image (aka A, B, C, D)..

In here, I want to know what exactly relationship between B(System memory) and C(Flash memory)?

and What is the D(aliased to Flash or system Memory area)? Is D real existing physically?

If I use JTAG to upload the compiled hex file into the Cortex Flash memory, then where exactly does it go ? A?B?C?D?

after complete upload the firmware code, then what happens? D just copy from C?

0690X00000608fkQAA.png

I think B, C and D is supposed to be as 

#memory-map
    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    October 18, 2017
    Posted on October 18, 2017 at 16:45

    They are all decoded from high order address bits, look perhaps at some classic microprocessor texts where a 74138 logic chip takes in the high order bits and decodes discrete memory regions.

    The FLASH memory is at 0x080XXXXX within the memory map, this is where you write your binary image of the firmware to be run.

    The there is the SHADOWING concept, where a memory may appear in TWO, or more, places within the memory map. When the BOOT pins select FLASH, then it appears at BOTH 0x08000000 and 0x00000000. This is important because the processor boots assuming the vector table is starting at zero, ie SCB->VTOR = 0

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Tesla DeLorean
    Guru
    October 18, 2017
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    Andrew Sund
    Associate
    October 18, 2017
    Posted on October 18, 2017 at 18:21

    It might be interesting to read up on C start up code and examining the parts of your linker script that it interacts with (there's probably plenty you probably don't care about in there) as well. Understanding the code that runs before calling your main() can really connect the dots with the memories.

    Tesla DeLorean
    Guru
    October 18, 2017
    Posted on October 18, 2017 at 19:28

    Honestly I think some 40 year old books on Computer Architecture and Microprocessor Interfacing might be significantly more illuminating in this case in terms of understanding how the parts come together. Today's SoC solutions just pull all the basic concepts into a chip level solution, the memory decoding and busing remain inherently the same. People used to have college level classes on this stuff.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..