LPC54113 IAP strange behavior ( Hangs )

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC54113 IAP strange behavior ( Hangs )

Jump to solution
479 Views
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 Kudos
Reply
1 Solution
459 Views
andreasruetten
Contributor III

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

View solution in original post

0 Kudos
Reply
2 Replies
462 Views
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 Kudos
Reply
460 Views
andreasruetten
Contributor III

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

0 Kudos
Reply