nrf5340 nrfx_qspi sdk v3.0.1 peripheral issue

Hello,

I have a custom nrf5340 board with an attached external RAM on the QSPI (I understand only NOR flash ICs are supported) on the older version of the SDK such as v2.6.1 the initialization of the qspi (nrfx_qspi_init) and writing/reading (nrfx_qspi_write / read) I could successfully write and read from the external RAM as the instruction that are using for NOR flash were the same used for the external RAM. Now we are migrating to sdk v3.0.1 (and onwards) but the qspi peripheral is not properly initialized anymore (even though I get no errors back) as the CS line for example is not high. If I change the .dts file to specify that there is a NOR flash attached to it the code will automatically initialize the QSPI peripheral beforehand and it will start communicating through the QSPI as seen on the oscilloscope (to check for jedec id and such) and the CS is then being held high. By manually initializing that peripheral the CS signal does not go high.

I went through some documentation as I see that the driver and APIs are being changed in the sdk v3.0.1 and onwards in docs.nordicsemi under nrfxlib-apis-3.0.1 I can see a newly added QSPI2 driver and a note specifically for the nrf5340:


It explains to use the nrfx_qspi driver as we did before but now it is not working anymore. Can you maybe guide us on what we are missing so that we can again use the QSPI peripheral on the nrf5340?

Thank you.

Parents
  • I have a similar issue. I am using nrf5340 with external memory on a custom board.

    When using SDK 2.6.2 and toolchain 2.6.2 - QSPI works as expected (I confirm by reading the JEDEC ID of the memory following a power cycle).

    When using SDK 3.0.1 and toolchain 3.0.1 JEDEC ID reads always 0x00 00 00.

    I have spent a lot of days trying to figure out the issue and was able to confirm this by flashing the same program to the same board from two different PCs. One with the 2.6.2 setup and one with the 3.0.1.

    Hopefully there is a work around or solution.

    Thanks

Reply
  • I have a similar issue. I am using nrf5340 with external memory on a custom board.

    When using SDK 2.6.2 and toolchain 2.6.2 - QSPI works as expected (I confirm by reading the JEDEC ID of the memory following a power cycle).

    When using SDK 3.0.1 and toolchain 3.0.1 JEDEC ID reads always 0x00 00 00.

    I have spent a lot of days trying to figure out the issue and was able to confirm this by flashing the same program to the same board from two different PCs. One with the 2.6.2 setup and one with the 3.0.1.

    Hopefully there is a work around or solution.

    Thanks

Children
  • Hey, 

    I have figured it out. For the nrf5340 they have a errata for clock configuration and if the clocks aren't what they need to be you will not start any qspi transmissions. To fix add at the beginning of main():

    nrf_clock_hfclk192m_div_set(NRF_CLOCK, NRF_CLOCK_HFCLK_DIV_1);
    nrf_clock_hfclk_div_set(NRF_CLOCK, NRF_CLOCK_HFCLK_DIV_2);

    The errata:

    Hopefully that fixes it for you.

Related