Skip to main content
an_it
Associate III
October 12, 2012
Question

Read out Start-Up RAM values

  • October 12, 2012
  • 27 replies
  • 5560 views
Posted on October 12, 2012 at 11:28

Hey there,

I am pretty new to micrcontrollers and such. I recently bought a STM32VL Discovery, which I am programming with CoCoox IDE.

My goal is to read out the start-up values of internal RAM. By start-up values I mean the values of RAM cells just after the power-up of the device when no other application interferred with the ram.

Is this possible somehow? Could you guys guide me to some literature or give me some hints?

Thanks in advance!

#describe-the-goal-not-the-step
    This topic has been closed for replies.

    27 replies

    M0NKA
    Associate III
    November 17, 2012
    Posted on November 17, 2012 at 10:05

    Lovely! Tnx for sharing

    an_it
    an_itAuthor
    Associate III
    November 19, 2012
    Posted on November 19, 2012 at 10:05

    Thanks so much! I will try this as soon as possible.

    Kind Regards

    an_it
    an_itAuthor
    Associate III
    November 26, 2012
    Posted on November 26, 2012 at 15:20

    Hi cl1ve,

     

     

    I was trying to use your code. I inserted it right after

     

     

    Reset_Handler:

     

     

    First, Eclipse was complaining about iu1. Obviously there is a '':'' missing to indicate a label.

     

    Afterwards the code compiled. I am using Hyperterminal to receive values from USART. However, I only get one byte != '''' and the rest are just empty spaces. Also, I only receive stuff if I debug. If I run the program ''normaly'', nothing is printed in hyperterminal.

     

    Cheers.
    Tesla DeLorean
    Guru
    November 26, 2012
    Posted on November 26, 2012 at 15:57

    I'm using Keil/ARM assembler syntax, GNU might need other things.

    It should transmit raw binary values, not ASCII. Suggest you use a better terminal app like RealTerm which can display Hex values for binary data.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    an_it
    an_itAuthor
    Associate III
    November 27, 2012
    Posted on November 27, 2012 at 17:34

    Hi clive1,

    I installed KEIL/ARM and your ASM code is worling like charm - kudos!

    One more question: It look like the ASM code (which I put right at the beginning of the Reset_Handler marker) gets executed if I am in debugging mode. However, if I run code ''normally'' it seems not to transmit anything.

    I tried to put a loop into the asm code by adding a marker (''foo'') before the first line of your code and adding a ''b foo'' at the end of your code. Again this works well in debugging mode and it infinitely loops through your asm code, transmitting the binary values. However, it does nothing in ''normal'' mode.

    Cheers

    an_it
    an_itAuthor
    Associate III
    January 31, 2013
    Posted on January 31, 2013 at 09:44

    Sorry for bumping this rather old thread.

    @clive1: Can you tell me how did you created the ASM code? Is there a reference with respect to the register values for UART settings or did you code it in C and used the assembly after compilation process?

    I would like to do this with a ARM MCU of another brand and do not really know how to proceed.

    Thanks!

    Tesla DeLorean
    Guru
    January 31, 2013
    Posted on January 31, 2013 at 10:52

    My primary data sources of information were the reference manual for the part and the C source code for the library. ie Memory maps, register addresses and bit definitions.

    I've been writing code in assembler for decades, so don't really need to look at compiler output much, but it can be helpful, as can looking at other assembler listings or examples. I come from a generation which learned how to program in assembler before we learned PASCAL and C, and hand assembled machine code, so my perspective is a bit skewed.

    The trick is to understand the memory addresses in the target, and what processor registers you're using to hold specific values, or are available for other uses.

    I used hex constants here because a) it was more efficient to do so, and b) didn't require a large number of equates or includes.

    You'll need to look at the flow for setting up the clocks, GPIOs and USART on your new target device.
    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..