how to copy a subroutine  from FLASH to RAM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

how to copy a subroutine  from FLASH to RAM

跳至解决方案
2,322 次查看
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

标签 (1)
0 项奖励
回复
1 解答
1,479 次查看
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 项奖励
回复
4 回复数
1,479 次查看
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 项奖励
回复
1,479 次查看
CASEYKEVIN
Contributor I

hi,mac

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

0 项奖励
回复
1,480 次查看
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 项奖励
回复
1,479 次查看
CASEYKEVIN
Contributor I

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

0 项奖励
回复