Skip to main content
Visitor II
September 7, 2011
Question

How to initialize the RAM in c language.

  • September 7, 2011
  • 2 replies
  • 699 views
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

    Visitor II
    September 7, 2011
    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

    ST Employee
    September 7, 2011
    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...