how to copy a subroutine  from FLASH to RAM

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

how to copy a subroutine  from FLASH to RAM

Jump to solution
1,432 Views
CASEYKEVIN
Contributor I

I am new to Freescale MCU,HCS08

 

in my application, i need to reprogram some flash area to update my parameters, my upate subroutine  locate in FLASH

 

i shoud copy the update subroutine from FLASH to RAM, and re-program  flash , right?

 

if it is right ,how to how to copy a subroutine  from FLASH to RAM?

 

any guys here know how to do it, plz tell me, thanks a aot

Labels (1)
0 Kudos
1 Solution
589 Views
peg
Senior Contributor IV

Hello caseykevin,

 

Welcome to the fora!

 

Take a look https://community.freescale.com/message/35354#35354

The key is the doonstack subroutine

 

View solution in original post

0 Kudos
4 Replies
589 Views
bigmac
Specialist III

Hello,

 

There are two different methods of using RAM for the programming of non-volatile data.  One method uses the stack, as Peg has referenced.  The second method uses a fixed block of RAM, often placed at the bottom of the stack.  In this case the temporary block size can be as little as 20 bytes.  I recall that the code required for this method has also been previously placed on this forum - see if you can find it using the forum search.

 

You do not say whether you are coding in assembly or C.

 

Regards,

Mac

 

0 Kudos
589 Views
CASEYKEVIN
Contributor I

hi,mac

i am coding in C langeuage, do i need to use assembly to do it?

0 Kudos
590 Views
peg
Senior Contributor IV

Hello caseykevin,

 

Welcome to the fora!

 

Take a look https://community.freescale.com/message/35354#35354

The key is the doonstack subroutine

 

0 Kudos
589 Views
CASEYKEVIN
Contributor I

thank u for your link,i will go to read it

0 Kudos