Skip to main content
Visitor II
August 8, 2022
Question

Question about STM32 MCU that does not perform the program on it's flash memory, after turning it off, and then on.

  • August 8, 2022
  • 5 replies
  • 3156 views

Hi, 

I'm using STM32 MCU: STM32L4A6AGIxP.

The IDE that I use to write the code for the MCU is: STM32CubeIDE v1.10.1.

The BOOT0 pin of this MCU is floating and not connected to GND.

The big problem that the MCU is SMT FBGA type and and soldered to the PCB, 

so I can't detach it from the PCB and do a direct solder between the BOOT0 pin, to a resistor that connected to GND.

In the IDE, after flashing the MCU in debug mode, the program loaded and performed correctly, but after exiting from debug mode, powering off and powering on the PCB again, the MCU do nothing and doesn't preform the program.

I've noticed that the the program is still exist on the MCU's flash memory, from address 0x0800000, after turning off & on the MCU. 

I suspect that because the situation, that BOOT0 is floating, the program that was burned to the flash memory, isn't loaded to address 0x00000000 on this MCU's memory, and is not performed.

My question: What can I do now with the given situation, that BOOT0 pin is not connected to GND in the soldered smt-fbga MCU, in order to perfrom the flashed program? Can I set BOOT0 programmatically in this MCU model, so that after turning on the processor, the software that is burned on its flash memory will be executed?

Many thanks in advance, and best regards,

Ran

    This topic has been closed for replies.

    5 replies

    Super User
    August 8, 2022

    Read the Option bytes section in the reference manual. Seems possble by setting nSWBOOT0 and nBOOT0 bits accordingly. Use STM32CubeProgrammer.

    hth

    KnarfB

    Graduate II
    August 8, 2022

    RM0351 section 2.6.2 "Boot configuration for STM32L49x/L4Ax devices".

    Setting nSWBOOT0=0 seems to be enough.

    And next time read the AN4555 before designing PCB.

    REldo.1Author
    Visitor II
    August 8, 2022

    Thanks all,

    How can I set nSWBOOT0 and nBOOT0 ?

    My PCB supports J-link segger, not the ST-link offical debugger, and the problem is that STM32CubeProgrammer does not support J-link as I've seen, only ST-link, so how can I control the nSWBOOT0 & nBOOT0 parameters?

    Thanks alot!

    Super User
    August 9, 2022

    The Segger software should have a way to program the option bytes.

    REldo.1Author
    Visitor II
    August 9, 2022

    Dear Pavel & Piranha,

    I'm using 'SEGGER J-Flash v6.88c' software, I've searched there for an option to program the option bytes, but I didn't find this threre.

    Do you know in which Segger software this option is included?  

    And about the ' FLASH_OPTR' register, in the STM32CubeIDE, for the MCU that I'm working with (STM32L4A6AGIX), there is no an field called nBOOT0 & nSWBOOT0, as shown in the attached picture.

    So how can I configure BOOT0 now, that in a programmatically way, the MCU will load the burned program, from flash to adress 0x00000000, and will run the program after turning it on.

    Many Thanks!0693W00000QNJ4RQAX.png

    Super User
    August 11, 2022

    The option bytes are in addresses 0x1FFF7800-1FFF7820 (bank1)

    On your picture are shown the flash control registers. They reflect the state of the option bytes in runtime.

    The Segger J-LINK forum is here. You can ask them directly.

    Their J-FLASH software has kind of scripting ability, one can write a script to manipulate the flash registers.

    The best IMHO is to follow the advice of @Piranha : write a small program to set these bits. And be done with it. Run it in RAM, if your debugger allows this.

    REldo.1Author
    Visitor II
    August 16, 2022

    Thanks you all,

    I'll try this :)