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

Thingy 52

Hello everyone,

Is it possible to add an external flash memory like this one here:
www.digikey.com/.../4211595
on nRF52?

Thank you in advance!

Parents Reply Children
  • Well my task is to do it on thingy52, so I must use nRF52832. Can you suggest how to wire it, its confusing to me, I can use any random GPIO's to connect flash with nRF52(for SPI)? Can you give an example how would you connect it?
    Sorry for bothering you further, it would mean a lot. Thank you.

  • For the wiring

    The easy flash pins are VCC and GND

    As a minimum the SPI bus has CS#, SCLK, MISO (SO), MOSI (SI).

    After a quick scan of the datasheet, there is a HOLD# pin that can be tied high and a WP# pin that can be tied high too.

    On my Thingy 52 there are just three port pins marked on the large P4 connector : P0.02, P0.03 and P0.04

    That's not enough for the SPI bus. I would assign the fast changing signals SCLK, MISO and MOSI to those and use another pin for the slow changing chip select.

    EXT.0 .. EXT.3 seem to be through a GPIO expander. I'd tie CS# to EXT0. You could tie HOLD# and WP# to others if needed.

    For the software

    I'm using the DK but the software should be similar to this...

    nrf_drv_spi_t spi = NRF_DRV_SPI_INSTANCE(1);

    nrf_drv_spi_config_t cfg;

    void init(void)
    {
      cfg.frequency = NRF_DRV_SPI_FREQ_1M;
      cfg.sck_pin = 2; // P0.02
      cfg.miso_pin = 3; // P0.03
      cfg.mosi_pin = 4; // P0.04
      cfg.ss_pin = NRF_DRV_SPI_PIN_NOT_USED;
      cfg.bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;

      // NULL : No handler, operates in blocking mode
      uint32_t result = nrf_drv_spi_init(&spi, &cfg, NULL);

      if (NRF_SUCCESS != result)
      {
      // error
      }

    }

    static uint8_t junk;
    static uint8_t data = 0;

    // use GPIO expander for chip select

    data = <value here>;

    uint32_t result = nrf_drv_spi_transfer (&spi, (uint8_t*)&data, 1, &junk, 1);

    if (NRF_SUCCESS != result)
    {
    // err
    }

  • Thank you for your effort! I'm going to try wire it, like you suggested.

  • I can't help but think that an I2C serial flash would be a lot easier.

    I should really have started with ... what do you want to achieve by attaching an external flash?

    Anyway, good luck and let us know how you get on.

  • Actually I'm a student, and I got this task for my final year project, for my bachelor degree. 
    To be honest I don't if my professor consider it enough, or just throw me some random task. 
    First I thought it's gonna be an easy task, but now my head is spinning. 

Related