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

Setting LFCLK gives hardfault

Description of my system:

Hardware:nRF51822, pca10001

Software: SDK5.20, S120

If i first call the function ble_stack_init(); and then i open the LFCLK first by set

NRF_CLOCK->LFCLKSRC = 1;
NRF_CLOCK->TASKS_LFCLKSTART = 1;

the program will into a HardFault_Handler, but in inverted order ,the HardFault will not happen.

if i call the sd_nvic_SetPriority,it also into a HardFault_Handler.

so i have no ideas to solve it.

Edit: format, question.

Parents
  • You shouldn't try to start lfclk manually after calling ble_stack_init() because when you call ble_stack_init() it'll call SOFTDEVICE_HANDLER_INIT() that will start lfclk and then softdevice will block all access from your application to lfclf settings.

    Describe your problem with sd_nvic_SetPriority()/sd_nvic_EnableIRQ() in more detail, what are you trying to do and when you getting HardFault.

Reply
  • You shouldn't try to start lfclk manually after calling ble_stack_init() because when you call ble_stack_init() it'll call SOFTDEVICE_HANDLER_INIT() that will start lfclk and then softdevice will block all access from your application to lfclf settings.

    Describe your problem with sd_nvic_SetPriority()/sd_nvic_EnableIRQ() in more detail, what are you trying to do and when you getting HardFault.

Children
No Data
Related