cancel
Showing results for 
Search instead for 
Did you mean: 

Boot problem in STM32WLE5

kalpesh-Dryad
Visitor

Hello ST,

 

We are using the STM32WLE5 controller in our product.

The system always works on 1.8V. Based on demand, we switch to 3.3V and fallback to 1.8V.

Our product is IoT-based, charged through solar to a supercapacitor.

The main problem is that the controller is booting from the embedded bootloader even after setting boot options, which I will describe later.

We require that it must boot from the user flash, not from the system bootloader, because a few GPIOs, like PA4 and PA7, used in the internal bootloader for SPI are used in our circuit, which turns on the supply of some components, which can consume a lot of power, and the power line goes down below 1.71V, which results in restarts while boot up if there is no enough charge in super capacitor.

The settings that I use to boot from the user flash mentioned below,

1. I set BOOT_LOCK, and based on the boot table here in the section "2.2 Boot configuration", it must boot from the user flash, but no luck.

2. Here I clear the nSWBOOT0 option bit, And set nBOOT0 & nBOOT1 option bits. Also, code is present in the user's flash area(at 0x08000000). It means the system must boot from the user flash area, but again no luck. I tried these settings by setting & clearing the BOOT_LOCK bit, but no success.

3. Please note that we are using the PH3 pin(BOOT0) in our circuit, which can stay high by default, but based on the above settings, the System should ignore it, and must boot from user code. But still, as a last try, I tied that pin to the ground directly, so there is no chance that this pin will go high. And then I set the nSWBOOT0 bit so the system will consider the boot0 from PH3, which is again low. User code is also present, so based on the same boot table, it must execute user code, but no luck.


Let me answer a few questions, so there won't be any doubt.

How system check the user code is there?

First 2 words from address 0x08000000, First word is MSP(which falls in RAM), and second is PC(which falls in ROM), Attaching image? It means Flash always contains valid code.

kalpeshDryad_0-1763066406831.png

How do I verify that the system executes the embedded/system bootloader?

When there is no power, Power lines are at 0V.

As soon as the super capacitor has enough voltage(~2V), the Output voltage increases(From 0 to 1.8V) and reaches above 1.71V(Default brownout level), the controller starts, and PA4 & PA7 are floating by default, then the internal boot loader executes and switches it high and low, And external circuit sucks all the power and controller brnout immidietly. That kind of operation on PA4 and PA7 we never do in our code on power up, because we just sleep on the first line of the code, until the supercapacitor reaches 3.6V and gives an interrupt to wake up and do the job. Attaching an image for more clarity. Here, slightly bottom yellow pulses are on PA7, and the top green line is VDD to the controller.

IMG_6364.jpg

 

One more thing I checked was the virtual address at SYSCFG memory remap register (SYSCFG_MEMRMP), It's value is zero means the Main flash memory is mapped at CPU 0x00000000

 

Can you please help here? What are we doing wrong, and why does the controller execute the system bootloader instead of the user flash code even after the option boot settings?

 

Thank you very much in advance.

 

Best Regards,

Kalpeshkumar Ramani

0 REPLIES 0