AnsweredAssumed Answered

IAP functions sometimes return error

Question asked by Mosi Yaghi on Sep 19, 2017
Latest reply on Sep 19, 2017 by Carsten Groen

Guys I have a problem with IAP inside some of LPC1778 boards.

I'm using IAP functions to upgrade the firmware using USB memory stick. 

Why on earth would any of the IAP functions (listed below) return an error?

1- IAP_PreSectorForReadWrite();

2- IAP_CopyRamToFlash()

3- IAP_Compare()

4- IAP_EraseSector()

5- IAP_BlankCheckSector()

There are totally 30 sector which my bootloader is located on the last sector (#29). 

Sometimes it goes and everything is good but when it gets to for example Sector #24 it returns an error after IAP_Compare() function. 

What could possibly be wrong ?

This way I will loose my firmware cause I've just erased entire 28 sectors before copying new firmware onto flash and the new firmware is not installed correctly so I'm screwed !

the weird thing is that it goes well for most of the time specially the first try but it fails on the second try. 

How am I supposed to have a robust and reliable bootlader ?

Please help.