cancel
Showing results for 
Search instead for 
Did you mean: 

PH3-BOOT pin

MNapi
Senior III

I did pulled up pin PH3-BOOT high (3.3V). I tried simple code but it looks like it is sitting there and doing nothing. I get this error message. Most chips would have just BOOT pin one function not PH3-BOOT.

Multiple errors reported.

1) Failed to execute MI command:

-var-create - * b

Error message from debugger back end:

-var-create: unable to create variable object

2) Unable to create variable object

3) Failed to execute MI command:

-data-evaluate-expression b

Error message from debugger back end:

No symbol "b" in current context.

4) Failed to execute MI command:

-var-create - * b

Error message from debugger back end:

-var-create: unable to create variable object

I do not see if I need to change anything. I wonder if it has to do anything how the chip boot up0693W00000aJmPBQA0.png

1 ACCEPTED SOLUTION

Accepted Solutions

Great, hope the question has been answered?

If the problem is solved, please mark this thread as answered by selecting Select as best, as also explained here. This will help other users find that answer faster.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

7 REPLIES 7
Peter BENSCH
ST Employee

Well, as the screenshot says: with BOOT0=1 you boot from the system memory. This puts you in the bootloader, which waits for commands from outside. Since none comes, it waits.

If you want to start your user program normally, you should set BOOT0 to logical zero, in the simplest case directly to GND, if you need the boot loader later, set it to GND via a pull-down.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
MNapi
Senior III

Thanks for responding. I got this pin connected to GND and it works now. Each BOOT pin had to be connected to VDD in other STM32 I worked with. This is the first time I see something different

I tired to setup this PH3 pin as output in CubeMX then

HAL_GPIO_WritePin(GPIOH, GPIO_PIN_3, GPIO_PIN_RESET);

it did not work this way. Why would the PIN be setup as regular GPIO in CubeMX. Since it has to be physically grounded, so it cannot work as regular GPIO pin.

Unless I ground it through resistor, so when it boots PIN PH3 is at logical 0 but later I suppose I could use it as GPIO pin. I did not check if it works this way.

What would be the use for this ? there are over 100 GPIO pins in this chip another one do not make any difference.

Peter BENSCH
ST Employee

BOOT0 has always had to be set to logical 0, but there are derivatives with a BOOT1 that has to be set to logical 1. However, this cannot really be generalised, since in the meantime it can also be determined via option bits whether BOOT0 is queried for the decision or not.

You didn't mention it, but according to the screenshot, your specific case is STM32L4R/S, where in fact PH3-BOOT0 is a dual function pin to provide as many pin functions as possible. Its datasheet says in section 3.8 Boot modes:

The BOOT0 value may come from the PH3-BOOT0 pin or from an option bit depending on the value of a user option bit to free the GPIO pad if needed.

And RM0432, section 8.3.15 Using PH3 as GPIO mentions:

PH3 may be used as boot pin (BOOT0) or as a GPIO. Depending on the nSWBOOT0 bit in the user option byte, it switches from the input mode to the analog input mode:

  • After the option byte loading phase if nSWBOOT0 = 1.
  • After reset if nSWBOOT0 = 0.

So the user has the choice of what to do with PH3-BOOT0:

  • If he fixes it to GND, it obviously serves only as a BOOT0 pin and you cannot and should not use it as an output.
  • If, on the other hand, you connect it to GND with a pull-down of e.g. 10...100kohms, you can also use it as GPIO PH3, whereby only the pull-down must not interfere with your circuit.

Clear now?

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
MNapi
Senior III

Thanks Peter. You sometimes do a stupid small mistake like this and you do not know what is going on.

I designed a few boards lately with STM32F446RET6, STM32L071RBT7 and I did indeed have BOOT pin connected to GND through 10K resistor.

I have no idea what I was thinking connecting this time to 3.3V and I couldn't find what was the problem. I am aware of multiply boot pins on other chips and various functions.

thanks

MNapi
Senior III

I am checking other board I did recently it has also the same chip STM32L4S9ZIT6 and it is grounded here correctly.

Great, hope the question has been answered?

If the problem is solved, please mark this thread as answered by selecting Select as best, as also explained here. This will help other users find that answer faster.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Using STM32 cube programmer I have flashed boot option using option bits and later I have flashed application and It's working fine. Is there is any other way to make application start from system memory?