It is possible you reduced stacks too much and it simply crashes, I would verify that first.
Giovanni
STM32F050F4 Problem
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F050F4 Problem
I see a few mistakes on the schema.
You power the led directly from the IO, which is not a good idea.
This device has a 25ma limit on each pin, and 80ma max on all pins.
- Your 82ohms resistor only limits current to 40ma. You might burn the pin or the chip.
Increase that resistance to 150 ohms or more. You can also use an external npn transistor if you need max power.
- You could have put a resistor in series with the nrst pin so that is does not rise/fall too fast
- The resistor value on Boot0 could have been higher as well. (like 10K)
You power the led directly from the IO, which is not a good idea.
This device has a 25ma limit on each pin, and 80ma max on all pins.
- Your 82ohms resistor only limits current to 40ma. You might burn the pin or the chip.
Increase that resistance to 150 ohms or more. You can also use an external npn transistor if you need max power.
- You could have put a resistor in series with the nrst pin so that is does not rise/fall too fast
- The resistor value on Boot0 could have been higher as well. (like 10K)
Re: STM32F050F4 Problem
Hey,
thanks for the reply.
Well first off I had a 470Ohm resistor at the LED, just switched for a lower value to make sure it's not too much.
Actually I wanted to stay as close to the STM32F0 Discovery schematic as possible. They used the LEDs directly at the pin with a resistor value near the 470Ohms (see R30 and R31). Also they use a value of 510Ohms (R26) at the Boot0.NRST has not one resistor in line ( asR33 is not fitted), only the one capacitor (C23). I have the same setup.
Actually, this is disappointing. Could you be so kind and hand me over the files you used for your project?
I'm sure I just did what you proposed.
Regards
thanks for the reply.
Well first off I had a 470Ohm resistor at the LED, just switched for a lower value to make sure it's not too much.
Actually I wanted to stay as close to the STM32F0 Discovery schematic as possible. They used the LEDs directly at the pin with a resistor value near the 470Ohms (see R30 and R31). Also they use a value of 510Ohms (R26) at the Boot0.NRST has not one resistor in line ( asR33 is not fitted), only the one capacitor (C23). I have the same setup.
Actually, this is disappointing. Could you be so kind and hand me over the files you used for your project?
I'm sure I just did what you proposed.
Regards
- Attachments
-
- STM32F0-Discovery_schematic.png (263.79 KiB) Viewed 5563 times
Re: STM32F050F4 Problem
Giovanni,
I have played around with stack size, but that doesn't change a thing.
Also I have put a 270Ohms resistor instead of the 82Ohms LED series resistor.
I have played around with stack size, but that doesn't change a thing.
Also I have put a 270Ohms resistor instead of the 82Ohms LED series resistor.
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F050F4 Problem
Does the oscillator run? hard to make suggestions without having the hands on the device.
Giovanni
Giovanni
Re: STM32F050F4 Problem
I actually don't know. I use the IC with internal RC. Can I configure it to expose the clock to a pin? As I can see, the TSSOP20 package of the STM32F050 has no MCO capability 
I guess, I will throw away that board and do something else...
I guess, I will throw away that board and do something else...
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F050F4 Problem
Is mcuconf.h configured to use the internal oscillator? the default behavior is to use the external one.
Giovanni
Giovanni
Re: STM32F050F4 Problem
Hm, I think so. I hvae to enable HSI, right?
Code: Select all
#define STM32_NO_INIT FALSE
#define STM32_PVD_ENABLE FALSE
#define STM32_PLS STM32_PLS_LEV0
#define STM32_HSI_ENABLED TRUE
#define STM32_HSI14_ENABLED TRUE
#define STM32_LSI_ENABLED TRUE
#define STM32_HSE_ENABLED FALSE
#define STM32_LSE_ENABLED FALSE
#define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSI
#define STM32_PREDIV_VALUE 1
#define STM32_PLLMUL_VALUE 12
#define STM32_HPRE STM32_HPRE_DIV1
#define STM32_PPRE STM32_PPRE_DIV1
#define STM32_ADCSW STM32_ADCSW_HSI14
#define STM32_ADCPRE STM32_ADCPRE_DIV4
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
#define STM32_ADCPRE STM32_ADCPRE_DIV4
#define STM32_ADCSW STM32_ADCSW_HSI14
#define STM32_CECSW STM32_CECSW_HSI
#define STM32_I2C1SW STM32_I2C1SW_HSI
#define STM32_USART1SW STM32_USART1SW_PCLK
#define STM32_RTCSEL STM32_RTCSEL_LSI
- Giovanni
- Site Admin
- Posts: 14892
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: STM32F050F4 Problem
Yes, and make sure everything else is setup correctly for HSI (dividers multipliers).
Giovanni
Giovanni
Re: STM32F050F4 Problem
OK, I have something; not related to clock though. I can see thy high and low swichting on the LED pin (PA6) if I measure between series resistor and pin, but between LED and resistor there's only 0V. I have to check the hardware again... Let's see.
Alright, well done
, when resoldering another series resistor I saw, the previously installed one wasn't properly soldered onto the pad at the one side. I also added a 270Ohms resistor at BOOT0 pin and a 4.7uF capacitor at VCC (which I just read in the STM32 reference manual). So the LED is blinking!
Now I have the check what's the deal with the UART lines that I have also set up to spit out some HelloWorld and they stay on the high level. But I guess that'll be just something else. I now know, the MCU is running.
Thanks for the support. I wouldn't have come to this stage without the hints on stack size and which define to use.
Alright, well done
Thanks for the support. I wouldn't have come to this stage without the hints on stack size and which define to use.