nRF9160 SPI flash for cellular firmware download

Based on this weblink I need at least 4MBytes of flash for doing a full cellular update on the nRF9160:

https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/samples/nrf9160/http_update/full_modem_update/README.html

This is a two part question:

1) We are currently planning on using the Winbond W25Q64. Do you see any issue with using this hardware or software-wise?

https://www.digikey.com/en/products/detail/winbond-electronics/W25Q64JVZPIQ-TR/5803999

2) The HTTP full modem update sample code mentioned above works on the nRF9160 dev kit flash memory.  Would the current SDK also work with the Winbond part or will I need to change the SPI driver? 

Thanks for your help,

Chris

Parents
  • Hi Chris,

    1) We do not see any issues selecting this device.

    2) I will get back to you on this on Monday.

    Best regards,

    Håkon

  • Hi Håkon,

    You mentioned getting back to me last Monday.  Just checking to see when you would be able to offer any further information.

    Thanks,

    Chris 

  • Hi again

    Some more searching and I realized the Actinius Icarus Bee board uses the W25Q64JV device, which means you should be able to copy the DTS configuration directly from here

    Best regards
    Torbjørn

  • Hi Torbjørn,

    Thanks for looking into this.  So it sounds like we can use the generic SPI-NOR driver and I just need to have some configuration changes as you suggested.  That's very good news.  

    I won't be able to test this for another few weeks.  Should we keep this case open for now?

    Thanks again,

    Chris 

  • Hi Chris

    Correct. The generic driver is flexible enough to where it can be used for many different NOR devices, as long as they support the same instruction format. 

    Keeping the case open is fine, just let me know when you've had time to test it, and if you're having any issues getting it to work. 

    Best regards
    Torbjørn

  • I'm having difficulties getting the SPI flash seen by the nRF9160.  When I use a scope to monitor the SPI Clock I don't see any activity on the line at all.

    I decided to take a step back and just use the SPI sample from nRF Connect SDK 1.7.1.  This is the zephyr/samples/drivers/spi_flash.  I used nrf9160dk_nrf9160_ns as my starting build.

    The software can't seem to find the device. Here's the last few lines of the output:

    ============================================

    SPM: NS image at 0x10000
    SPM: NS MSP at 0x20015658
    SPM: NS reset vector at 0x11ba5
    SPM: prepare to jump to Non-Secure image.
    *** Booting Zephyr OS build v2.6.99-ncs1 ***

    JEDEC SPI-NOR SPI flash testing
    ==========================
    SPI flash driver w25q64jv was not found!

    ============================================

    I created an overlay file with:

    &spi3 {
        compatible = "nordic,nrf-spim";
        status = "okay";
        sck-pin = < 23 >;
        mosi-pin = < 19 >;
        miso-pin = < 20 >;
        cs-gpios = < &gpio0 25 GPIO_ACTIVE_LOW >;
        w25q64jv: w25q64jv@0 {
            compatible = "jedec,spi-nor";
            label = "w25q64jv";
            reg = < 0 >;
            spi-max-frequency = < 40000000 >;
            wp-gpios = < &gpio0 3 GPIO_ACTIVE_LOW >;
            hold-gpios = < &gpio0 2 GPIO_ACTIVE_LOW >;
            size = < 0x4000000 >;
            has-dpd;
            t-enter-dpd = < 3000 >;
            t-exit-dpd = < 30000 >;
            jedec-id = [ ef 40 17  ];
        };
    };
    which relates to:
    CLK on P0.13
    MISO on P0.12
    MOSI P0.11
    CS P0.25
    WPN P0.03
    HOLD P0.02
    I also added this to prj.conf, but that didn't change anything:
    CONFIG_SPI_NOR=y
    CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    I also deleted all the extra signals in common.dts which may conflict with the SPI GPIOs.
    I feel like I'm missing something very obvious.  I'm still fairly new to configuring things in the Nordic/Zephyr environment.
  • I figured it out.  The sample code works now.  I had 2 things I had to fix:

    1) I was using the pin numbers for the SCK, MISO, and MOSI rather than the GPIO #'s.

    2) device_get_binding was not working.  I switched to using 

    const struct device *flash_dev = DEVICE_DT_GET(DT_NODELABEL(w25q64jv));
    By the way, I didn't have a very good grasp to how the NOR flash instance was being created since I'm still fairly new to Zephyr.  I found this great video from Marti Bolivar at Nordic which explained the device tree structure and overlays really well.  This is where I found out about the DEVICE_DT_GET.  
    Thanks again,
    Chris
Reply
  • I figured it out.  The sample code works now.  I had 2 things I had to fix:

    1) I was using the pin numbers for the SCK, MISO, and MOSI rather than the GPIO #'s.

    2) device_get_binding was not working.  I switched to using 

    const struct device *flash_dev = DEVICE_DT_GET(DT_NODELABEL(w25q64jv));
    By the way, I didn't have a very good grasp to how the NOR flash instance was being created since I'm still fairly new to Zephyr.  I found this great video from Marti Bolivar at Nordic which explained the device tree structure and overlays really well.  This is where I found out about the DEVICE_DT_GET.  
    Thanks again,
    Chris
Children
Related