cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 crashed during programming flash

zoltan2
Associate II
Posted on September 12, 2014 at 13:43

Hi,

My project crashed during programming of STM32L152 internal flash.

Crashing means, that I cannot halt CPU; no hard fault nor bus fault interrupt only CPU freezed.

Project runs CMSIS-RTX RTOS. Program is running in a separated area of flash.

It is separated in linker file. Flash programming routine (half page write) is running from SRAM.

Have anyone an idea what the problem could be?

Thanks

Zoli

#fash-programming #crash
2 REPLIES 2
frankmeyer9
Associate II
Posted on September 12, 2014 at 14:04

Getting the MCU into system mode (by setting the BOOT0/BOOT1 pins appropriately while power up) and doing a mass erase (with the Flash Loader Demonstrator software) should fix the problem.

There are several threads around here describing this procedure.

However, I never personally tried it on a L15x MCU.

zoltan2
Associate II
Posted on September 12, 2014 at 20:15

Thank you for your help. I installed Flash Loader Demonstrator software and erased chip, but not hepled.

However I solved the problem in the meantime.

Earlier I already tried to disable interrupt during erasing/programming flash, but didn't work.

Then I found, that RTX runs tasks in unpriviledged mode, and couldn't disable interrupt.

Switching to priviledged mode and disabling interrupt during flash programming my project got to work.