Skip to main content
Visitor II
April 22, 2020
Question

STM32L496 Bootloader

  • April 22, 2020
  • 10 replies
  • 2692 views

Hi,

my STM32L496 Controller ist booting only into the internal bootloader. BOOT0 Pin is low, a valid program is on 0x08000000 and if I set the PC and SR with the values I found on 0x0800.0000 and 0x080.00004 the controller does it's job. What could be wrong?

Where can I find a description what does the controller do while booting?

creetings and stay healthy

Josef

    This topic has been closed for replies.

    10 replies

    Super User
    April 22, 2020

    To run the internal bootloader, BOOT0 needs to be high at reset, not low.

    josef2Author
    Visitor II
    April 22, 2020
    I don’t want jump into the bootloader!!! The reason is, that the controller is jumping into the bootloader while the BOOT0 Pin is low on reset. BOOT0 Pin is low, a valid program is on 0x0800.0000 and if I set the PC and SR with the values I found on 0x0800.0000 and 0x080.00004 the controller is doing its job. Best regards Josef Baumann Prime Mess- und Regeltechnik e.K. Prinz-Eugen-Str. 65 94034 Passau Tel.: +49-851-41041 Fax.: +49-851-41042 web: <> www.prime-micro.de Eintragungsort: Amtsgericht Passau Nr.: HRA 11115 USt - IdNr.: DE130891551 Steuernummer: 153/203/00948
    Super User
    April 22, 2020

    > my STM32L496 Controller ist booting only

    *shrug*

    "ist" is quite close to both is and isn't. Suppose I guessed the wrong one.

    Graduate
    April 23, 2020

    Does cycling the power make a difference? If I've downloaded a program to my STM32L4 chips, and used a switch to change the state of BOOT0, the program doesn't start after a reset. I have to cycle the power to get the program to run (refer to https://community.st.com/s/question/0D50X0000AwYH76SQG/nucleo64-nrst-not-enough-for-entering-bootloader-only-power-cycle). Not sure why it does it, and it is bloody annoying, but I've learnt to live with it....

    josef2Author
    Visitor II
    April 23, 2020

    Hi,

    that's it. But I don't understand it. I can repeat the behavior when I clear the flash and start the controller after cycling the power.

    Do you have any idea why this is so?

    best regards

    Josef

    Super User
    April 23, 2020

    Check the option bytes. In particular, the nBOOT0 and nBOOT1 bits. You may have overridden the default behavior and told it to boot into system memory regardless of the state of BOOT0.

    josef2Author
    Visitor II
    April 30, 2020

    Hi TDK,

    look at the answer from gregstm and my response!

    josef2Author
    Visitor II
    October 5, 2020

    Hi,

    After 5 month I have the same problem with a new design.

    A resolution for the problem is to change the option bytes and after that to set it to their default values. The controller then is working well. Is It possible that there is an error in the chip?

    best regards

    Josef

    Super User
    October 5, 2020

    It's unlikely the chip has a fatal flaw such as ignoring the value on the BOOT0 pin during startup. Probably something else going on.

    josef2Author
    Visitor II
    October 5, 2020

    Hi,

    I don't think, that I can do anything wrong when I use the schematics of the original eval board. Here's the schematic.

    best regards

    Graduate
    October 6, 2020

    unrelated to the topic, but.... should the pull-ups you have on PD11/PD12 be on PD12/PD13 instead?

    Graduate
    October 6, 2020

    I think JW may have answered this question for both of us:

    https://community.st.com/s/question/0D53W00000HN1WFSA1/mcu-doesnt-boot-in-normal-mode-after-readout-protection-done-via-rom-bootloader

    That is: " The 'L46x have an AN2606-Pattern-6 bootloader entry, i.e. they enter bootloader if the FLASH is "empty" - and the FLASH_SR.PEMPTY bit is reloaded only at power-on reset and OBL_LAUNCH command."

    Note: 'L496 also uses pattern-6

    This would explain why cycling the power after loading the program (but before setting the BOOT pin low) still allows the program to run properly from reset (after the BOOT pin is set low.

    I haven't tried his suggestion yet: "So, maybe you can try to load a stub into RAM which performs OBL_LAUNCH, after programming."