STM32L052K8 custom board does not run while the same board for STM32F051K8 works (same pinout and peripherals on the PCB)
Updated Question:
I have a custom PCB board with L052K8 and F051K8 with the same peripherals and correct hardware design for each (F051K8 has a VSSA for the ADC and different bypass cap), but only the L051K8 is able to program its firmware and reset correctly.
I was initially designing the board for the L052K8 and could not figure out what was wrong for weeks, so I pretty much chose a different chip with the same footprint and peripherals (F051K8) at the end to minimize re-designing the hardware. The L052K8 does not seem to program its firmware or reset after it's been disconnected from ST-link and the IDE.
Can someone please explain this?
Original Question:
Hi, I've just made a custom board for STM32L052K8, and I can't get the board to work. It
seems that the connection is successful and I am able to program it using ST link (SWD).
I programmed a very simple GPIO application with STM32CubeIDE (which I have verified using a nucleo board), and the firmware seems to run initially.
However, when I disconnect the board from ST link and reset the device by pulling the battery out and back in, the application does not run as intended (the LED is supposed to be on initially with GPIO_init, then turn off after 500ms). This is the while loop:
while (1)
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN5, GPIO_PIN_SET);
HAL_Delay(500);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN5, GPIO_PIN_RESET);
HAL_Delay(500);
}
I assume that there's a potential issue in the MCU startup after reset... In fact, after the reset, the same pin is set close to high (2.3V on a board powered by 2.6V)
update:
- previously I have made a board without connecting a capacitor to NRST pin, but I have updated the design and connected a 0.1uF cap to ground
Could someone help me understand why this is happening and a way to fix it? Any suggestion is much appreciated, thank you in advance.
