stm32: serial use 115200 baud rate

115200 is a much more sane "default" than 38400.
Instead of a mix of 38400 and 115200, just use 115200 in all places.
There's no reason for modern 32bit cpus to be using such old slow
baudrates.

Tested on f1, f4, l1.  Replaced some old f1 code that predated some
library support code for this.
This commit is contained in:
Karl Palsson
2019-06-02 16:08:13 +00:00
parent e0f377fec0
commit be1d296e2f
32 changed files with 37 additions and 45 deletions

View File

@@ -3,7 +3,7 @@
This example program sends some characters on USART2 on
[Lisa/M 2.0 board](see http://paparazzi.enac.fr/wiki/LisaM for details).
The terminal settings for the receiving device/PC are 38400 8n1.
The terminal settings for the receiving device/PC are 115200 8n1.
The sending is done in a blocking way in the code, see the usart\_irq example
for a more elaborate USART example.

View File

@@ -41,7 +41,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART2_TX);
/* Setup UART parameters. */
usart_set_baudrate(USART2, 38400);
usart_set_baudrate(USART2, 115200);
usart_set_databits(USART2, 8);
usart_set_stopbits(USART2, USART_STOPBITS_1);
usart_set_mode(USART2, USART_MODE_TX);

View File

@@ -48,7 +48,7 @@ static void usart_setup(void)
GPIO_CNF_INPUT_FLOAT, GPIO_USART2_RX);
/* Setup UART parameters. */
usart_set_baudrate(USART2, 38400);
usart_set_baudrate(USART2, 115200);
usart_set_databits(USART2, 8);
usart_set_stopbits(USART2, USART_STOPBITS_1);
usart_set_mode(USART2, USART_MODE_TX_RX);

View File

@@ -43,7 +43,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
/* Setup UART parameters. */
usart_set_baudrate(USART1, 38400);
usart_set_baudrate(USART1, 115200);
usart_set_databits(USART1, 8);
usart_set_stopbits(USART1, USART_STOPBITS_1);
usart_set_mode(USART1, USART_MODE_TX);

View File

@@ -3,7 +3,7 @@
This example program sends some characters on USART3 on the ST STM32-based
[Olimex STM32-H103 eval board](http://olimex.com/dev/stm32-h103.html).
The terminal settings for the receiving device/PC are 38400 8n1.
The terminal settings for the receiving device/PC are 115200 8n1.
The sending is done in a blocking way in the code, see the usart\_irq example
for a more elaborate USART example.

View File

@@ -43,7 +43,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
/* Setup UART parameters. */
usart_set_baudrate(USART1, 38400);
usart_set_baudrate(USART1, 115200);
usart_set_databits(USART1, 8);
usart_set_stopbits(USART1, USART_STOPBITS_1);
usart_set_mode(USART1, USART_MODE_TX);
@@ -58,7 +58,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART2_TX);
/* Setup UART parameters. */
usart_set_baudrate(USART2, 38400);
usart_set_baudrate(USART2, 115200);
usart_set_databits(USART2, 8);
usart_set_stopbits(USART2, USART_STOPBITS_1);
usart_set_mode(USART2, USART_MODE_TX);
@@ -73,7 +73,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART3_TX);
/* Setup UART parameters. */
usart_set_baudrate(USART3, 38400);
usart_set_baudrate(USART3, 115200);
usart_set_databits(USART3, 8);
usart_set_stopbits(USART3, USART_STOPBITS_1);
usart_set_mode(USART3, USART_MODE_TX);

View File

@@ -3,7 +3,7 @@
This example program sends some characters on USART3 on the ST STM32-based
[Olimex STM32-H103 eval board](http://olimex.com/dev/stm32-h103.html).
The terminal settings for the receiving device/PC are 38400 8n1.
The terminal settings for the receiving device/PC are 115200 8n1.
The sending is done in a blocking way in the code, see the usart\_irq example
for a more elaborate USART example.

View File

@@ -39,7 +39,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART2_TX);
/* Setup UART parameters. */
usart_set_baudrate(USART2, 38400);
usart_set_baudrate(USART2, 115200);
usart_set_databits(USART2, 8);
usart_set_stopbits(USART2, USART_STOPBITS_1);
usart_set_mode(USART2, USART_MODE_TX);

View File

@@ -48,7 +48,7 @@ static void usart_setup(void)
GPIO_CNF_INPUT_FLOAT, GPIO_USART2_RX);
/* Setup UART parameters. */
usart_set_baudrate(USART2, 38400);
usart_set_baudrate(USART2, 115200);
usart_set_databits(USART2, 8);
usart_set_stopbits(USART2, USART_STOPBITS_1);
usart_set_parity(USART2, USART_PARITY_NONE);

View File

@@ -3,5 +3,5 @@
This is a small RTC example project.
It blinks the ST STM32VLDISCOVERY's blue LED at 1Hz, and sends the value of
the RTC counter register down the serial line (PA9) at 38400,8N1.
the RTC counter register down the serial line (PA9) at 115200,8N1.

View File

@@ -44,11 +44,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
/* Setup UART parameters. */
// usart_set_baudrate(USART1, 38400);
/* TODO usart_set_baudrate() doesn't support 24MHz clock (yet). */
/* This is the equivalent: */
USART_BRR(USART1) = (uint16_t)((24000000 << 4) / (38400 * 16));
usart_set_baudrate(USART1, 115200);
usart_set_databits(USART1, 8);
usart_set_stopbits(USART1, USART_STOPBITS_1);
usart_set_mode(USART1, USART_MODE_TX);

View File

@@ -1,9 +1,9 @@
# README
This example program sends some characters on USART1 on the
This example program sends some characters on USART1 (PA9) on the
ST STM32VLDISCOVERY eval board.
The terminal settings for the receiving device/PC are 38400 8n1.
The terminal settings for the receiving device/PC are 115200 8n1.
The sending is done in a blocking way in the code, see the usart\_irq example
for a more elaborate USART example.

View File

@@ -40,11 +40,7 @@ static void usart_setup(void)
GPIO_CNF_OUTPUT_ALTFN_PUSHPULL, GPIO_USART1_TX);
/* Setup UART parameters. */
// usart_set_baudrate(USART1, 38400);
/* TODO usart_set_baudrate() doesn't support 24MHz clock (yet). */
/* This is the equivalent: */
USART_BRR(USART1) = (uint16_t)((24000000 << 4) / (38400 * 16));
usart_set_baudrate(USART1, 115200);
usart_set_databits(USART1, 8);
usart_set_stopbits(USART1, USART_STOPBITS_1);
usart_set_mode(USART1, USART_MODE_TX);