RTEMS | bsps/arm/stm32f4: Make printk() independent of the console driver. (!1518)
Catalin Miron (@catalin)
gitlab at rtems.org
Thu Oct 1 15:57:28 UTC 2026
Catalin Miron commented on a discussion on bsps/arm/stm32f4/console/console-config.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1518#note_160439
> +
> +static int stm32f4_poll_char(void)
> +{
> + if (PORT_COUNT == 0) {
> + return -1;
> + }
> + return stm32f4_usart_read_polled((int) Console_Port_Minor);
> }
> +BSP_output_char_function_type BSP_output_char = stm32f4_output_char_init_early;
>
> -BSP_output_char_function_type BSP_output_char = output_char;
> +BSP_polling_getchar_function_type BSP_poll_char = stm32f4_poll_char;
>
> -BSP_polling_getchar_function_type BSP_poll_char = NULL;
> +RTEMS_SYSINIT_ITEM(
> + stm32f4_output_char_init,
If you don't want to output first, and maybe wait for input before writing, then the UART won't be initialezed during poll, that's why I added this. Also if we remove the `stm32f4_output_char_init_early` and keep only the `RTEMS_SYSINIT_ITEM`, then if there are issues/faults during system init before `RTEMS_SYSINIT_BSP_START`, you won't see anyting printed out. Do you think there is a better approach for this?
--
View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1518#note_160439
You're receiving this email because of your account on gitlab.rtems.org. Unsubscribe from this thread: https://gitlab.rtems.org/-/namespace/49/sent_notifications/5-3ckwyuv23iyhm1hk2xak2jrys-1d/unsubscribe | Manage all notifications: https://gitlab.rtems.org/-/profile/notifications | Help: https://gitlab.rtems.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/bugs/attachments/20261001/a2c42bed/attachment-0001.htm>
More information about the bugs
mailing list