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

softdevice controller use

Hi,

I'm trying to make the softdevice controller work on NuttX RTOS. I followed the SDK example code to reproduce initialization. All calls are returning 0 (no error). However, once I send the first HCI command (a controller RESET) I don't receive SWI interrupt which would lead to signaling for available HCI EVT. If I call sdc_hci_evt_get() on my own, it returns 0 (indicating available EVT), so I think the SWI signaling is not working. I'm also not receiving any other interrupts configured (for RTC, TIMER, RADIO, etc). If I monitor peripheral registers after initialization calls, I also don't see any registers related to peripheral interrupt change. I also verified that if I manually pend the chosen SWI line I get to the appropriate ISR. I'm not sure if I should be doing something else besides these initialization calls (do I need to enable events for each peripheral?). The relevant code is as follows:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
int nrf52_sdc_initialize(void)
{
int ret;
int32_t required_memory;
sdc_cfg_t cfg;
/* Initialize device data */
memset(&g_sdc_dev, 0, sizeof(g_sdc_dev));
nxsem_init(&g_sdc_dev.exclsem, 0, 1);
/* Register interrupt handler for normal-priority events */
irq_attach(NRF52_IRQ_SWI5_EGU5, swi_isr, NULL);
irq_attach(NRF52_IRQ_POWER_CLOCK, power_clock_isr, NULL);
irq_attach(NRF52_IRQ_RNG, rng_isr, NULL);
up_enable_irq(NRF52_IRQ_SWI5_EGU5);
up_enable_irq(NRF52_IRQ_POWER_CLOCK);
up_enable_irq(NRF52_IRQ_RNG);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Thank you,

Matias