2017-08-23 09:35 PM
Hello everyone
I have a little problem to get help from everyoneI'm working on FOTA using the STM32L1, after loading the bootloader and the application (using Jlink v9 programer), the mcu runs normally. If I download and update the application for the first time, everything is normal and the new program is updated in the MCU but if I use FOTA again, during the download process *bin file, the mcu flash will fail on the last part of the *bin file, which can not be written to the flash, while the previous part of the file (512 bytes) has been written to the previous successful flash.If I reload the application using the jlink loader and run the FOTA program, everything should be as before (the first FOTA is OK, the second time the error occurs)Here are some functions I used in the program (std lib)
/ * Delete Page * /
FLASH_ClearFlag (FLASH_FLAG_BSY |FLASH_FLAG_EOP |FLASH_FLAG_WRPERR |FLASH_FLAG_PGAERR |FLASH_FLAG_SIZERR |FLASH_FLAG_OPTVERR);/ * ------------------------------------------------ ------------------------------- * // * Write to Flash - Error Occurred Here * /FLASH_FastProgramWord (lAddress, plTemp [i]);The FOTA program I use on the STM32F1xx chip is all right, then I modified it to fit the STM32L1 chip library then the problem happened
Thank you for your interest