Forums

how to write in flash a vector during programing

Started by mm bb June 18, 2013
Hi, I want to save a vector in the flash during programing the micro, must I have to declare the vector as static?, is this correct or there is another way to do that? Thanks for your help.

[Non-text portions of this message have been removed]

Beginning Microcontrollers with the MSP430

--- In m..., mm bb wrote:
>
> Hi, I want to save a vector in the flash during programing the micro, must I have to declare the vector as static?, is this correct or there is another way to do that? Thanks for your help.
>
> [Non-text portions of this message have been removed]
>

Is the micro a member of MSP430?
Are you using CCS IDE or IAR IDE to develop code?
Are you using a so-called FET hardware interface to download code (programming)into Flash?

If the answer to all the above are yes, there is one more question.

Are you using c or assembly?

If you use c, then the "reset vector" is automatically generated when you have a main(). The "interrupt vectors" are automatically generated by "#pragma interrupt". Both are "programmed" into Flash together with all the code, constants, etc.

If you use assembly, then all the vectors need be explicitly generated. They are "programmed" into Flash together with all the code, constants, etc.

Thanks for your response, Im using msp430 5438, programed via IAR in c,using a FET hardware interface.
The question is how can I be sure that an array of data that i will need during the course of the program will be save in flash and not in the RAM portion of the memory.

--- In m..., "old_cow_yellow" wrote:
>
> --- In m..., mm bb wrote:
> >
> > Hi, I want to save a vector in the flash during programing the micro, must I have to declare the vector as static?, is this correct or there is another way to do that? Thanks for your help.
> >
> > [Non-text portions of this message have been removed]
> > Is the micro a member of MSP430?
> Are you using CCS IDE or IAR IDE to develop code?
> Are you using a so-called FET hardware interface to download code (programming)into Flash?
>
> If the answer to all the above are yes, there is one more question.
>
> Are you using c or assembly?
>
> If you use c, then the "reset vector" is automatically generated when you have a main(). The "interrupt vectors" are automatically generated by "#pragma interrupt". Both are "programmed" into Flash together with all the code, constants, etc.
>
> If you use assembly, then all the vectors need be explicitly generated. They are "programmed" into Flash together with all the code, constants, etc.
>

The c-compiler and linker will allocate Flash memory to code, constants, literals, interrupt vectors, reset vector, etc.

Only variables (not constants), stack, and heap will be allocated in SRAM.

The address boundaries of Flash and SRAM are known to the linker via the link command file: "lnk430f5438.xcl" if you set up the project to use MSP430F5438.

To be sure, you can set up the linker to produce a link map. You then examine that map file (ASCII text) to see it.

--- In m..., "mm" wrote:
>
> Thanks for your response, Im using msp430 5438, programed via IAR in c,using a FET hardware interface.
> The question is how can I be sure that an array of data that i will need during the course of the program will be save in flash and not in the RAM portion of the memory.
>
> --- In m..., "old_cow_yellow" wrote:
> >
> > --- In m..., mm bb wrote:
> > >
> > > Hi, I want to save a vector in the flash during programing the micro, must I have to declare the vector as static?, is this correct or there is another way to do that? Thanks for your help.
> > >
> > > [Non-text portions of this message have been removed]
> > >
> >
> > Is the micro a member of MSP430?
> > Are you using CCS IDE or IAR IDE to develop code?
> > Are you using a so-called FET hardware interface to download code (programming)into Flash?
> >
> > If the answer to all the above are yes, there is one more question.
> >
> > Are you using c or assembly?
> >
> > If you use c, then the "reset vector" is automatically generated when you have a main(). The "interrupt vectors" are automatically generated by "#pragma interrupt". Both are "programmed" into Flash together with all the code, constants, etc.
> >
> > If you use assembly, then all the vectors need be explicitly generated. They are "programmed" into Flash together with all the code, constants, etc.
>