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

NRF_ERROR_SVC_HANDLER_MISSING on SPI master open

I get NRF_ERROR_SVC_HANDLER_MISSING error in spi_open function.

uint32_t err = sd_nvic_ClearPendingIRQ(p_spi_instance->irq_type);
APP_ERROR_CHECK(err);

I'm using dfu_dual_bank_ble_s110_pca10028 project for my bootloader project. I understand that SD must be initialized before SPI initialization, but I don't need SD in this moment since I will flash the SD with my functions and not MBR. This bootloader uses SPI external flash to read data which must be flashed, since SD is one of the thing I must update, it should not be initiated.

Any way to initialize SPI in this example without enabling the SD?

Thank you!

Br, Mladen

Parents
  • You need to replace all sd_xx calls with non sd calls. For example replace sd_nvic_ClearPendingIRQ with NVIC_ClearPendingIRQ from CMSIS

  • Replaced all sd_xx as you said with NVIC. I have a problem that when I call spi_master_send_recv (which returns NRF_SUCCESS) and then call:

    ble_stack_init(true);
    alp_bootloader_app_start(DFU_BANK_0_REGION_START);
    

    ...nothing happens. When I remove spi_master_send_recv call, it works and I can go from bootloader to app. Something to do with interrupts?

    Funny thing is when I debug the bootloader it always goes to app. When you let it run, it does not.

    EDIT: Debugged it, it stops in ble_stack_init(true) function, at SOFTDEVICE_HANDLER_APPSH_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, true) and depper in softdevice_handler_init function, at:

     if (!is_word_aligned(p_ble_evt_buffer))
        {
            return NRF_ERROR_INVALID_PARAM;
        }
    

    It just crashes here, bootloader restarts itself and it runs in circle till this point, restarts, runs till here, restarts, runs till here...

    Any ideas? Thank you!

Reply
  • Replaced all sd_xx as you said with NVIC. I have a problem that when I call spi_master_send_recv (which returns NRF_SUCCESS) and then call:

    ble_stack_init(true);
    alp_bootloader_app_start(DFU_BANK_0_REGION_START);
    

    ...nothing happens. When I remove spi_master_send_recv call, it works and I can go from bootloader to app. Something to do with interrupts?

    Funny thing is when I debug the bootloader it always goes to app. When you let it run, it does not.

    EDIT: Debugged it, it stops in ble_stack_init(true) function, at SOFTDEVICE_HANDLER_APPSH_INIT(NRF_CLOCK_LFCLKSRC_XTAL_20_PPM, true) and depper in softdevice_handler_init function, at:

     if (!is_word_aligned(p_ble_evt_buffer))
        {
            return NRF_ERROR_INVALID_PARAM;
        }
    

    It just crashes here, bootloader restarts itself and it runs in circle till this point, restarts, runs till here, restarts, runs till here...

    Any ideas? Thank you!

Children
No Data
Related