...
As documented in Emcraft Thingy-9151-Lite Platform Data Sheet , the Thingy-9151-Lite provides a 16MB 32MB SPI Flash connected to the nRF9151 MCU.
Relevant hardware implementation details are as follows:
16MB 32MB SPI Flash using the TBD GD25WB256E device
Connected to the TBD SPI SPI3 controller of the nRF9151 MCU
TBD P0.20 pin on the nRF9151 MCU controller used as a CS (Chip Select)
SPI is configured to run at TBD 8 MHz.
3. Software Interfaces
...
Run generic erase/write/read/compare test (example for nrf5340).:
Code Block uart:~$ flash test mx25r6435f@0gd25wb256e3ir@1 0 0x4000 1 Erase OK. Write OK. Verified OK. Erase-Write-Verify test done.
Run read and write measurements (example for nrf5340):
Code Block uart:~$ flash erase mx25r6435f@0gd25wb256e3ir@1 0 0x4000 Erase success. uart:~$ flash write_test mx25r6435f@0gd25wb256e3ir@1 0 0x4000 1 Loop #1 done in 19253 ticks. Total: 192ms53ms, Per loop: ~192ms~53ms, Speed: ~83~301.3KiBps9KiBps uart:~$ flash read_test mx25r6435f@0gd25wb256e3ir@1 0 0x4000 1 Loop #1 done in 4ms16ms. Total: 4ms16ms, Per loop: ~4ms~16ms, Speed: ~3~1000.9MiBps0KiBps
3.4. Configuring for different SPI flash device
This chapter explains how to configure a different flash device using gd25wb256
existing on nrf9161DK GD25WB256E
installed on the Thingy-9151-Lite as an example.
3.4.1. Get JEDEC info
First step when setting new SPI flash is to obtain information about it. To do so, we need to create minimal 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; }; }; |
3.4.2. Configuring for different SPI flash device with QSPI support on nRF5340 (nordic,qspi-nor
)
The nRF5340 MCU includes a QSPI controller that allows to use faster flash devices in dual and quad SPI mode.
Following the similar procedure to SPI flash discussed above, jedec216
provides the following output:
...