Need Help with STM32F407 Design - Page 1
Forum section: electronics / beginners

author: jasons520
author_rank: Newbie
timestamp: April 27, 2018, 03:34:24 am
content: Hi Everyone,I have a project that i am completing, A sort of wireless version of Ambilight using the stm32f407, however, this is my first time developing a pcb for the STM32 series of processors and its a little bit out of my depth. I am wondering, will i need a usb for firmware upgrade, or can i complete it just using ST-Link using JTAG, and is my design appropriate for the development of the STM32? Or is there issues with it?Thanks everyone in advance!

author: pigrew
author_rank: Frequent Contributor
timestamp: April 27, 2018, 04:07:39 am
content: I'm not completely sure, but I think NRST needs a pull-up resistor.It's easiest to flash the board using a st-link. In fact, usually you have to use to use the st-link at first to flash it (I don't think the ROM bootloader supports USB, though you could use thebootloader's uart mode).Add some extra IO debug testpoints, maybe a LED and a serial port header, too.I don't know much about your chip, but you may want to put all of the inputs from the video chip into a single port.

author: llkiwi2006
author_rank: Regular Contributor
timestamp: April 27, 2018, 05:29:24 am
content: Quote from: pigrew on April 27, 2018, 04:07:39 amThe chip has internal pull up on NRST.

author: andyturk
author_rank: Frequent Contributor
timestamp: April 28, 2018, 01:18:03 am
content: That schematic is difficult to read, which increases the chances of making a mistake.There's a 2k2 pullup resistor for SCL, but I couldn't find one for SDA.With STM32 the MCO signal an output from the clock system. It's not simply one of the crystal pins as shown in this schematic.You don't need all the JTAG signaling with resistors and such. SWD is simpler.

author: Lt_Flash
author_rank: Regular Contributor
timestamp: April 29, 2018, 06:11:51 pm
content: SWD requires only SWDIO, SWCLK and RESET (inverted), so really - much easier. 2.2kOhm for I2C seems to be an overkill, 4.7kOhm on SDA and SCL is usual, or even 10kOhm is quite standard.

author: Lt_Flash
author_rank: Regular Contributor
timestamp: April 29, 2018, 06:16:30 pm
content: Also, why is there a 14.31818MHz oscillator? With some resistor between pins? Why 20pF? Was it calculated somehow? What type of crystal is that? Usually you calculate these capacitors based on datasheet, something like this (copied from SAML21 datasheet):Crystal Oscillator CharacteristicsThe following Table describes the characteristics for the oscillator when a crystal is connected betweenXIN and XOUT.The user must choose a crystal oscillator where the crystal load capacitance CL is within the range givenin the Table. The exact value of CL can be found in the crystal datasheet. The capacitance of the externalcapacitors (CLEXT) can then be computed as follows:CLEXT = 2(CL - CSTRAY - SHUNT) ,where CSTRAY is the capacitance of the pins and the PCB, and CSHUNT is the shunt capacity of the crystal.

author: Lt_Flash
author_rank: Regular Contributor
timestamp: April 29, 2018, 06:19:53 pm
content: I would really recommend to copy-and-paste most of the parts of this evaluation board schematic for this MCU if you're just a beginner and not really sure what you're doing, would save you a lot of time and effort!http://www.st.com/content/ccc/resource/technical/document/user_manual/25/21/69/1d/13/c5/4e/c9/DM00036746.pdf/files/DM00036746.pdf/jcr:content/translations/en.DM00036746.pdf

author: Lt_Flash
author_rank: Regular Contributor
timestamp: April 29, 2018, 06:22:06 pm
content: Pay attention to all the bypass capacitors at VDD_MCU pins, they're there for reason!

author: jasons520
author_rank: Newbie
timestamp: April 30, 2018, 08:13:34 am
content: Hi everyone, Thanks so much for your replies!Some follow ups;The 14.31818MHz oscillator is for the TVP5150 video decoder - the schematic for it is based on its data sheet.I will update to use SWD, I'm quite confused when reading the datasheets, and ST-link for programming.I will copy the discovery boards schematic to work everything else out.The video decoder chip is using STM's dcmi on the chip. - its controlled via the I2C interface.Im using SPI for wireless control via a NRF24l01+ module.My main question is, do i just need the ST-link and SWD for programming the board, or do i need a usb port or something like that?Thanks everyone!

author: andyturk
author_rank: Frequent Contributor
timestamp: April 30, 2018, 08:46:24 am
content: Quote from: jasons520 on April 30, 2018, 08:13:34 amSWD/ST-Link is used for putting code on the board and also for debugging. There are various bootloaders in ROM that can also be used to reprogram the device from a serial connection like USB, UART, etc. However, those won't help at all with debugging. If you want to try the serial bootloaders, read up onAN-2606and make sure you can reconfigure BOOT0 and BOOT1 as necessary.I use aTC-2030footprint on all my ARM mcu boards with the standard SWD pinout. It doesn't take much space and once you buy the cable, there's no need for putting a special connector on each project--it's just a PCB footprint.