2014-02-03 01:43 AM
Hello everyone,
I am the new one at programming stm32f3. I saw multiple examples here on the forum but I did not find what I want. I have stm32f3 discovery board and ublox GPS connected to PD8 (Tx) and PD9 (Rx) pins. I want to read data from pins and show it on pc on terminal. I have connected stm32f3 discovery to PC via USB. For programming I use Keil uVision. Has anybody of you some code for this or can help me how to do that please? Please help. Best regards Grega #nmea #c-basics #parser #fsm #design #state-machine #c-learning2014-02-03 04:59 AM
Hi
''I have connected stm32f3 discovery to PC via USB.'' So, does that mean you have the USB CDC device example working? ''I have stm32f3 discovery board and ublox GPS connected to PD8 (Tx) and PD9 (Rx) pins. I want to read data from pins and show it on pc on terminal.'' 1st be careful. Check if the Ublox serial is RS232 voltage level, the STM32 usart is not RS232 voltage level (it needs a Max232 converter). 2nd - Ublox GPS has a pripriatry serial comm protocol or it can talk the standard NEMA protocol. When I worked on it, I did not find any free NEMA protocol parsers so you may have to write it. Ublox will provide the protocol information to decode their serial protocol. You can find the NEMA protocol standard somewhere on the internet. Depending on what info you want from GPS, you request the right info. It can either continuously post info or you can poll it. Decode it and then send to the USB CDC.2014-02-03 05:22 AM
2014-02-03 06:40 AM
You board appears to have it's own USB-to-serial connectivity, one method might be to configure the USART on the F3 for the GPS and USB-to-Serial, and then copy the data between the two. Alternatively you'd want to look at the USB firmware examples for the F3-DISCO, and build a VCP (Virtural COM Port), and have that connect to the USART attached to the GPS.
You could look through the various F3 firmware libraries for examples, and the forum. I know I've posted examples here. [DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/usart%20code&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=518]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=%2Fpublic%2FSTe2ecommunities%2Fmcu%2FLists%2Fcortex_mx_stm32%2Fusart%20code&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=5182014-02-03 06:58 AM
Thanks for the replies,
clive1, do you maybe have an example how to configure the USART on the F3 for the GPS and USB-to-Serial, and then copy the data between the two? It means that I must configure one USART configuration for GPS and one for USB-to-Serial...how can I copy data between this two? I am the amateur and I really need this so please help me.2014-02-03 09:05 AM
Hi
''Is this NMEA protocol standard?'' No it does not look like it. NEMA is a standard which all GPS modules should talk. I got my data from here : http://www.gpsinformation.org/dale/nmea.htm '' one method might be to configure the USART on the F3 for the GPS and USB-to-Serial, and then copy the data between the two.'' I had not considered doing it this way - definitely simpler to do this and then handle the decoding in the PC.2014-02-03 09:28 AM
I am the amateur and I really need this so please help me.
Ok, so you're going to need to provide a cite for the board schematic so I don't have to go fishing for it. Describe the pins used by the GPS, and the USB-to-USART chip, and the expected baud rates for the two of them.2014-02-03 09:33 AM
''how can I copy data between this two? I am the amateur and I really need this so please help me.''
If I remember correctly, the USB CDC example pretty much just copies the USB CDC data to the USART and visa versa. Take a look at the example.2014-02-03 09:44 AM
@clive1
GPS board shematic: http://www.mikroe.com/downloads/get/155/gps_click_manual_v100.pdf STM32f3discovery shield shematic: http://www.mikroe.com/downloads/get/2036/stm32f3_shield_user_manual.pdf Baud rates for both are 9600 Pins: PD9(Rx) ->gps Tx, PD8 (Tx) ->gps Rx2014-02-03 09:56 AM