Page 2 of 2

Re: USART Code-snippets

Posted: Tue Oct 04, 2016 6:50 am
by tfAteba
Hi Chudik,

The default baud rate is effectively 38400 bps, it is define in the halconf.h file locate in your project directory. You can change it threre.

Re: USART Code-snippets

Posted: Tue Oct 04, 2016 8:54 am
by Giovanni
Hi,

If you want to set more parameters for each serial port then you need to use a SerialConfig, in that structure you can set baud rate and the content for CR1, CR2 and CR3 registers. The structure is passed as pointer to sdStart().

See serial_lld.h for the structure definition.

Giovanni

Re: USART Code-snippets

Posted: Tue Oct 04, 2016 9:50 pm
by Chudik
Giovanni wrote:Hi,

need to use a SerialConfig, in that structure you can set baud rate and the content for CR1, CR2 and CR3 registers. The structure is passed as pointer to sdStart().

See serial_lld.h for the structure definition.

Thanks. This posting reminded me to add headers files to my project :)

Looked at serial_lld.h.
Seems like need to use CubeMX to fill out those structure. Or read full datasheet. Using CubeMX is definitely easy ;)
How good would be to combine these two great products... :roll: