esp32xx: Workaround to avoid printing serial trash character

During the serial reconfiguration from bootloader to the
NuttX a trash character "?" (Unicode replacement U+FFFD)
was printed in the screen.

This fix was discovered by Sylvio Alves from Espressif!
This commit is contained in:
Alan Carvalho de Assis 2023-05-11 16:14:46 -03:00 committed by Petro Karashchenko
parent 54d92d1a0f
commit 694e6f550b
4 changed files with 23 additions and 0 deletions

View File

@ -766,6 +766,12 @@ void esp32c3_lowputc_config_pins(const struct esp32c3_uart_s *priv)
{ {
/* Configure the pins */ /* Configure the pins */
/* Keep TX pin in high level to avoid "?" trash character
* This "?" is the Unicode replacement character (U+FFFD)
*/
esp32c3_gpiowrite(priv->txpin, true);
esp32c3_gpio_matrix_out(priv->txpin, priv->txsig, 0, 0); esp32c3_gpio_matrix_out(priv->txpin, priv->txsig, 0, 0);
esp32c3_configgpio(priv->txpin, OUTPUT_FUNCTION_1); esp32c3_configgpio(priv->txpin, OUTPUT_FUNCTION_1);

View File

@ -1885,6 +1885,11 @@ static void esp32_config_pins(struct esp32_dev_s *priv)
* But only one GPIO pad can connect with input signal * But only one GPIO pad can connect with input signal
*/ */
/* Keep TX pin in high level to avoid "?" trash character
* This "?" is the Unicode replacement character (U+FFFD)
*/
esp32_gpiowrite(priv->config->txpin, true);
esp32_configgpio(priv->config->txpin, OUTPUT_FUNCTION_3); esp32_configgpio(priv->config->txpin, OUTPUT_FUNCTION_3);
esp32_gpio_matrix_out(priv->config->txpin, priv->config->txsig, 0, 0); esp32_gpio_matrix_out(priv->config->txpin, priv->config->txsig, 0, 0);

View File

@ -683,6 +683,12 @@ void esp32s2_lowputc_config_pins(const struct esp32s2_uart_s *priv)
{ {
/* Configure the pins */ /* Configure the pins */
/* Keep TX pin in high level to avoid "?" trash character
* This "?" is the Unicode replacement character (U+FFFD)
*/
esp32s2_gpiowrite(priv->txpin, true);
/* Route UART TX signal to the selected TX pin */ /* Route UART TX signal to the selected TX pin */
esp32s2_gpio_matrix_out(priv->txpin, priv->txsig, 0, 0); esp32s2_gpio_matrix_out(priv->txpin, priv->txsig, 0, 0);

View File

@ -795,6 +795,12 @@ void esp32s3_lowputc_config_pins(const struct esp32s3_uart_s *priv)
{ {
/* Configure the pins */ /* Configure the pins */
/* Keep TX pin in high level to avoid "?" trash character
* This "?" is the Unicode replacement character (U+FFFD)
*/
esp32s3_gpiowrite(priv->txpin, true);
if (uart_is_iomux(priv)) if (uart_is_iomux(priv))
{ {
esp32s3_configgpio(priv->txpin, OUTPUT_FUNCTION_1); esp32s3_configgpio(priv->txpin, OUTPUT_FUNCTION_1);