LPC54113 IAP strange behavior ( Hangs )

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

LPC54113 IAP strange behavior ( Hangs )

跳至解决方案
617 次查看
andreasruetten
Contributor III

Hello,
my program hangs if i use IAP commands ...
But only without debugger. Without Debugger it hangs, and never comes back again

Clock is 120Mhz

MCUXpresso 11.8.1

Debugger j-link

Code :

unsigned int lpc5410x_prepare_sector(unsigned int sector)

{

unsigned int command[COMMAND_LENGTH];

unsigned int result[RESULT_LENGTH];

iap iap_entry = (iap) IAP_LOCATION;

command[0] = COMMAND_PREPARE;

command[1] = sector;

command[2] = sector;

(*iap_entry)(command, result);

printf("The result of prepared sector number (%d) is %d", sector, result[0]);

return result[0];

}

 

Called from :

int SaveEepromVal(uint32_t Val)

{

uint8_t Data[256];

 

Data[0] = (uint8_t) (Val & 0xff);

Val = Val >> 8;

Data[1] = (uint8_t) (Val & 0xff);

Val = Val >> 8;

Data[2] = (uint8_t) (Val & 0xff);

Val = Val >> 8;

Data[3] = (uint8_t) (Val & 0xff);

 

__disable_irq();

 

Blink() ;

 

 

Val = lpc5410x_prepare_sector(7);

 

 

Val = lpc5410x_erase_sector(7);

 

Val = lpc5410x_prepare_sector(7);

 

Val = lpc5410x_program_sector( BOOT_VAL_ADDR, &Data, 256);

 

__enable_irq();

 

return 0;

}

 

Any Ideas, what the difference with segger j.link and without?

Andreas

 

 

0 项奖励
回复
1 解答
597 次查看
andreasruetten
Contributor III

Hello,
i found my problem by myself...
It was the printf which causes the crash...
Andreas

在原帖中查看解决方案

0 项奖励
回复
2 回复数
600 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @andreasruetten 

 

Without a debugger, which way to communicate with the device for programming purpose?Please present all the specific steps involved.

 

BR

Alice

0 项奖励
回复
598 次查看
andreasruetten
Contributor III

Hello,
i found my problem by myself...
It was the printf which causes the crash...
Andreas

0 项奖励
回复