Skip to main content
Associate
February 10, 2026
Solved

Change UART on Early Crash Console OP-TEE

  • February 10, 2026
  • 2 replies
  • 177 views

Hello,

I am working on the stm32mp257f-ev1 board and attempting to switch from the default USART2 early crash console output to USART6. I've successfully switch TF-A and U-BOOT console to USART6 but my OP-TEE console continuously outputs on USART2.

I've made sure to change the serial0 alias from USART2 to USART6 in the OP-TEE device tree (as I've successfully done in the TF-A device tree) and I've also followed the directions to change the header file stm32mp2_def.h For USART6, I've changed the early crash console in stm32mp2_def.h to the following:

#define STM32MP_DEBUG_USART_BASE                    USART6_BASE
#define DEBUG_UART_TX_GPIO_BANK_ADDRESS    GPIOF_BASE
#define DEBUG_UART_TX_GPIO_BANK_CLK_REG     RCC_GPIOFCFGR
#define DEBUG_UART_TX_GPIO_BANK_CLK_EN        RCC_GPIOxCFGR_GPIOxEN
#define DEBUG_UART_TX_GPIO_PORT                       13
#define DEBUG_UART_TX_GPIO_ALTERNATE            3
#define DEBUG_UART_TX_CLKSRC_REG                   RCC_XBAR20CFGR
#define DEBUG_UART_TX_CLKSRC                             XBAR_SRC_HSI
#define DEBUG_UART_TX_EN_REG                             RCC_USART6CFGR
#define DEBUG_UART_TX_EN                                      RCC_UARTxCFGR_UARTxEN
#define DEBUG_UART_RST_REG                                 RCC_USART6CFGR
#define DEBUG_UART_RST_BIT                                   RCC_UARTxCFGR_UARTxRST
#define DEBUG_UART_PREDIV_CFGR                        RCC_PREDIV20CFGR
#define DEBUG_UART_FINDIV_CFGR                         RCC_FINDIV20CFGR

I'm still unable to get output on USART6 for OP-TEE though. Any advice would be greatly appreciated!

2 replies

PatrickF
PatrickFBest answer
Technical Moderator
February 11, 2026
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.NEW ! Sidekick STM32 AI agent, see here
m_stokoAuthor
Associate
February 12, 2026

Thank you for the info @PatrickF

I tried adding the configuration flag CFG_STM32_EARLY_CONSOLE_UART=6 to my local.conf but I'm still not getting any early crash console info. Am I perhaps changing the wrong device tree for OP-TEE?
For TF-A I changed stm32mp257f-ev1.dts in .../work-shared/stm32mp2/tfa-source/ and for OP-TEE I changed stm32mp257f-ev1-ca35tdcid-ostl.dts in .../work-shared/stm32mp2/external-dt/optee/.

m_stokoAuthor
Associate
February 12, 2026

Never mind, I just had the flag set in the wrong file. The change of flag instance was the problem; thanks!