SPI, Uart interface not working in DWM3001c module

Hi,
I had a custom board with DWM3001c (nrf52833) module I am trying to interface dwm3001c module an stm32 processor using SPI, SPI2 is set as master for the communication, While debugging the process is stuck on NRF_BREAKPOINT_COND in the app_error_weak.c file. I have also tried to make an UART connection between stm32 and DWM3001c module, data is not received at the stm32 processor. What will bet the issue we were facing. Can you please suggest a solution.

  • Hi

    Thanks for your reply, yes I am using nrf52 SDK and SEGGER embedded studio . By using the debugging method it is found that error_code=0x00000010 is returned. SPI1as master is enabled in sdk_config.h file and the spi initialization is shown as below

    void spi_init(void)
    {
    nrf_drv_spi_config_t *spi_config;

    spi_config->sck_pin = NRF_GPIO_PIN_MAP(0, 31);
    spi_config->mosi_pin = NRF_GPIO_PIN_MAP(0, 27);
    spi_config->miso_pin = NRF_GPIO_PIN_MAP(0, 7);
    spi_config->ss_pin = NRF_DRV_SPI_PIN_NOT_USED; // pin driven manually, not by the driver
    spi_config->irq_priority = (APP_IRQ_PRIORITY_MID - 2);
    spi_config->orc = 0xFF;
    spi_config->frequency = NRF_SPIM_FREQ_4M;
    spi_config->mode = NRF_DRV_SPI_MODE_0;
    spi_config->bit_order = NRF_DRV_SPI_BIT_ORDER_MSB_FIRST;

    // Configure the chip select as an output pin that can be toggled
    nrf_drv_gpiote_out_config_t out_config = NRFX_GPIOTE_CONFIG_OUT_TASK_TOGGLE(NRF_GPIOTE_INITIAL_VALUE_HIGH);
    nrf_drv_gpiote_out_init(Stm_SPI_CS, &out_config);
    APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));
    }

    void spi_send_data(uint8_t *data, size_t length)
    {
    APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, data, length, NULL, 0));
    }

  • The error seems to be NRF_ERROR_INVALID_ADDR from nrf_error.h.

    From the documentation of nrf_drv_spi_transfer() you can find:

     * @retval NRF_ERROR_INVALID_ADDR If the provided buffers are not placed in the Data
     *                                RAM region.

    So please copy the data to a variable in RAM before you call nrf_drv_spi_transfer().

    Kenneth

Related