Skip to main content
wpj1018
Associate
Sep 7, 2011 12:55 PM UTC
Question

How to initialize the RAM in c language.

Posted on September 07, 2011 at 14:55

How to initialize the RAM in STM8S105xxx

Hi:

      I want to initialize the space of  RAM(the whole RAM), please tell me how to operate.

Thanks! the language is c.

Fred
    This topic has been closed for replies.

    2 replies

    brazov22
    Associate III
    Sep 7, 2011 1:35 PM UTC
    Posted on September 07, 2011 at 15:35

    define:

    u8 GBuffer[RAM_SIZE];

    u8 new_val2 = 0x00;

    .....

    /* Fill the RAM with 00h */

        for (i = 0; i < RAM_SIZE; i++) GBuffer[i] = new_val2;

    or in STVD select the ram space and fill it graphically to 00h.

    brazov2

    Viktor POHORELY
    ST Employee
    Sep 7, 2011 2:00 PM UTC
    Posted on September 07, 2011 at 16:00

    For Cosmic compiler, you could simply use correct startup file - crtsi.s

    For details about startup file and how to use it, please reffer to the related documentation of Cosmic compiler and STVD or other IDE.

    For other compilers, please reffer to their provided documentation. Should have same capability...