How to configure and use nRF9160DK external flash mx25r6435f

Hi,

I use the nRF9160dk and I want to use nRF9160's external flash mx25r6435f to store a few data.

There are few related posts from too many years ago. Could you provide a clear guideline to configure and use it?

board: nrf9160dk

SDK: v2.5.0

Thanks,

Liza

Parents
  • Hi Liza,

    You could follow external flash documentation which shows Kconfig and devicetree configuration.

    Best regards,
    Dejan

  • Dear Dejan,

    I have followed the configuration. 

    I build the nrf9160dk_nrf9160_ns board and failed to bind with mx25r6435f ("--ERROR: Flash device is not ready--“). Here is my files.3580.nrf9160dk_nrf9160_ns.overlay

    void NVSInit(){
    	printk("\nNVS init started...\n");
    
    	const struct device *dev_flash;
    	dev_flash = device_get_binding(DEVICE_DT_NAME(DT_NODELABEL(mx25r64)));
        	if (!dev_flash) {
            		printk("\n--ERROR: Flash device is not ready--\n");
            		return;
       	 }
    
    	err = flash_write(dev_flash,0,1,1);
    	if(err!=0){
    		printk("\n--ERROR: Failed to write data.-- \n\r");
    		exit(1);
    	}
    	err = 1;
    
    	err = flash_read(dev_flash,0,1,1);
    	if(err!=0){
    		printk("\n--ERROR: Failed to read data.-- \n\r");
    		exit(1);
    	}
    	err = 1;
    }

    I learned from other post. Should I build nrf9160dk_nrf52840 board first to open the external flash? 

    Thanks,

    Liza

  • I bind mx25r6435f and read&write successfully. But I do not know what makes it success. Turning SW10 to nrf52 and build nrf52 board, or program board controller firmware (nrf9160_dk_board_controller_fw_2.0.1.hex)?

  • Hi,

    Before programming board controller to nrf52840, PROG/DEBUG SW10 switch needs to be set to nRF52 position. nRF52840 controls analog switches on nrf9160-dk. To enable this control, you need to have board controller firmware flashed on nrf52840. It is board controller firmware which by default enables pin routing to external flash. 
    On nrf9160-dk, it is EXT_MEM_CTRL signal on nrf52840 which controls whether nrf9160 is connected to external flash or not.



    You can find more information about board controller in the documentation.

    Best regards,
    Dejan

  • Dear Dejan,

    Got it. Thanks.

    Best regards,

    Liza

Reply Children
No Data
Related