2026-02-10 12:32 PM
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!
Solved! Go to Solution.
2026-02-11 6:43 AM
Hi @m_stoko
did you look to https://wiki.st.com/stm32mpu/wiki/How_to_debug_OP-TEE#Debug_with_traces
and https://wiki.st.com/stm32mpu/wiki/OP-TEE_configuration_switches
e.g.
Regards.
2026-02-11 6:43 AM
Hi @m_stoko
did you look to https://wiki.st.com/stm32mpu/wiki/How_to_debug_OP-TEE#Debug_with_traces
and https://wiki.st.com/stm32mpu/wiki/OP-TEE_configuration_switches
e.g.
Regards.
2026-02-12 11:51 AM
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/.
2026-02-12 3:39 PM
Never mind, I just had the flag set in the wrong file. The change of flag instance was the problem; thanks!