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

nRF52840 Dongle FATFS issue when SPIM and SPIS are configured at the same time

Hello, 

I have been using nRF52840-DK and also nRF52840 Dongle for testing and I found an interesting behaviour when I established my test setup. The RF module acts as an SPI slave towards another MCU, and also acts as an SPI master towards a micro SD card extension. As far as I know most of the existing GPIO pins can be configured to be used as SPI pins so based on that my PIN layout is the following:

SPIM (micro SD card extension):

  • SCK: P0.31
  • MISO: P0.13
  • MOSI: P0.15
  • CS: P1.0

SPIS (another MCU):

  • SCK: P1.10
  • MOSI: P1.15
  • MISO: P1.13
  • CS: P0.2

Also there is an additional GPIO configured as output on P0.29.

I also set the MISO Pull configuration to pull-up because I read (https://devzone.nordicsemi.com/f/nordic-q-a/24334/fatfs-example-sdk14-0-0-not-working#post-id-163682) that it is needed for the fatfs library to work as expected for new generation micro SD cards.

The issue is when I execute my program the nRF52840-DK works perfectly and the data is written to the SD card always, but when I use the Dongle the data is usually not written (fatfs fails with disk initialization failure). It only happens when I use a new generation 32Gb U3 and U1 micro SD cards, the issue is not present for older versions (with 16Gb U1 works fine).

I tried to change the RF module (Dongle), cables, and tested the setup with 3 different kind of micro SD card extensions, for all of them I received the same result. Also tested the SPIM and SPIS separately and like that both works fine (even the fatfs example works flawlessly).

Is there any difference in the PIN configuration or setup between the nRF52840-DK and Dongle that might cause this issue? Or do you have any PIN layout recommendations that might solve this issue if I intend to use SPIM and SPIS at the same time for the nRF52840 Dongle?

Thank you in advance for your support!

Parents
  • Hi

    The following pins that you mention are only recommended to use as standard drive and low frequency I/Os while the radio is being used.

    P0.31
    P0.02
    P1.10
    P1.15
    P1.13
    P0.29

    This is because they may interfere with the radio's performance if running at high frequencies. This should not be an issue if you're not using the radio though, I just thought I should mention it.

    This seems very strange, as none of those pins should conflict with anything but the radio in both the DK and Dongle. Are you positive that all the pins are attached to the Dongle properly? One thing though. According to the FatFs documentation, it is limited to 4GB sizes, so that might be the issue, although that doesn't explain why it works on the DK and not the Dongle. A disk init failure from the SD card reader leads me to think that the SD card reader isn't properly connected to the Dongle. Are you able to provide any error code of some sort if you try debugging?

    Best regards,

    Simon

  • Hello Simon,

     

    Thank you for your answer, and actually it is good that you mentioned the radio performance interference because it is used too (however at the point where it fails the radio is just initialized).

    My first guess was the faulty connection, but this was proven wrong by writing to an older 16Gb micro SD card without any problem.

    Is it possible to have an SPIS and SPIM interface, along with the radio? And if yes, in the future we might decide to embed an nRF52840 based chip on a PCB where we are not limited to the Dongle pins. Is there any suggestion which pin configuration would be the most efficient in this case?

    In the meantime I will try to find out the error code for the disk initialization failure for the Dongle, but without a debugger environment it is quite challenging.

     

    Thank you again and best regards,

    Bertalan

Reply
  • Hello Simon,

     

    Thank you for your answer, and actually it is good that you mentioned the radio performance interference because it is used too (however at the point where it fails the radio is just initialized).

    My first guess was the faulty connection, but this was proven wrong by writing to an older 16Gb micro SD card without any problem.

    Is it possible to have an SPIS and SPIM interface, along with the radio? And if yes, in the future we might decide to embed an nRF52840 based chip on a PCB where we are not limited to the Dongle pins. Is there any suggestion which pin configuration would be the most efficient in this case?

    In the meantime I will try to find out the error code for the disk initialization failure for the Dongle, but without a debugger environment it is quite challenging.

     

    Thank you again and best regards,

    Bertalan

Children
No Data
Related