2018-09-04 02:07 AM
Hi all,
I have a custom board I have designed with an STM32F070CBT6 on it. Currently it is only populated with the power regulator, one led hooked up to pin PA1 and the debug header.
I've used STM32CubeMX to generate a simple test project that initialises the SysTick timebase source, and GPIO on pin PA1. It is clocked using the internal HSI RC oscillator at 8Mhz.
When I build and debug the project using SW4STM32 the debugger steps over HAL_Init(), SystemClock_Config(), and MX_GPIO_Init() successfully, but hangs shortly after that. E.g. if I put the following in the main() while loop:
while (1)
{
HAL_GPIO_TogglePin(STATUS_LED_GPIO_Port, STATUS_LED_Pin);
HAL_Delay(500);
}
It will step over the call to HAL_GPIO_TogglePin succesfully turning on the LED, but then hangs at HAL_Delay(500);
If I put a breakpoint in the SysTick_Handler(void) function in stm32f0xx_it.c it never gets hit. It appears like the interrupts aren't firing.
I've attached my CubeMX project file in case that is of help understanding why this might not be working. With the exception of lines 3 & 4 in the code snippet above the rest of the project is vanilla generated code.
Thanks very much for any advice you can provide!
Cheers,
James Fitzsimons
Solved! Go to Solution.
2018-09-04 04:26 AM
Solved it. Turns out I had miss-configured the BOOT0 jumper and it was pulled up to VDD instead of been shorted to GND. Once I rectified that it started working as expected.
2018-09-04 03:02 AM
Re-reading App Note AN4325: Getting started with STM32F030xx and STM32F070xx series hardware development (https://www.st.com/resource/en/application_note/dm00089834.pdf), I see in section 1.2 "Reset and power supply supervisor" the following:
The POR monitors only the VDD supply voltage. During the startup phase, VDDA must
arrive first and be greater than or equal to VDD.
How critical to the HSI startup is it that VDDA arrives first, could this be the cause of my problems?
And if so, how do people ensure this condition when using the same supply for VDDA and VDD?
Cheers,
James Fitzsimons
2018-09-04 04:26 AM
Solved it. Turns out I had miss-configured the BOOT0 jumper and it was pulled up to VDD instead of been shorted to GND. Once I rectified that it started working as expected.