Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updating numbered headings

...

  1. Run a generic erase/write/read/compare test:

    Code Block
    uart:~$ flash test gd25wb256e3ir@1 0 0x4000 1
    Erase OK.
    Write OK.
    Verified OK.
    Erase-Write-Verify test done.
  2. Run read and write measurements:

    Code Block
    uart:~$ flash erase gd25wb256e3ir@1 0 0x4000
    Erase success.
    uart:~$ flash write_test gd25wb256e3ir@1 0 0x4000 1
    Loop #1 done in 53 ticks.
    Total: 53ms, Per loop: ~53ms, Speed: ~301.9KiBps
    uart:~$ flash read_test gd25wb256e3ir@1 0 0x4000 1
    Loop #1 done in 16ms.
    Total: 16ms, Per loop: ~16ms, Speed: ~1000.0KiBps

...

4. Configuring for a Different SPI Flash Device

This chapter explains how to configure a different Flash device in the Zephyr BSP. Specifically, the GD25WB256E Flash device installed on the Thingy-9151-Lite platform is used as an example.

...

4.1. Obtaining JEDEC Info

First step when setting a new SPI Flash is to obtain information about it. To do so, we need to create a minimally required description of the Flash. Let’s start with the following overlay:

...

Code Block
/* Deactivate predefined flash node for SPI flash installed on DK */
&gd25wb256 {
        status = "disable";
};

&arduino_spi {
/* Insert node for new device */
        newspi: newdevice@1 {
                compatible = "jedec,spi-nor";
                status = "ok";
                reg = <1>;
                spi-max-frequency = <8000000>;
                jedec-id = [c8 65 19];
                size = <268435456>;
                has-dpd;
                t-enter-dpd = <3000>;
                t-exit-dpd = <40000>;
                sfdp-bfp = [ 
                        e5 20 f3 ff  ff ff ff 0f  44 eb 08 6b  08 3b 42 bb
                        ee ff ff ff  ff ff 00 ff  ff ff 00 ff  0c 20 0f 52
                        10 d8 00 ff  44 7a c9 fe  83 67 26 62  ec 82 18 44
                        7a 75 7a 75  04 c4 d5 5c  00 06 74 00  08 50 00 01
                        ]; 
        };
};

/* Use new device in choosen and aliases */
/ {
       chosen {
                nordic,pm-ext-flash = &newspi;
       };

       aliases {
                spi-flash0 = &newspi;
                ext-flash = &newspi;
       };
};

...

4.2. Configuring for Different SPI Flash Device with QSPI support on nRF5340

The nRF5340 MCU includes a QSPI controller that allows to use faster Flash devices in dual and quad SPI mode.

...