.ICF(IAR) Changes Flash bootloader

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

.ICF(IAR) Changes Flash bootloader

1,499 次查看
kalidassb
Contributor II

Hi,

   I'm using Freescale controller for bootloader design when i'm running in ram debug mode flash is writing but when i'm selecting flash.icf through IAR execute flash write command sequence MCU getting reset.

i am not changed any .ICF boot location, whether it is need to change start location? 

define symbol __ram_vector_table_size__ = isdefinedsymbol(__flash_vector_table__) ? 0 : 0x00000400;
define symbol __ram_vector_table_offset__ = isdefinedsymbol(__flash_vector_table__) ? 0 : 0x000003FF;

define symbol m_interrupts_start = 0x00000000;
define symbol m_interrupts_end = 0x000003FF;

define symbol m_flash_config_start = 0x00000400;
define symbol m_flash_config_end = 0x0000040F;

define symbol m_text_start = 0x00000410;
define symbol m_text_end = 0x0007FFFF;

define symbol m_interrupts_ram_start = 0x1FFF8000;
define symbol m_interrupts_ram_end = 0x1FFF8000 + __ram_vector_table_offset__;

define symbol m_data_start = m_interrupts_ram_start + __ram_vector_table_size__;
define symbol m_data_end = 0x1FFFFFFF;

define symbol m_data_2_start = 0x20000000;
define symbol m_data_2_end = 0x20006FFF;

/* Sizes */
if (isdefinedsymbol(__stack_size__)) {
define symbol __size_cstack__ = __stack_size__;
} else {
define symbol __size_cstack__ = 0x0400;
}

if (isdefinedsymbol(__heap_size__)) {
define symbol __size_heap__ = __heap_size__;
} else {
define symbol __size_heap__ = 0x0400;
}

0 项奖励
回复
3 回复数

1,219 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Kalidass B,

     When you do the flash operation in the kinetis chip, you should pay attention to these points:

1. Copy the flash launch command in the RAM instead of the flash.

2. Before do the flash operation, please disable the global interrupt at first, after the flash operation is finished, then you can enable the global interrupt again.

More details, you can refer to the KBOOT sample code from this link:

Kinetis Bootloader|NXP 

Wish it helps you!

If you still have question, please let me know!


Have a great day,

Kerry

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

0 项奖励
回复

1,219 次查看
kalidassb
Contributor II

Hi Kerry,

              I was tested with same points earlier even though still MCU is reseting when initialise the flash.

any other consideration i have follow please suggest me.

1.flash commands are copied  to ram location

2.interrupt enable and disable

when i select the flash .Icf for debug the hard fault handler issue is getting.

Regards,

Kalidass

0 项奖励
回复

1,219 次查看
kerryzhou
NXP TechSupport
NXP TechSupport

Hi Kalidass B,

   Some other considerations:

1.When the icf is not match with your chip flash size, there also have the problem.

   So, please check you chip's flash address range, is that correct?

   Please find an official IAR sample code for your chip, and whether use the official code have problem on your side?

  2. Did you use the correct head file?

  You can tell me the part number of your chip , I will help you to find a sample code.


Have a great day,
Kerry

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

0 项奖励
回复