external memory SPI pin configuration in serial ltm application

Hello,

 

We are developing a custom board having nrf9160 cellular modem and we are using serial ltm application in it.

in serial ltm application there is pin selection available for UART2 in overlay file of nrf9160

same way can we configure the pin for external memory in serial ltm application?

 Thanks !!

Parents
  • Hi,

     

    Yes, you can add an entry for &spiX overlay, with new pinctrl definitions.

    Here's an example:

    arduino_spi: &spi3 {
    	compatible = "nordic,nrf-spim";
    	status = "okay";
    	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>; /* D10 */
    	pinctrl-0 = <&my_spi3_default>;
    	pinctrl-1 = <&my_spi3_sleep>;
    	pinctrl-names = "default", "sleep";
    	cs-gpios = <&arduino_header 16 GPIO_ACTIVE_LOW>, /* D10 */
    		   <&gpio0 25 GPIO_ACTIVE_LOW>;
    	mx25r64: mx25r6435f@1 {
    		compatible = "jedec,spi-nor";
    		status = "okay";
    		reg = <1>;
    		spi-max-frequency = <8000000>;
    		jedec-id = [c2 28 17];
    		sfdp-bfp = [
    			e5 20 f1 ff  ff ff ff 03  44 eb 08 6b  08 3b 04 bb
    			ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
    			10 d8 00 ff  23 72 f5 00  82 ed 04 cc  44 83 48 44
    			30 b0 30 b0  f7 c4 d5 5c  00 be 29 ff  f0 d0 ff ff
    		];
    		size = <67108864>;
    		has-dpd;
    		t-enter-dpd = <10000>;
    		t-exit-dpd = <35000>;
    	};	
    };
    
    &pinctrl {
    	my_spi3_default: my_spi3_default {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
    				<NRF_PSEL(SPIM_MISO, 0, 12)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 11)>;
    			nordic,drive-mode = <NRF_DRIVE_H0H1>;
    		};
    	};
    
    	my_spi3_sleep: my_spi3_sleep {
    		group1 {
    			psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
    				<NRF_PSEL(SPIM_MISO, 0, 12)>,
    				<NRF_PSEL(SPIM_MOSI, 0, 11)>;
    			low-power-enable;
    		};
    	};
    };

    Please note that if you use external flash in mcuboot (for dual banking), you will also have to add specific overlay in your mcuboot configuration as well, similar as done in the asset tracker application:

    https://github.com/nrfconnect/sdk-nrf/tree/v2.5.0/applications/asset_tracker_v2/child_image/mcuboot/boards

     

    Kind regards,

    Håkon

  • How can we test the connected external flash?
    Is there any specific overlay file to use external flash memory?

Reply Children
Related