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

Crashing during the SPI transfer on NRF52810

Hi,

The program will crash when spi transfer on NRF52810. The crash occurs in spim_xfer  function, immediately after spim_int_enable function calling,

but if i remove the handler when spi init, it will not crash. I want to know what's going on and how to solve this problem, the spi is very important for me.

And this is my project's sdk_config.h,and the sdk version is nRF5_SDK_15.0.0_a53641a. Did I miss something.

Thanks.

  • Hi,

    Have you tried debugging the application, to see if any error codes are reported from the functions?

    If this does not help, please upload code showing how you initialize and configure the SPIM peripheral. Are you using the NRFX_SPIM driver in the SDK?

    Best regards,
    Jørgen

  • Hi,

    I debug the code, and the crash occurs after the spim_int_enable function calling.

    It is invalid whether I enable NRFX_SPIM driver or not.

    Tanks.

    Best regards.

    These are my spi config:

    And these are my initialize code.

  • What do you mean by crash? Do you get an error code? Is the device restarting?

  • Hi,

    I didn't get any error code, and the device didn't restart, but it can not execute the code and has no response.

    The pc will enter arm_startup_nrf52810.s file and lock at line 319 after the first transfer when debugging step by step. Then the system die there.

    Thanks.

  • There seems to be a bug in the nrfx library for nRF52810.

    The file nrfx_irqs_nrf52810.h defines the SPIM IRQ handler, but wrongfully use SPIM1 peripheral. The nRF52810 IC only have SPIM0 peripheral. You need to change the code to the following:

    I will report this issue internally.

    Best regards,
    Jørgen

1 2