Clear Ram Region or Global Variable

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Clear Ram Region or Global Variable

729件の閲覧回数
ramazan_kurban3
Contributor III

I need to clear ram region that use bootloader code before jump to firmware code. My global variables take up huge space in ram memory. I can't change these with dynamic variables. I use lpc1769.

How can I clear ram region or delete global variables. 

0 件の賞賛
1 返信

685件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Ramazan,

This is the api function to fill memory with zero.

void bss_init(unsigned int start, unsigned int len) {
    unsigned int *pulDest = (unsigned int*) start;
    unsigned int loop;
    for (loop = 0; loop < len; loop = loop + 4)
        *pulDest++ = 0;
}

But it is not the main task to develop a function to fill memory, the main task is to know which memory space needs to be filled with zero, which memory space must not be filled. For example, the stack can NOT be filled, the application global variables can not be filled. so you have to check the link file to know the allocation of memory space and know what memory need to be filled or not.

Hope it can help you

BR

XiangJun Rong

0 件の賞賛