Copy SDRAM to flash and IAP memory reservation

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

Copy SDRAM to flash and IAP memory reservation

跳至解决方案
1,897 次查看
hiephuynh
Contributor III

For IAP (In-app programming) to update firmware code to Flash Bank of a LPC43xx, do I need to write from SDRAM to SRAM to flash bank memory or can I just write from SDRAM->flash

Another question I have is in UM10503.pdf section "6.4.5.8 RAM used by IAP command handler", it looks like there's a requirement to reserve some RAM block for IAP commands.  What's the total size of memory application must reserve for IAP calls and is there some code example for this reservation for IAP? Appreciate your help.

0 项奖励
回复
1 解答
1,599 次查看
jeremyzhou
NXP Employee
NXP Employee
Thanks for your reply.
You can enlarge the size of the stack area via adapting the linker file, however I think the defaut size is large enough.
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x2000;
define symbol __ICFEDIT_size_heap__   = 0x2000;
/**** End of ICF editor section. ###ICF###*/
Have a great day,
TIC
 
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
8 回复数
1,599 次查看
jeremyzhou
NXP Employee
NXP Employee
Thank you for your interest in NXP Semiconductor products and 
the opportunity to serve you.
You should copy the data from SDRAM to SRAM before calling Copy RAM to Flash command.
About how much RAM area should be reserved when calling IAP commands, I think the section 6.4.5.8 RAM used by IAP command handler has illustrated it in details.
Have a great day,
TIC
 
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
0 项奖励
回复
1,599 次查看
hiephuynh
Contributor III

Hi Jeremy, for "set active boot bank" IAP command, the datasheet says we need to reserve 2208 Bytes in RAM.  So I need to reserve 2208 B + additional bytes for other IAP commands like erase/prepare, etc?

Thanks

0 项奖励
回复
1,599 次查看
jeremyzhou
NXP Employee
NXP Employee

Hi HIEP HUYNH,

Thanks for your reply.

1) So I need to reserve 2208 B + additional bytes for other IAP commands like erase/prepare, etc?

     Yes, and 2456 B is the maximum size.
Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,598 次查看
hiephuynh
Contributor III

Ok thanks. In order to do "Set Active Boot Bank" command,  in .icf Linker file, do I specify like this below to reserve the top 2456 Bytes for IAP calls?

define symbol LOCAL_SRAM_start__ = 0x10080000;
define symbol LOCAL_SRAM_end__  = 0x10089667;

0 项奖励
回复
1,598 次查看
jeremyzhou
NXP Employee
NXP Employee
Thanks for your reply.
In my opinion, It's not necessary to adapt the original linker file when calling the IAP commands.
Hope this is clear.

Have a great day,
TIC

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复
1,599 次查看
hiephuynh
Contributor III

Hi, so how would I reserve 2208 Bytes for this "Set Active Boot Bank" IAP command?  I'm using IAR Workbench.

0 项奖励
回复
1,600 次查看
jeremyzhou
NXP Employee
NXP Employee
Thanks for your reply.
You can enlarge the size of the stack area via adapting the linker file, however I think the defaut size is large enough.
/*-Sizes-*/
define symbol __ICFEDIT_size_cstack__ = 0x2000;
define symbol __ICFEDIT_size_heap__   = 0x2000;
/**** End of ICF editor section. ###ICF###*/
Have a great day,
TIC
 
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
0 项奖励
回复
1,599 次查看
hiephuynh
Contributor III

My .icf has the same defines.  The "Set Active Boot Bank" command is also working for me now.  Thanks.

0 项奖励
回复