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

Writing to flash without debugger crashes

Hi,

I wrote a program, where some data is written to the internal flash of a stm32f4.
If I am debugging everything works fine, but if the controller runs without the debugger, the data is not written.

Can somebody tell me why this happens?

Parents
  • Your code is broken? Or makes invalid assumptions?

    Perhaps you are not setting things up properly, or expecting clocks/status to be in some specific state, and the debugger leaves them in a non-default state?

    Without a debugger you can still output data via a USART, or status via GPIO/LED. Where exactly does your code, and flash programming/erasing sequence fall over?

    I'd assume you'd at least need to unlock and clear the flash controllers flags/errors/status before starting.

Reply
  • Your code is broken? Or makes invalid assumptions?

    Perhaps you are not setting things up properly, or expecting clocks/status to be in some specific state, and the debugger leaves them in a non-default state?

    Without a debugger you can still output data via a USART, or status via GPIO/LED. Where exactly does your code, and flash programming/erasing sequence fall over?

    I'd assume you'd at least need to unlock and clear the flash controllers flags/errors/status before starting.

Children
No data