STM32F3 not being programmed? - Page 1
Forum section: electronics / projects

author: ghado
author_rank: Newbie
timestamp: July 21, 2016, 10:25:51 am
content: I have made some PCBs using the STM32F303VCT6 chips and I am having an issue with the programming aspect. My PCB consists of the STM32 chip and a RN4020 bluetooth chip. The bluetooth chip I can connect with other bluetooth devices and I am able to connect the STM32 with ST-link and program the code to flash. However when I then try to test the PCB, no data is being streamed to my PC through bluetooth, as if the STM32F3 has turned OFF. I am using CooCox IDE to program the MCU but I have used the ST utility tool to connect and program the chip as well to the same effect.I have the STM32F3 discovery board with the same bluetooth chip and the code works with that setup. I believe my issue is related to the NRST as it seems I have forgot to connect from the JTAG to the MCU. Please let me know if that is indeed the issue or if there is something else I may be overlooking. Thanks

author: HackedFridgeMagnet
author_rank: Super Contributor
timestamp: July 21, 2016, 10:53:14 am
content: Is the _Reset pin high or low?Many things can be wrong with a new board.How close is your hardware to the devel board?Are your crystals set up properly for your code? The crystals aren't loaded for the Devel board.Turn power off and check for inter pin shorts or open circuits between ic legs and pads especially if you reflowed it yourself.Turn on power and check voltages (or waveforms) at all relevant pins. Compare to devel board.At least you have working code, make sure you save that version somewhere.Try to attach a debugger.Why are you using JTag doesnt the devel board just use ICSP (5 or 6 pins or whatever its called)

author: Kjelt
author_rank: Super Contributor
timestamp: July 21, 2016, 11:33:41 am
content: Looks like your switch S1 wiring is wrong, you can short VCC to ground

author: XFDDesign
author_rank: Frequent Contributor
timestamp: July 21, 2016, 04:41:52 pm
content: Quote from: Kjelt on July 21, 2016, 11:33:41 amIn which case it's certain that the system is off, rather than being connected to the power source/battery?

author: ghado
author_rank: Newbie
timestamp: July 21, 2016, 07:50:06 pm
content: Thank you for the replies.I believe the reset pin is low right now. The NRST is not connected to anything and therefore is stuck in low. I have a feeling like this is my problem as my MCU is being reset after it is programmed.I tried following the ST hardware guide which has a schematic guideline. I checked with the development board and it seems like it is similar to it without the extra components. All I needed was power, UART and ADC for my project.I believe the crystals are set up correctly. My code activates the internal LSI clock but I included two external clocks based on the hardware guide.I have tested all the pins with a multi meter and everything seems like it is getting the appropriate voltages and is shorted to the correct place. My bluetooth chip turns on and functions correctly so I assume enough power is being fed throughout the PCB.I am using a JTAG connection because the ST-Link tool has JTAG slot and it was easier to have a single connection like that. Should I just connect the few pins with jumpers and try programming it like that?I believe you are right about the S1 being wrongly connected. When I connected a serial to usb board to power the PCB temporarily and set the bluetooth chip into advertise mode through UART, the serial to usb board started getting extremly hot when the PCB was set to OFF. But functioned fine when I set the PCB to ON. Should I removed that GND connection and just leave it floating when I want it OFF?

author: Kjelt
author_rank: Super Contributor
timestamp: July 21, 2016, 10:25:52 pm
content: Check the schematic of the disco board, nreset probably has a pullup and some capacitor to make it robust against glitches.The switch, what do you want to do, choose between Vcc , Battery or off? Then you need a three position switch, up, down and middle (off).With a single throw you can only choose two situations , so then you need to use diodes in serial with the vcc and batterry in order not to drain the battery to the vcc. That is one so vcc and battery and the other is NC and is off.

author: ealex
author_rank: Frequent Contributor
timestamp: July 22, 2016, 12:18:33 pm
content: look at the BOOT0 pin.if it's left floating you can end up in the bootloader mode instead of your code -> even if you program it properly, it will not run your code after a reboot.look in the chip's reference manual to find out how to set BOOT0.some of the ST chips have internal pull-up / pull-down resistors on the NRST and BOOT0 pins - read the datasheet to see if they are available or not for your part.if they are not available you need to add those resistors. 10k should be good to get it working

author: ghado
author_rank: Newbie
timestamp: July 22, 2016, 07:23:58 pm
content: I will look into the BOOT0 and NRST and try to add in some of the resistors and capacitors like they have in the datasheet and hopefully it will work.