cancel
Showing results for 
Search instead for 
Did you mean: 

GPIO state when unprogrammed

Posted on April 05, 2018 at 07:31

Hello there,

Is there any set state of the GPIO's when the MCU (STM32L4 in my example) is unprogrammed? Or more likelly, when the MCU is in the system bootloader (I believe thats where the program counter is before I flash the MCU with anything). It seems to me that the GPIO are set as outputs HIGH or have pull-ups set.

I would appreciate all help.

#gpio
23 REPLIES 23
Posted on April 05, 2018 at 10:13

But this behavior would violate the intended functionality. Because if EN will be pulled high at startup (lets say no code in flash or MCU powered off), then the converter will be turned off. The goal is to have everything turned off at startup and turn it on eventually with MCU code. Thats why I wanted to pull down the EN line and turn off the Q1.

Posted on April 05, 2018 at 10:21

Its a P-Channel FET, pull down to turn on.

:(

Posted on April 05, 2018 at 10:36

does the converter power the MCU ?

are you using a push button to power ON ?

stabbing in the dark here...

Posted on April 05, 2018 at 10:40

No, the converter powers some additional peripheral the MCU is interfacing with. Its the MCU who is turning the converter ON and OFF. When MCU turns the converter off, the device would still be on for couple seconds because of the high capacitance of 3V8 node. Thats why Q1 was introduced to discharge that voltage on 3V8 node when turning off the converter. It doesnt serve for anything when the converter is turned ON.

Posted on April 05, 2018 at 10:44

Also, the EN line is 0 V after disconnecting PB8.

The floating PB8 on the other hand is 3.3 V.

PB8 pulled with 10k resistor to ground is 0.7V. So it seems like there is a pull-up resistance on PB8 pin around 37 kR...?

120k pull-down gives 2.5V, so the pull-up resistance equals around 38 kR. This seems to be a pattern.

Posted on April 05, 2018 at 11:48

I checked the STM32L472 datasheet, PB8 has no obvious special interest, like JTAG/SWD. it should be floating,

note: After reset, these pins are configured as JTAG/SW debug alternate functions, and the internal pull-up on PA15, PA13, PB4 pins and the internal pull-down on PA14 pin are activated. ( not PB8)

does the bootloader use PB8 ?

alternate functions are nothing special:

TIM4_CH3,

I2C1_SCL,

DFSDM1_

DATIN6,

CAN1_RX,

LCD_SEG16,

SDMMC1_D4,

SAI1_MCLK_A,

TIM16_CH1,

EVENTOUT

38K sounds like a processor pull up , yes..

I see this note in the Reference manual, RM0351

8.4.4 GPIO port pull-up/pull-down register (GPIOx_PUPDR)

(x = A..I)

Address offset: 0x0C

Reset values:

• 0x6400 0000 for port A

• 0x0000 0100 for port B

• 0x0000 0000 for other ports

indicating PB4(jtag/swd) is pulled up at reset, not PB8

you may want to consider using a transistor to stop it coming ON at startup, or try another pin..

there may be some errata on that chip.

Max
ST Employee
Posted on April 05, 2018 at 13:54

Hello,

You will find the reset state of each pin given in the pinout description of the datasheet of your device.

Typically, all pins are in analog mode except for a few pins described in the notes (JTAG/SWD pins for example) 

If you want to know the pin state during the bootloader execution, I recommend looking up your device inside 

http://www.st.com/content/ccc/resource/technical/document/application_note/b9/9b/16/3a/12/1e/40/0c/CD00167594.pdf/files/CD00167594.pdf/jcr:content/translations/en.CD00167594.pdf

.

You should be able to find what communication peripherals are enabled and on what pins. 

It is wise to check these are not conflicting with your application.

Note that some conflicts may also prevent the bootloader from operating correctly.

This is not so uncommon to have application/bootloader conflict see:  

https://community.st.com/message/146941-stm32l4-bootloader-wishlist-item

 

regards

Posted on April 05, 2018 at 11:56

you should check it.. this is the wrong reference manual for that chip.

Posted on April 05, 2018 at 12:08

I think in your example PB1 has pull-up nor PB4, if I read the datasheet correctly. For my MCU:

0690X0000060ARBQA2.png

It would seem that:

PB15 is pulled up

PB 14 is pulled down

PB 13 is pulled up.

Posted on April 05, 2018 at 12:18

That's how I read it too,   (it was PB4 pulled, up, hard to read,)

check the errata on the chip, maybe someone from  ST can answer you ???

if you have any product volume, the FAE will respond, did you try him ?