STM32L412 port B not working properly  - Page 1
Forum section: electronics / general

author: rokspy
author_rank: Contributor
timestamp: March 20, 2021, 11:34:32 pm
content: Hello,I have a weird one.. So I have a board with STM32L412CB, on which I can upload code and everything seems okay, the values in registers also changes as expected (ODR for example), Output states are okay besides few pins that are very weird:PB8 do not respond and has 1.2V, which I think is the internal core voltage of the STM. PB9 outputs PB8 state. PB11 do not respond and has 1.2V. PB15 does not respond and has no voltage. Nothing seems to be shorted out and continuity for pins also seem ok. pinout matches datasheet as far as i can see.Single voltage is used throughout the board - 2.5VAny ideas, what could cause this or what can be checked? I did have a chip that died isntantly on the board (suspecting faulty soldering) with the first power on, it had connections with the mcu, but they should have been high-z as there was no code on the MCU at that point. Any ideas what could cause this or what can be checked? Heat from hot air gun damage?Thanks!

author: DavidAlfa
author_rank: Super Contributor
timestamp: March 21, 2021, 01:09:56 am
content: Are they connected to anything else?Did yoy try only using GPIO in the firmware, not using any other peripherals?I guess it's a custom board so you can't share more details?

author: rokspy
author_rank: Contributor
timestamp: March 21, 2021, 05:52:23 pm
content: *) PB8 goes to connector and has no connection at this point*) PB9 is for debug LED, and no other connection*) PB11 was connected to the chip that was damaged and desoldered so it is open at this point, but still nothing changes when GO is changed*) PB15 was meant as a SPI MOSI, that is shared between the desoldered chip and one other device, but also does not respond to ODR changes.Just used GPIO to see what's wrong with each pin because the debug LED (PB9) did not respond, started probing around and found out that when I set PB9 as high nothing happens on the actual PB9, but PB8 turns HIGH. And when PB8 is set to LOW, PB9 goes LOW. There is no continuity between PB8 and PB9But the events were in the following order:1) Soldered devices on the board2) Powered on, the board ate 200mA, but no short, suspected that one of the chips could be the fault because of pain in the ass package2) Desoldered the chip, and consumption dropped to the expected value3) Tried uploading code, all good4) Tried turning on LED, LED does not respond5) Checked every PORTB output and came to conclusion that PB8,PB9,PB11,PB15 does not work properly. Other pins are OK

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 21, 2021, 05:58:01 pm
content: Is this a QFN package?

author: AndyC_772
author_rank: Super Contributor
timestamp: March 21, 2021, 06:09:45 pm
content: If there's any doubt at all about whether the CPU might be damaged, change the chip for a new one.If the fault goes away, great, you found the problem. If not, then at least you've learned that it's probably not a faulty device; even if it's damaged by excessive soldering heat, the chances of a second part failing in exactly the same way as the first are minimal.

author: rokspy
author_rank: Contributor
timestamp: March 21, 2021, 06:28:26 pm
content: The STM32 is LQFP

author: rokspy
author_rank: Contributor
timestamp: March 21, 2021, 06:32:02 pm
content: Makes sense. Just have one spare at the moment, and then have to do additional order. Wanted to explore causes before the next attemptThanks

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 21, 2021, 06:38:24 pm
content: Well you already guessed it. Could be either a damaged chip, soldering issues or bad IO configuration.Have you made sure your IO configuration is correct? In particular, and we happened to talk about it lately, you need to enable the APB clock for each GPIO port before configuring pins, otherwise it won't work. And of course make sure there is no alternate function assigned to any of the IOs you are using.

author: DavidAlfa
author_rank: Super Contributor
timestamp: March 21, 2021, 06:41:21 pm
content: On next try, only solder the STM32, isolating it from any other active parts.For non active parts (leds, resistors), ensure the value is correct.Recently, I bought some 6.8Kohms resistors, nothing worked, then I saw they were 6R8!Luckly it was only a voltage divider for a 10K pullup, so nothing was damaged.It's strange that a MCU fails itself, but sometimes it happens.Some weeks ago I soldered a stm32F103, it worked nicely.After flashing it a few times, it suddenly died. I was just doing software tests, nothing was connected to the board.Well, the problem was that the Reset pin internally shorted to ground (measured 39ohms).There was nothing connected to it, only a 100nF capacitor. Removed the stm32 from the board and the short was still there.Replaced it and didn't fail again. So yeah, it was a defective one.

author: rokspy
author_rank: Contributor
timestamp: March 21, 2021, 08:47:34 pm
content: The GPIO ports are directly connected to the AHB2 in this device, but I have enabled the clock for this GPIOB port, and the IO configurations also seem okay as other pins on the same port work as expected. Probably gonna solder the next device and hope for the bestAnyways, thanks for the input!

author: rokspy
author_rank: Contributor
timestamp: March 21, 2021, 08:55:14 pm
content: Yes, will do that, as I'm not seeing anything else. Maybe I am missing something, but the next STM32, will have to suffer for that I guess.Electronics do fail sometimes for no apparent reasonBut also probability of that happening is the lowest so tried to leave that as the last explanationThanks for the input!

author: DavidAlfa
author_rank: Super Contributor
timestamp: March 21, 2021, 10:12:28 pm
content: When I face something so basic like this, I just make a quick and cheap project in STM32 IDE!Instead f**ing up my project by filling it with test code, commenting, copying, moving... it's easy to screw up everything.So in your situation I would do this.In Cube MX:Pin B8 = "B8", GPIO Ouput push pullmain:while(1){HAL_Delay(2000);HAL_GPIO_Toggle(B8_GPIO_Port, B8_Pin);}And forget everything else. If this doesn't work, there's something wrong with the pcb or the mcu.

author: AndyC_772
author_rank: Super Contributor
timestamp: March 22, 2021, 09:51:34 am
content: Quote from: rokspy on March 21, 2021, 08:55:14 pmThe key word here is "apparent". Electronics do not ever fail fornoreason.What's your ESD environment like? Are you aware of good ESD practice, and do youalwaysfollow it? Remember, ESD rarely causes devices to fail immediately, but can drastically shorten their lifetime. If your test board has just died, it could well be that it was mis-handled days or weeks ago.