lpcware

IAP call

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Yuriy on Thu May 23 02:42:41 MST 2013

Hi all.


When trying to call the function, the system hangs (LPC4357).


What am I doing wrong?


--------------------------------------------------------------------


#define IAP_ADDRESS (0x10400100UL)


uint32_t param_table[6];
uint32_t result_table[6];


void iap_entry(uint32_t param_tab[],uint32_t result_tab[])


{


    void (*iap)(uint32_t [],uint32_t []);


    iap = (void (*)(uint32_t [],uint32_t []))IAP_ADDRESS;


    iap(param_tab,result_tab);


}


uint32_t blank_check(uint32_t flash_bank, uint32_t sector)
{
    param_table[0] = 53;      // BLANK_CHECK_SECTOR
    param_table[1] = sector;
    param_table[2] = sector;
    param_table[3] = flash_bank;
    __disable_irq();
    iap_entry(param_table,result_table);
    __enable_irq();

    return (result_table[0]);
}


--------------------------------------------------------------------


Thanks.

Outcomes