ERROR nrfx_spim_init &nrfx_spim_xfer_dcx

Hello sir, I'm now working on the nrf52840 and am having trouble with the sdk config.
Initially, I indicated that I was working with spim3 and that it was functioning OK; I am able to use spim3 to work with an LCD.
But, when I enable twi0, twi1, and the spim3in config file, I receive these errors; however, if I disable twi1, I do not receive any errors.

Output/Release/Obj/ble_app_hrs_freertos_pca10056_s140/st7789h2_driver.o: in function `spim3_init':

undefined reference to `nrfx_spim_init'

undefined reference to `nrfx_spim_xfer_dcx'

undefined reference to `nrfx_spim_xfer_dcx'


In my case, I wish to use four interfaces: twi0, twi1, spim2, and spim3. Is that even possible?

i am sharing the sdk_con8015.sdk_config.txtfig file please verify , i am not getting what's the wrong i did.

  • Hi,

    It should be possible to use TWI0, TWI1, SPIM2, and SPIM3 together, you can see which peripheral instances overlap by looking at the ones with same Base address in Instantiation documentation.

    I can't see any obvious issues in your sdk_config.h file, can you post the full project for use to reproduce/debug the issue? If you do not want to post your project in public, I can convert the ticket to a private one.

    Best regards,
    Jørgen

  • Thank you for your response, sir.
    When I debug the code, I discovered the NRFX SPIM ENABLED macro, which I set in the sdk config file. However, the nrfx spim.c file shows disabled, and when I examine the macro definition, it opens the apply old config.h file instead of the sdk config file.

    what are my options for resolving the problem?

    Thank you very much.

  • If you do not use the legacy SPI driver API, I would recommend you to completely remove the entire config section from your sdk_config.h file:

    // <e> SPI_ENABLED - nrf_drv_spi - SPI/SPIM peripheral driver - legacy layer
    //==========================================================
    #ifndef SPI_ENABLED
    #define SPI_ENABLED 1
    #endif
    // <o> SPI_DEFAULT_CONFIG_IRQ_PRIORITY  - Interrupt priority
     
    
    // <i> Priorities 0,2 (nRF51) and 0,1,4,5 (nRF52) are reserved for SoftDevice
    // <0=> 0 (highest) 
    // <1=> 1 
    // <2=> 2 
    // <3=> 3 
    // <4=> 4 
    // <5=> 5 
    // <6=> 6 
    // <7=> 7 
    
    #ifndef SPI_DEFAULT_CONFIG_IRQ_PRIORITY
    #define SPI_DEFAULT_CONFIG_IRQ_PRIORITY 6
    #endif
    
    // <o> NRF_SPI_DRV_MISO_PULLUP_CFG  - MISO PIN pull-up configuration.
     
    // <0=> NRF_GPIO_PIN_NOPULL 
    // <1=> NRF_GPIO_PIN_PULLDOWN 
    // <3=> NRF_GPIO_PIN_PULLUP 
    
    #ifndef NRF_SPI_DRV_MISO_PULLUP_CFG
    #define NRF_SPI_DRV_MISO_PULLUP_CFG 1
    #endif
    
    // <e> SPI0_ENABLED - Enable SPI0 instance
    //==========================================================
    #ifndef SPI0_ENABLED
    #define SPI0_ENABLED 0
    #endif
    // <q> SPI0_USE_EASY_DMA  - Use EasyDMA
     
    
    #ifndef SPI0_USE_EASY_DMA
    #define SPI0_USE_EASY_DMA 1
    #endif
    
    // </e>
    
    // <e> SPI1_ENABLED - Enable SPI1 instance
    //==========================================================
    #ifndef SPI1_ENABLED
    #define SPI1_ENABLED 0
    #endif
    // <q> SPI1_USE_EASY_DMA  - Use EasyDMA
     
    
    #ifndef SPI1_USE_EASY_DMA
    #define SPI1_USE_EASY_DMA 0
    #endif
    
    // </e>
    
    // <e> SPI2_ENABLED - Enable SPI2 instance
    //==========================================================
    #ifndef SPI2_ENABLED
    #define SPI2_ENABLED 0
    #endif
    // <q> SPI2_USE_EASY_DMA  - Use EasyDMA
     
    
    #ifndef SPI2_USE_EASY_DMA
    #define SPI2_USE_EASY_DMA 0
    #endif
    
    // </e>
    
    // </e>

    These configs will overwrite the NRFX_SPI/NRFX_SPIM configs in apply_old_config.h just by being defined (regardless of if they are set or not). SPIM3 is not supported in the legacy driver.

Related