This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use the nRF9160 DK onboard external flash

Hello,

I have an nRF9160 DK board (I believe the version is PCA10090 1.0.0) and would like to use the external flash that comes with this board.

Upon inspection, this flash chip is the MX25R6435F from MX25R6435F.

I am using the SPIM driver from nrfxlib, where the nRF9106 is the SPI master and the flash chip the slave. The pins used by SPI master

are those described in the DK board hardware guide, in section "5.10 External memory".

However the flash chip does not respond to commands from the SPI master. Here is a trace of the SPI  bus communication.

The logic analyzer is connected to the pins of the nRF9160:

SPI bus comm logic analyzer

The SPI master (nRF9160) sends the command (0x9F) to read the flash chip ID, which is 3 bytes long. But the flash

chip does not respond. 

I am fairly confident that the source code is correct, and that I am using the correct pins. So I don't understand why the flash chip

is silent.

On the back of the DK board it says that there is an analogue switch for sharing the flash between the nRF9160 and the nRF52. But I

cannot understand how to make sure that the flash chip is being used by the nRF9160 instead of the nRF52. The Hardware Guide says

"Two analog switches are used to control the signals between the nRF9160 and the external memory. The switches are controlled by P0.19 of nRF52840."

How can I make sure the analogue switches are set to use the external flash chip with the nRF9160 ?

Parents
  • Hi,

     

    As you have found, the default routing of the flash is to the nRF52840 board controller. 

    On the back of the DK board it says that there is an analogue switch for sharing the flash between the nRF9160 and the nRF52. But I

    cannot understand how to make sure that the flash chip is being used by the nRF9160 instead of the nRF52. The Hardware Guide says

    "Two analog switches are used to control the signals between the nRF9160 and the external memory. The switches are controlled by P0.19 of nRF52840."

    How can I make sure the analogue switches are set to use the external flash chip with the nRF9160 ?

    If you create a small piece of fw for the nRF52840, that sets this pin active, you should be able to interface the flash with the nRF9160.

    This is the DTS configurations available:

    http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.0/zephyr/boards/arm/nrf9160dk_nrf52840/doc/index.html#board-controller-firmware

     

    What you can do is to go to zephyr/samples/hello_world (copy this to "board_controller_nrf52840" for instance), and then you create the file nrf9160dk_nrf52840.overlay containing this (and other options, if you'd like!):

    &external_flash_pins_routing {
    	status = "okay";
    };

     

    You can configure & build using west, by appending the @version :

    west build -b [email protected]

     

    Kind regards,

    Håkon 

Reply
  • Hi,

     

    As you have found, the default routing of the flash is to the nRF52840 board controller. 

    On the back of the DK board it says that there is an analogue switch for sharing the flash between the nRF9160 and the nRF52. But I

    cannot understand how to make sure that the flash chip is being used by the nRF9160 instead of the nRF52. The Hardware Guide says

    "Two analog switches are used to control the signals between the nRF9160 and the external memory. The switches are controlled by P0.19 of nRF52840."

    How can I make sure the analogue switches are set to use the external flash chip with the nRF9160 ?

    If you create a small piece of fw for the nRF52840, that sets this pin active, you should be able to interface the flash with the nRF9160.

    This is the DTS configurations available:

    http://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.0/zephyr/boards/arm/nrf9160dk_nrf52840/doc/index.html#board-controller-firmware

     

    What you can do is to go to zephyr/samples/hello_world (copy this to "board_controller_nrf52840" for instance), and then you create the file nrf9160dk_nrf52840.overlay containing this (and other options, if you'd like!):

    &external_flash_pins_routing {
    	status = "okay";
    };

     

    You can configure & build using west, by appending the @version :

    west build -b [email protected]

     

    Kind regards,

    Håkon 

Children
Related