This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

IAP Code ends up in HardFault_Handler

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 ...

Parents
  • Debugging in Simulator.

    Q:Does the simulator actually contain a copy of the NXP boot loader that performs all IAP actions?
    A: I am using keil uvision4, but I am not sure whether it has the copy of the NXP boot loader or not.

    How do I check that???
    And if it does not have copy of the NXP boot loader then what should I do???
    Do I need to install any other version of Keil?? or need to Install extra packages???

Reply
  • Debugging in Simulator.

    Q:Does the simulator actually contain a copy of the NXP boot loader that performs all IAP actions?
    A: I am using keil uvision4, but I am not sure whether it has the copy of the NXP boot loader or not.

    How do I check that???
    And if it does not have copy of the NXP boot loader then what should I do???
    Do I need to install any other version of Keil?? or need to Install extra packages???

Children
  • 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.