LPC1768: IAP reinvoke results in hard fault

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

LPC1768: IAP reinvoke results in hard fault

跳至解决方案
1,884 次查看
volkerweber
Contributor II

Hi there,

 

I am trying to use the reinvoke functionaliry of the IAP set on my LPC1768 but it always results in an Hard Fault error (see attached picture). To use the reinvoke feature I do the following as suggested in the manual:

 

__disable_irq();

LPC_SC->PLL0FEED  = 0xAA;   
LPC_SC->PLL0FEED  = 0x55;    
LPC_SC->PLL0CON   = 0;    
LPC_SC->PLL0FEED  = 0xAA;    
LPC_SC->PLL0FEED  = 0x55;    
LPC_SC->CLKSRCSEL = 0;    

unsigned int cmd[5], res[5];    
cmd[0] = 57;  
__set_MSP(*((uint32_t *) 0x1FFF0000));
iap_entry(cmd, res);‍‍‍‍‍‍‍‍‍‍‍‍‍

 

Are there any mandatory steps before trying to use this, e.g. regarding the timing? As I cannot debug the functions inside the boot rom memory area (0x1FFF 0000 - 0x1FFF 1FFF) I do not see how to progress here.

 

Any help is appreciated, thanks in advance

标签 (1)
标记 (2)
0 项奖励
回复
1 解答
1,745 次查看
volkerweber
Contributor II

I managed to get it to work. Quoting the manual:

It maps boot vectors, sets PCLK = CCLK / 4, configures UART0 pins Rx and Tx, resets TIMER1 and resets the U0FDR (see Section 14.4.12).

In my point of view, that does not include that TIMER1 has to be enabled, however this solves it:

LPC_SC->PCONP |= CLKPWR_PCONP_PCTIM1;‍‍

Perhaps this is also useful for somebody else.

在原帖中查看解决方案

0 项奖励
回复
1 回复
1,746 次查看
volkerweber
Contributor II

I managed to get it to work. Quoting the manual:

It maps boot vectors, sets PCLK = CCLK / 4, configures UART0 pins Rx and Tx, resets TIMER1 and resets the U0FDR (see Section 14.4.12).

In my point of view, that does not include that TIMER1 has to be enabled, however this solves it:

LPC_SC->PCONP |= CLKPWR_PCONP_PCTIM1;‍‍

Perhaps this is also useful for somebody else.

0 项奖励
回复