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

QSPI External Flash Read/Write

I have been interfacing with the Macronix external flash via the nfrx_qspi library for logging. While I am able to use nrfx_qspi_read() to obtain my log data, I am also able to "read" it via the memory mapped address region (XiP).

Are the any drawbacks to simply accessing (reading) data from the external flash using the memory mapped region rather than nrfx_qspi_read()?

Parents Reply
  • Thank you for pointing these out.

    While I can stick with using the nrfx_qspi interface for logging purposes, I have a large file read only file that I want to access directly. Here's what I've done to address the errata. Does this look correct?

    I've inserted a the following call to address errata 215 after I use XiP:

    nrf_qspi_task_trigger(NRF_QSPI, NRF_QSPI_TASK_ACTIVATE);

    For errata 216, I first added the external flash to the linker macros and segments:

    linker_section_placement_macros="FLASH_PH_START=0x0;FLASH_PH_SIZE=0x100000;RAM_PH_START=0x20000000;RAM_PH_SIZE=0x40000;FLASH_START=0x27000;FLASH_SIZE=0xd9000;RAM_START=0x200022D0;RAM_SIZE=0x3DD30;EXT_FLASH_START=0x12000000;EXT_FLASH_SIZE=0x800000"
    linker_section_placements_segments="FLASH RX 0x0 0x100000;EXT_FLASH R 0x12000000 0x800000;RAM RWX 0x20000000 0x40000"

    Second, I added the following to my flash_placement.xml file in SES

    <MemorySegment name="EXT_FLASH" start="$(EXT_FLASH_START)" size="$(EXT_FLASH_SIZE)">
      <ProgramSection alignment="4" name=".ext_flash_log" load="No" />
      <ProgramSection alignment="4" name=".shp_file" load="No" />
    </MemorySegment>

    Finally, I used "section" attributes to place structures in the external flash:

    static volatile uint8_t const _log_data[0x200000] __attribute__ ((section(".ext_flash_log")));

    static uint8_t const tz_db[0x600000] __attribute__ ((section(".shp_file")));

Children
No Data
Related