cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 USART3 and SPI1 peripherals

alan2399
Associate II
Posted on November 14, 2008 at 09:29

STM32 USART3 and SPI1 peripherals

4 REPLIES 4
alan2399
Associate II
Posted on May 17, 2011 at 12:52

I have been having some problems with two of the peripherals (USART3 and SPI1) on the STM32. These peripherals appear to be working from a software perspective (the interrupts are firing and the SPI peripheral is reading values, albeit incorrect ones) but the outputs are not present on the pins (hence the incorrect values being read as SCK is not being clocked). I have carried out a number of tests to identify the problem, but I haven't managed to solve it, so I was hoping that you might be able to offer some advice. The tests I have carried out are listed below:

  1. My fully populated PCB with an STM32F101R8T6 (manufacturer-assembled board):

    1. USART3 driven with both available remap conditions: the TX pins are always LOW (so this cannot be due to the I²C issue reported on the forum).

    2. Both available TX pins reconfigured as GPIO: pins can be driven high and low correctly: implies this is not an issue with the pins being incorrectly connected.

    3. The checks have been carried out with my UART driver (which works for USART1 and USART2, but nothing is seen on the pins for USART3).

    4. Checks also carried out with the sample code provided with the Keil MCBSTM32 development board - the results are the same as with my code.

    5. SPI tested with my SPI driver - again, the interrupts fire and the correct number of bytes are read, but the SCK and MOSI pins are permanently HIGH.

    6. Tests above repeated on the same PCB with an STM32F101RBT6: same results (manufacturer-assembled board).

    7. Simple USART1/2/3 and SPI test repeated on the same PCB with an STM32F103RBT6 (the performance line equivalent). Same results (USART1 & 2 work, USART3 doesn't, SPI doesn't seem to work either). This board was a manufacturer-assembled board with the access line part removed by hand and replaced with a performance line part.

    8. STM32F103RBT6 hand-fitted on the PCB with nothing else except:

      • decoupling capacitors

      • Zero-ohm link from BOOT0 to ground

      • JTAG connector and associated pull-up/down resistors for programming (and, in this case also providing power).

      • Extra connector linked to pins on all three USARTs

        Results are the same as on PCBs 1-3

      • STM32F103RBT6 fitted (by manufacturer) to Keil MCBSTM32 development board.

        • All tests listed in (1) pass correctly, implying that both the Keil supplied software and our software are correct.

          What I am unable to determine is what is so significantly different between the Keil development board and my own PCB that would cause just two peripherals to stop working. Please can you offer any suggestions?

          Many thanks in advance.

          Alan

alan2399
Associate II
Posted on May 17, 2011 at 12:52

Hi,

Thanks for the advice: I've found the problem. It seems that some of the pins on the schematic symbol were incorrect so, although it looked right from the schematic, one of the ground pins was incorrectly wired and the SPI1 & USART3 pins were swapped. I think I made the mistake by reading the wrong column of the data sheet (allocating the LQFP48/100 pin numbers instead of the LQFP64 pin numbers).

Thanks again,

Alan

16-32micros
Associate III
Posted on May 17, 2011 at 12:52

Hi Alan,

Check that all your VDD/VSSs pins (VDD1, VDD2, VDD3 and VDD4 are all well routed and soldered to the STM32 in your board), the same for VSSs :

Pins : 31,32,47,48,63,64,19 and 18.

Cheers,

STOne-32

16-32micros
Associate III
Posted on May 17, 2011 at 12:52

Happy for you ! now you should fix it and re-design a new layout.