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

Nuttx port question on SVC handler

Hi Nordic,

I'm porting hrs application on nuttx OS. But when I call sd_softdevice_enable function, it goes to "RESET". I read below article which mentions that SVC handler is in soft device, but my coworker said that we have to implement our SVC handler on nuttx OS by ourselves. So I'm very confused. When sd_softdevice_enable gets called, it'll go to SVC assembly code which specify the SVC number. Then what else will the application do? Or will it just pass to SVC handler in Softdevice?

devzone.nordicsemi.com/.../Introduction_to_the_S110_SoftDevice_v1.0.pdf

Thanks, Mich

  • All sd_xxx function calls lead to Soft Device API. Soft Device is Nordic BLE stack. You either use it or it doesn't make sense to mimic their SVC mechanism and API (you wither do your own stack - and then you will design your own API - or you use some 3rd party stack and then again it will have its own API).

  • @Mich: The SVC handler is in softdevice. You don't need to implement your SVC handler. But you need to make sure you initialized the softdevice. Do you have any kind of bootloader in your nuttx OS ? By default if you don't have bootloader, the softdevice will be initialized first before it branches to the application.

    All softdevice API calls are SVC calls, and they are handled inside the softdevice. The application doesn't need to do anything. If it crashes there must be because of something else, could be wrong context priority when you call the function ?

  • Thanks for your answer. How do I know that the SVCcall in the application actually call SVC handler in softdevice handler?
    I have SVC handler at my application and I do see it goes to SVC handler at my application. I'm not sure if it goes to SVC handler in softdevice first or directly go to SVC handler at my application. BTW, I get a an error code 0x200055C0 when calling sd_softdevice_enable(). It looks like an address... Please help!

    Mich

  • This error looks strange, it's almost like you would speak about app_ram_base and not return value. Luckily problems with SD enabling are almost #1 on this forum so you can get hundreds of hints, just use search (e.g. this one has some useful code examples but you will get this when reading Soft Device migration guide...)

    To the SVC aka SuperVisor Calls: you can read more about that in chapters 4 and 7.4 of SoctDevice specification (I refer to the latest S132 SDS V4.1)... (1/2)

  • In a nutshell if you are using Nordic Soft Device and you want to use SVC software interrupts inside your application you still have range of 16 values for your custom definitions. All the rest should be used according to SD API definition and end up in SoftDevice SVC handler.

Related