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

External Memory SPI connection

Hi, 

I am currently working on programming a bootloader on to my nrf52840 DK. The bootloader will be able to do DFUs via SPI. I am using SDK 15.2.0. I also want to be able to write the update being received to an external EEPROM then transfer it over to internal memory (perform a dual bank update with eeprom). I am using an outside eeprom to use as external memory rather than the on board external memory. It communicates via 3 wire SPI, however, since I am already using an SPI connection, I am assuming that I could will be able to connect the EEPROM to the QSPI and disconnecting the external onboard memory. I currently have the EEPROM connected to my board as shown in the picture below. Vcc on the EEPROM is connected to VDD on the board.

  

I followed the instructions in this link to use the corresponding GPIOs. I then tested my connection using the nrfjprog --readqspi temp.hex . It was able to read the EEPROM and show it in temp.hex, but when I tried writing or erasing the memory, it would say the following:

  

I rerun nrfjprog --readqspi and it gives me the same values meaning that nrfjprog is not correctly erasing the EEPROM. I do not know if it is because I am using QSPI or if I am no connecting the external memory correctly. If it is because I am using QSPI, is there a way I can create another SPI connection on the board? And if so, how can I do that?

Any advice helps!!!

Parents
  • Hi,

    I followed the instructions in this link to use the corresponding GPIOs

    Just to double check, have you soldered and cut the solder bridges needed to use these GPIOs for other purpose than using the onboard external in the DK?

    To use the GPIOs for a purpose other than the onboard external memory and have them available on the P24 connector, six solder bridges (SB10SB15) must be cut and six solder bridges (SB20SB25) must be shorted. See the following figure for details.

    Does your EEPROM support QSPI? Do you have a datasheet for this part available?

    Best regards,

    Marjeris

  • I have cut and soldered the corresponding bridges. I have two EEPROMs that I have available. The datasheet for one is in this link and the other is in this link. Both of them are able to communicate through SPI but none of them say anything about QSPI. If it is not working because the EEPROMs are not able to do QSPI, is it possible I could set up another SPI connection on the NRF52840 DK board? Is there an example in how to communicate with an external memory to communicate via SPI? 

  • Any update? I have been working on trying to get his memory to work and I am still getting the same issue. I have even tried using another nrf52840 DK, however, it is still giving me the same problem where it reads but does not write. I have attached the output I get when I run nrfjprog --readqspi mem.hex mem.hex

  • Hi,

    Are you usigng 24-bit addressing? Memory access from QSPI peripheral only supports word-aligned to the external memory's address space, so it's only possible to write full 32-bit "words".

    Since you are not using the same external memory chip as the one used in the DK you may need to change the configuration in nrf_serial_flash_params.c/.h

    By default the peripheral is configured to use the same read_id, size, program size and other parameters used by the flash chip used for the nRF52840 DK.

    Best regards,

    Marjeris

  • I updated the size in nrf_serial_flash_params.c and changed the qspi to be in 32bit mode, yet I am still getting the same answer. I did notice that when I compare the data read when I runf nrfjprog --readqspi mem.hex for the onboard external memory with my external memory, I notice that they are both the exact same size. My external memory is smaller(8Mb) so shouldn't there be less addresses?

     Memory read from my external memory after using nrfjprog --readqsi mem.hex:

    3157.mem.hex

    Memory read from onboard external memory after using nrfjprog --readqsi mem.hex:

    4786.mem.hex

  • Hi,

    Can you share with me your nrf_serial_flash_params.c/.h file?

    You should check the .read_id, .capabilities, .size, .erase_size, .program_size parameters you are using. These parameters should be stated in the external flash's datasheet.

    static const nrf_serial_flash_params_t m_sflash_params[] = {
        {    /*MXIC MX25R6435F*/
            .read_id = { 0xC2, 0x28, 0x17 },
            .capabilities = 0x00,
            .size = 8 * 1024 * 1024,
            .erase_size = 4 * 1024,
            .program_size = 256,
        }
    };

Reply
  • Hi,

    Can you share with me your nrf_serial_flash_params.c/.h file?

    You should check the .read_id, .capabilities, .size, .erase_size, .program_size parameters you are using. These parameters should be stated in the external flash's datasheet.

    static const nrf_serial_flash_params_t m_sflash_params[] = {
        {    /*MXIC MX25R6435F*/
            .read_id = { 0xC2, 0x28, 0x17 },
            .capabilities = 0x00,
            .size = 8 * 1024 * 1024,
            .erase_size = 4 * 1024,
            .program_size = 256,
        }
    };

Children
No Data
Related