2012-11-23 02:08 PM
Hi,
Does exist any serial library for STM32 ? I searched on this forum and google and I found nothing, I'm looking for a traditional serial lib that allows to send other types of data than char (int32_t, float ...) and that has ''high level'' read functions (with a circular buffer). Thank you :)2012-11-25 07:30 AM
Have you checked the documentation for whatever toolset(s) you're using - to see what support it/they provide(s)...?
2012-11-25 12:38 PM
Heu... I have got an STM32F4DISCOVERY, the only possibilities for the time being are to get and put one byte, that's why I was asking if some lib exists to allow more ''high level'' functions. Otherwise I'll implement it myself, it's just more boring (I already did it on AVR)
2012-11-26 11:40 PM
''I have got an STM32F4DISCOVERY''
You must also have some software development toolset - Keil, IAR, or whatever. You need to study the documentation for that toolset - it will tell you what facilities are provided, and what you need to do to specifically customise them to your particular platform. For Keil, this is known as ''retargetting'' - and they certainly do support things like gets()...eg,
http://www.keil.com/support/man/docs/armlib/armlib_cjaghcgj.htm
2012-11-27 12:29 PM
Ok now I understand better what you mean, thank you. I use CoIDE and indeed there is a way to retarget printf to an UART. Unfortunately it doesn't look very convenient if I use several UART for example, isn't it ? By the way I wrote an .hpp quite nice to handle UARTs, I have to test and debug it further and then I'll upload it and share on github.
2012-11-27 01:08 PM
''Unfortunately it doesn't look very convenient if I use several UART for example, isn't it?''
But that's not essentially any different from using multiple devices on a PC - is it?
You have one ''default'' device - called stdout - used by printf, but any additional devices you'd have to open individually, and access via suitable fprintf calls...2012-11-29 04:07 AM
As promised I put my lib on github. It's a very simple way to use the UARTs of the STM32F4 (transmission/reception). Feel free to make any comments and to report bugs :)
https://github.com/Absurdev/UART_STM32F4