This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Migration to SD functions

I have to update my non soft device source code to SD because now I will use Radio.

My question is if it is necessary to rewrite all functions which are in SD API. Like:

NVIC_SetPriority(ADC_IRQn, APP_IRQ_PRIORITY_LOW);
NVIC_ClearPendingIRQ(ADC_IRQn);
NVIC_EnableIRQ(ADC_IRQn);
NRF_POWER->SYSTEMOFF = 1;	
NRF_CLOCK->TASKS_HFCLKSTART = 1;
NRF_RTC1->EVENTS_COMPARE[0] = 0;
__WFI();
__WFE();
and similiar

I'm assume that SD alternate function has just some assert to control if I'm passing right arguments or so. So if I'm sure I didn't use any resources against SD, is it necessary to use strictly only SD functions?

Parents
  • Thanks for reply.
    Now I'm confused with another thing. From SD examples i see this SD setup:

    uint32_t err_code = sd_softdevice_enable(NRF_CLOCK_LFCLKSRC_XTAL_50_PPM, 
                                                 softdevice_assert_callback);
        APP_ERROR_CHECK(err_code);
    
        // Configure application-specific interrupts. Set application IRQ to lowest priority and enable 
        // application IRQ (triggered from ANT protocol stack).
        err_code = sd_nvic_SetPriority(SD_EVT_IRQn, NRF_APP_PRIORITY_LOW); 
        APP_ERROR_CHECK(err_code);
        err_code = sd_nvic_EnableIRQ(SD_EVT_IRQn);      
        APP_ERROR_CHECK(err_code);
    

    What is SD_EVT_IRQn?
    It's not regular peripheral IRQ, I suppose it's some kind of callback used by SD stack? But from comment it seems like it should set priority of my IRQ in app globally to lowest priority, so I don't need to set individually priority by sd_nvic_SetPriority() ?

Reply
  • Thanks for reply.
    Now I'm confused with another thing. From SD examples i see this SD setup:

    uint32_t err_code = sd_softdevice_enable(NRF_CLOCK_LFCLKSRC_XTAL_50_PPM, 
                                                 softdevice_assert_callback);
        APP_ERROR_CHECK(err_code);
    
        // Configure application-specific interrupts. Set application IRQ to lowest priority and enable 
        // application IRQ (triggered from ANT protocol stack).
        err_code = sd_nvic_SetPriority(SD_EVT_IRQn, NRF_APP_PRIORITY_LOW); 
        APP_ERROR_CHECK(err_code);
        err_code = sd_nvic_EnableIRQ(SD_EVT_IRQn);      
        APP_ERROR_CHECK(err_code);
    

    What is SD_EVT_IRQn?
    It's not regular peripheral IRQ, I suppose it's some kind of callback used by SD stack? But from comment it seems like it should set priority of my IRQ in app globally to lowest priority, so I don't need to set individually priority by sd_nvic_SetPriority() ?

Children
Related