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

nrf51 SDK7.1 flash api and spi master api

  1. Does the sdk7.1 + softdevice support flash_page_erase function?

  2. Also, for the spi_master api, is the spi_master_event_handler required or optional? currently, the code below,

volatile uint32_t err_code = spi_master_send_recv(spi_master_instance, p_tx_data, len, p_rx_data, len); if (err_code != NRF_SUCCESS) { return err_code;//Module Operation failed. Take recovery action. }

sometime gives NRF_ERROR_BUSY error, any reason?

thanks.

Parents
  • Hi

    1. Yes

    2. If you use the SPI master driver, then you initialize the driver with spi_master_init which requires that you specify spi event handler as parameter, so yes I think it is mandatory if you use the driver. Otherwise you will not get a callback once the data has been clocked out on SPI that you send/receive with calling spi_send_recv function.

    I do not see that the spi_master_send_recv function throws NRF_ERROR_INVALID_DATA error. Are you using the spi_master example from SDK 7.1.0 unmodified?

Reply
  • Hi

    1. Yes

    2. If you use the SPI master driver, then you initialize the driver with spi_master_init which requires that you specify spi event handler as parameter, so yes I think it is mandatory if you use the driver. Otherwise you will not get a callback once the data has been clocked out on SPI that you send/receive with calling spi_send_recv function.

    I do not see that the spi_master_send_recv function throws NRF_ERROR_INVALID_DATA error. Are you using the spi_master example from SDK 7.1.0 unmodified?

Children
Related