This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Scatter file for Cortex-M0 LPC11xx

Hi everybody,

My question is regarding a Cortex-M0 NXP's LPC1114/301.

I am having trouble with the initialization sections that sets the initial values of variables. For example:

int x = 20;

int main(void)
{ if(x==20) do_something();

.....

}

When I run this code, the value of x is undefined and has actually a random value. I know I have to copy the etext section to edata, and also initialize the bss section to 0. But how do I do this in Keil with a scatter file + startup file in assembler? The default startup file from Keil for the LCP1114 doesn't do it...

Thanks in advance,

R.

Parents
  • No, it is just an example. It's not the real program, but I was trying to expose my problem in a simple way.

    I have looked into the project configuration and the NoInit box is not checked.

    The startup.s file I'm using is the one that uVision generates automatically when you choose the device model.
    I haven't changed nothing from the original scatter file.

    Thanks for the help anyway.

    R.

Reply
  • No, it is just an example. It's not the real program, but I was trying to expose my problem in a simple way.

    I have looked into the project configuration and the NoInit box is not checked.

    The startup.s file I'm using is the one that uVision generates automatically when you choose the device model.
    I haven't changed nothing from the original scatter file.

    Thanks for the help anyway.

    R.

Children