How does TF-M select UART1 pins?

Hello DevZone,

I have a confusing question about TF-M. Need  help from a TF-M expert.

In this document, it says that we must disable uart1 in non-secure application, because TF-M use it as secure peripheral.

My question is: how does TF-M select the pins used by uart1_secure?

My board selection is `nrf9160dk/nrf9160/ns`, which is a non-secure board.

I use AI to read the build progress and all the Ninja things. And it told me that TF-M just read the non-secure `zephyr.dts` and use the pin-ctrl of that.

I think this is not reasonable, because uart1 is disabled in my application. There is no reason for TF-M to use the pin-ctrl from a disabled uart.

More general question: how can I choose a peripheral as secure or non-secure in NCS? Should I configure this in Devicetree or Kconfig?

Best regards,

Jayant

Parents Reply
  • I have confirmed that:

    1. TF-M doesn't have a stand alone sysbuild configuration, it is a part of the Application

    2. TF-M will use application's non-secure uart1 pinctrl, even if uart1 is disabled.


    CONFIG_SERIAL=y
    CONFIG_TFM_LOG_LEVEL_SILENCE=n
     

    &uart1 {
        status = "disabled";
    };
    
    &pinctrl{
    	uart1_default: uart1_default {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 16)>,
    				<NRF_PSEL(UART_RTS, 0, 14)>;
    		};
    		group2 {
    			psels = <NRF_PSEL(UART_RX, 0, 17)>,
    				<NRF_PSEL(UART_CTS, 0, 15)>;
    			bias-pull-up;
    		};
    	};
    
    	uart1_sleep: uart1_sleep {
    		group1 {
    			psels = <NRF_PSEL(UART_TX, 0, 16)>,
    				<NRF_PSEL(UART_RX, 0, 17)>,
    				<NRF_PSEL(UART_RTS, 0, 14)>,
    				<NRF_PSEL(UART_CTS, 0, 15)>;
    			low-power-enable;
    		};
    	};
    };
    

    Cheers!

Children
No Data
Related