cancel
Showing results for 
Search instead for 
Did you mean: 

Change UART on Early Crash Console OP-TEE

m_stoko
Associate II

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!

1 ACCEPTED SOLUTION

Accepted Solutions
PatrickF
ST Employee

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.

PatrickF_0-1770821011984.png

Regards.

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.
Tip of the day: Try Sidekick STM32 AI agent, see here

View solution in original post

3 REPLIES 3
PatrickF
ST Employee

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.

PatrickF_0-1770821011984.png

Regards.

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.
Tip of the day: Try Sidekick STM32 AI agent, see here

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_stoko
Associate II

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