cancel
Showing results for 
Search instead for 
Did you mean: 

How to initialize the RAM in c language.

wpj1018
Associate II
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
2 REPLIES 2
brazov22
Associate II
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
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...