2015-08-24 02:15 AM
Hello,
Can anybody help in order to setup the USART1 on this controller? I have a ST NUCLEO dev. board with this Microcontroller. I don't want to use the Cube generator. I want to use the stdperiph driver without hal abstraction. Can anyone help me for the stperiph driver firmware package I have to use and how to set the USART1? Thanks in advance. #usart1 #stm32f072rbt62015-08-24 03:27 AM
Hi karakiritsis.ilias,
For STM32F0, you have 3 firmware solutions:To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-08-24 05:06 AM
There are also code examples at the end of the RM.
JW2015-08-24 07:50 AM
F0 DISCO and NUCLEO stuff for the F0 in [DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Discovery/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Discovery/UART%20example%20code%20for%20STM32F0&FolderCTID=0x01200200770978C69A1141439FE559EB459D75800084C20D8867EAD444A5987D47BE638E0F¤tviews=30079]this thread
If your question seems like it might have been asked before, it probably has, please search the forum..2015-09-04 04:29 AM
Thank you all for your valuable help! I really appreciate it.
I have managed to port the code to STM32F072RBT6 using the stdperiph driver way. Now I am dealing with another problem. I am using the Eval-ST95HF board where I developed my initial code for my application. In this code following the driver of ST95HF I am able to initiate the chip by sending a sequence of commands. For example: Reset: 0x01 Echo; 0x55 etc... I am able to verify that I am sending the right commands by using an oscilloscope to check the signals.The Problem:
I have a custom board with STM32F072RBT6 MCU and an ST95HF RF chip. My intention is to have an identical RF operation (that is the reason I had to migrate the code to the new MCU). I have configured the SPI interface identical to the SPI interface of the Eval-ST95HF board. However, the signals on the oscilloscope for my board are quite different comparing to signals on Eval board. Example1: Eval(STM32F103RGT6): sending 0x55. --> Osciloscope ->
0x55
My board(STM32F072RBT6): sending 0x55. --> Osciloscope ->0x5500
Example2: Eval(STM32F103RGT6): sending 0x01. --> Osciloscope ->0x01
My board(STM32F072RBT6): sending 0x01. --> Osciloscope ->0x0100
Example3: Eval(STM32F103RGT6): sending 0x00. --> Osciloscope ->0x00
My board(STM32F072RBT6): sending 0x00. --> Osciloscope ->0x0000
Just to mention that the SPI configuration is identical (by checking the Registers CR1, CR2 and SR) Thanks in advance.
2015-09-06 10:02 PM
You have to write to SPI->DR as a byte, as writing it as a halfword writes one byte to the transmitting register and one byte to the FIFO.
The SPI in 'F0x differs in FIFO from the 'F1x SPI. JW2015-09-07 05:48 AM
Thanks for your reply. It was really helpful.
Indeed I had to use a 8bit sender function for SPI transmit. I was using a 16 bit transmit function by casting the data and it didn't work. Another important configuration to make it work was to modify fifo reception threshold to 8 bits by using this command: SPI_RxFIFOThresholdConfig (SPIx, SPI_RxFIFOThreshold_QF); And it worked! Thanks again!