EmbeddedRelated.com
Forums
Memfault Beyond the Launch

MSP430 Segment size

Started by lewis December 12, 2004
Hi,

i am currently developing a module that replaces a function in flash 
by a new one recieved thru UART.The problem i am facing is dat 
before doing a block write i have to erase the segment which 
contains many more functions,even though i have modified the linker 
file to place my replaacble function in a seperate segment the erase 
command erases the entire segment which is 512 byte.My 
specifications dont allow me the luxury of allocating the entire 
segment for each replacable function which is typically arnd 
100bytes each.

Is there any way i can prevent MSP430 from erasing the entire 
default segment of 512 bytes and just erase around 100 bytes 

thanx,
Lewis 




Beginning Microcontrollers with the MSP430

Hi,

The info memory is there for just such a purpose (and others): it has 
2 segments of 128 bytes each, located at 0x1000 and 0x1080. 
Otherwise, it can be used just like the rest of the flash memory.

Michel

--- In msp430@msp4..., "lewis" <oldrine@y...> wrote:
> 
> Hi,
> 
> i am currently developing a module that replaces a function in 
flash 
> by a new one recieved thru UART.The problem i am
facing is dat 
> before doing a block write i have to erase the segment which 
> contains many more functions,even though i have modified the linker 
> file to place my replaacble function in a seperate segment the 
erase 
> command erases the entire segment which is 512
byte.My 
> specifications dont allow me the luxury of allocating the entire 
> segment for each replacable function which is typically arnd 
> 100bytes each.
> 
> Is there any way i can prevent MSP430 from erasing the entire 
> default segment of 512 bytes and just erase around 100 bytes 
> 
> thanx,
> Lewis




On Mon, 13 Dec 2004 00:00:36 -0000, Lewis wrote:

>Is there any way i can prevent MSP430 from erasing
the entire 
>default segment of 512 bytes and just erase around 100 bytes 

Copy the segment to RAM, modify the RAM version, erase the flash segment,
transfer the RAM version to the flash segment.

Jon

On Mon, 13 Dec 2004 00:13:26 -0000, Michel wrote:

>The info memory is there for just such a purpose
(and others): it has 
>2 segments of 128 bytes each, located at 0x1000 and 0x1080. 
>Otherwise, it can be used just like the rest of the flash memory.

Michel, take note that this OP is talking about "each replaceable
function" and
that this looks like there is MORE than one of them.  I think what is wanted is
a somewhat more general approach (hopefully assuming same size or smaller.)

Jon

Lewis,
In the next generation of MSP430(F2xx) you will have small segments that may
help you. Meanwhile I'd suggest the fllowing approach:
1) Copy the segment you have to erase to RAM
2) Modify, in RAM, the part you need(the function that must be replaced)
3) Erase the segment in FLASH
4) Copy the modified segment to FLASH.
Of course you will need at least +512 bytes in RAM.
You could do the same thing in FLASH, too, but you have to remember the
FLASH endurance (limit of times you can erase/write in the FLASH area).
Using FLASH you should do:
1) Erase a "working" segment in the FLASH
2) Copy the segment without the function you must replace to "working
segment"
3) Include the new function in this "working segment"
4) Erase the destination segment in the FLASH
5) Copy the working segment to destination.

Mind the both processes are very slow (segment erase + coping word by word).

Hope it helps,

Augusto


-----Mensagem original-----
De: lewis [mailto:oldrine@oldr...] 
Enviada em: domingo, 12 de dezembro de 2004 22:01
Para: msp430@msp4...
Assunto: [msp430] MSP430 Segment size




Hi,

i am currently developing a module that replaces a function in flash 
by a new one recieved thru UART.The problem i am facing is dat 
before doing a block write i have to erase the segment which 
contains many more functions,even though i have modified the linker 
file to place my replaacble function in a seperate segment the erase 
command erases the entire segment which is 512 byte.My 
specifications dont allow me the luxury of allocating the entire 
segment for each replacable function which is typically arnd 
100bytes each.

Is there any way i can prevent MSP430 from erasing the entire 
default segment of 512 bytes and just erase around 100 bytes 

thanx,
Lewis 






.

 
Yahoo! Groups Links



 





Hi,
Thanx for the replies.

The problem i am stuck with is that the MSP430f1232 has only 256 
bytes of RAm so i cant backup an entire segment .
also I cant let the MC go to idle state which implies i cant perform 
a Flash to Flash copy.

Thanx once again.

lewis

--- In msp430@msp4..., "augusto einsfeldt" <aee@t...> wrote:
> Lewis,
> In the next generation of MSP430(F2xx) you will have small 
segments that may
> help you. Meanwhile I'd suggest the fllowing
approach:
> 1) Copy the segment you have to erase to RAM
> 2) Modify, in RAM, the part you need(the function that must be 
replaced)
> 3) Erase the segment in FLASH
> 4) Copy the modified segment to FLASH.
> Of course you will need at least +512 bytes in RAM.
> You could do the same thing in FLASH, too, but you have to 
remember the
> FLASH endurance (limit of times you can
erase/write in the FLASH 
area).
> Using FLASH you should do:
> 1) Erase a "working" segment in the FLASH
> 2) Copy the segment without the function you must replace 
to "working
> segment"
> 3) Include the new function in this "working segment"
> 4) Erase the destination segment in the FLASH
> 5) Copy the working segment to destination.
> 
> Mind the both processes are very slow (segment erase + coping word 
by word).
> 
> Hope it helps,
> 
> Augusto
> 
> 
> -----Mensagem original-----
> De: lewis [mailto:oldrine@y...] 
> Enviada em: domingo, 12 de dezembro de 2004 22:01
> Para: msp430@msp4...
> Assunto: [msp430] MSP430 Segment size
> 
> 
> 
> 
> Hi,
> 
> i am currently developing a module that replaces a function in 
flash 
> by a new one recieved thru UART.The problem i am
facing is dat 
> before doing a block write i have to erase the segment which 
> contains many more functions,even though i have modified the 
linker 
> file to place my replaacble function in a seperate
segment the 
erase 
> command erases the entire segment which is 512
byte.My 
> specifications dont allow me the luxury of allocating the entire 
> segment for each replacable function which is typically arnd 
> 100bytes each.
> 
> Is there any way i can prevent MSP430 from erasing the entire 
> default segment of 512 bytes and just erase around 100 bytes 
> 
> thanx,
> Lewis 
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links




The MSP430 CPU will go to idle state while you write even a single word
into
the FLASH (or erases a segment).
The only way to avoid the idle state is running your software in RAM but it
would make your current problem meaningless.
It seems that you need to try another approach to your design or choose a
different CPU.

-Augusto


-----Mensagem original-----
De: lewis [mailto:oldrine@oldr...] 
Enviada em: domingo, 12 de dezembro de 2004 23:56
Para: msp430@msp4...
Assunto: Re: RES: [msp430] MSP430 Segment size




Hi,
Thanx for the replies.

The problem i am stuck with is that the MSP430f1232 has only 256 
bytes of RAm so i cant backup an entire segment .
also I cant let the MC go to idle state which implies i cant perform 
a Flash to Flash copy.

Thanx once again.

lewis

--- In msp430@msp4..., "augusto einsfeldt" <aee@t...> wrote:
> Lewis,
> In the next generation of MSP430(F2xx) you will have small
segments that may
> help you. Meanwhile I'd suggest the fllowing
approach:
> 1) Copy the segment you have to erase to RAM
> 2) Modify, in RAM, the part you need(the function that must be
replaced)
> 3) Erase the segment in FLASH
> 4) Copy the modified segment to FLASH.
> Of course you will need at least +512 bytes in RAM.
> You could do the same thing in FLASH, too, but you have to
remember the
> FLASH endurance (limit of times you can
erase/write in the FLASH
area).
> Using FLASH you should do:
> 1) Erase a "working" segment in the FLASH
> 2) Copy the segment without the function you must replace
to "working
> segment"
> 3) Include the new function in this "working segment"
> 4) Erase the destination segment in the FLASH
> 5) Copy the working segment to destination.
> 
> Mind the both processes are very slow (segment erase + coping word
by word).
> 
> Hope it helps,
> 
> Augusto
> 
> 
> -----Mensagem original-----
> De: lewis [mailto:oldrine@y...]
> Enviada em: domingo, 12 de dezembro de 2004 22:01
> Para: msp430@msp4...
> Assunto: [msp430] MSP430 Segment size
> 
> 
> 
> 
> Hi,
> 
> i am currently developing a module that replaces a function in
flash 
> by a new one recieved thru UART.The problem i am
facing is dat
> before doing a block write i have to erase the segment which 
> contains many more functions,even though i have modified the 
linker 
> file to place my replaacble function in a seperate
segment the
erase 
> command erases the entire segment which is 512
byte.My
> specifications dont allow me the luxury of allocating the entire 
> segment for each replacable function which is typically arnd 
> 100bytes each.
> 
> Is there any way i can prevent MSP430 from erasing the entire
> default segment of 512 bytes and just erase around 100 bytes 
> 
> thanx,
> Lewis
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links






.

 
Yahoo! Groups Links



 





Backup the unchanged bytes of your flash segment in another flash segment
and use RAM-code to copy/burn from one flash segment to another flash segment.

M.

On Mon, Dec 13, 2004 at 01:56:08AM -0000, lewis wrote:
> 
> 
> Hi,
> Thanx for the replies.
> 
> The problem i am stuck with is that the MSP430f1232 has only 256 
> bytes of RAm so i cant backup an entire segment .
> also I cant let the MC go to idle state which implies i cant perform 
> a Flash to Flash copy.
> 
> Thanx once again.
> 
> lewis
> 
> --- In msp430@msp4..., "augusto einsfeldt" <aee@t...>
wrote:
> > Lewis,
> > In the next generation of MSP430(F2xx) you will have small 
> segments that may
> > help you. Meanwhile I'd suggest the fllowing approach:
> > 1) Copy the segment you have to erase to RAM
> > 2) Modify, in RAM, the part you need(the function that must be 
> replaced)
> > 3) Erase the segment in FLASH
> > 4) Copy the modified segment to FLASH.
> > Of course you will need at least +512 bytes in RAM.
> > You could do the same thing in FLASH, too, but you have to 
> remember the
> > FLASH endurance (limit of times you can erase/write in the FLASH 
> area).
> > Using FLASH you should do:
> > 1) Erase a "working" segment in the FLASH
> > 2) Copy the segment without the function you must replace 
> to "working
> > segment"
> > 3) Include the new function in this "working segment"
> > 4) Erase the destination segment in the FLASH
> > 5) Copy the working segment to destination.
> > 
> > Mind the both processes are very slow (segment erase + coping word 
> by word).
> > 
> > Hope it helps,
> > 
> > Augusto
> > 
> > 
> > -----Mensagem original-----
> > De: lewis [mailto:oldrine@y...] 
> > Enviada em: domingo, 12 de dezembro de 2004 22:01
> > Para: msp430@msp4...
> > Assunto: [msp430] MSP430 Segment size
> > 
> > 
> > 
> > 
> > Hi,
> > 
> > i am currently developing a module that replaces a function in 
> flash 
> > by a new one recieved thru UART.The problem i am facing is dat 
> > before doing a block write i have to erase the segment which 
> > contains many more functions,even though i have modified the 
> linker 
> > file to place my replaacble function in a seperate segment the 
> erase 
> > command erases the entire segment which is 512 byte.My 
> > specifications dont allow me the luxury of allocating the entire 
> > segment for each replacable function which is typically arnd 
> > 100bytes each.
> > 
> > Is there any way i can prevent MSP430 from erasing the entire 
> > default segment of 512 bytes and just erase around 100 bytes 
> > 
> > thanx,
> > Lewis 
> > 
> > 
> > 
> > 
> > 
> > 
> > .
> > 
> >  
> > Yahoo! Groups Links
> 
> 
> 
> 
> 
> 
> .
> 
>  
> Yahoo! Groups Links
> 
> 
> 
>  
> 
> 
> 
        Matthias


Memfault Beyond the Launch