Dear Friends,
Hello,
I want to read/write flash memory of lpc1752. But it was not working So i tried to read the part id. But when i debug my code in keil uvision4 my code stuck in HardFault_Handler here is my code :
typedef void (*IAP)(unsigned long [],unsigned long[]); IAP iap_entry; IAP iap_entry = (IAP) IAP_LOCATION; unsigned long iap_read_part_id(void) { unsigned long command[5]; unsigned long result[5]; command[0] = 54; iap_entry(command,result); printf("result = %X\r\n",result[1]); return result[1]; }
Please help me to find out why HardFault_Handler occurs and how to resolve this problem Thank You ...
Well, it was just my guess/assumption that Keil only simulate the chip based on the hardware documentation available, and not based on secret firmware code written by the chip manufactuer.
If your simulator doesn't have any NXP IAP firmware then no other Keil simulator has it either.
What to do? Use a real chip. Only a real chip is guaranteed to perform 100% as a real chip...
To : Per Westermark
I understood your point and agree with it.
I am testing my code on hardware since afternoon which is working on hardware.
Now I am able to write into flash memory :)
Thank You Westonsupermare Pier and Per Westermark for your help.