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

Migrating SDK 6.1 -> SDK 10

I just needed some clarification as I'm migrating from SDK 6.1 to SDK10:

  1. app_button: There's no way to have the Button function thru the Scheduler anymore. I would have in effect have to write my own app_button_with_scheduler module

  2. If I handle app_button events as is (GPIOTE interrupt context), it is safe to start app_timers within the event_handler?

  3. With the new file structure I cannot find any implemented use of the examples config/nrf_drv_config.h? I understand what the code means in these files, but I don't see where it is ever used. My applications use of TIMERs was always handled in the context in which it was used: SPI Master, External interrupt (GPIOTE), custom PWM code, ADC, Temperature. So I don't feel like I would need the nrf_drv_config.h in my project, unless it serves a purpose I don't see? Please advise.

  4. Since Nordic has differentiate the modules, now I would have to use app_timer_appsh if I want to have my app_timers use the Scheduler. Correct?

  5. Just as a comment: The old SDK online documentation (6.1) was much much easy to browse through. Also searching was much easier then the new infocenter version. I cannot search for anything only within a specific SDK. i.e. search for app_timer only in SDK 10.

Thanks in advanced for your advisement on these issues.

-DC

  • Hi Dave

    1. The option of letting the app_button call the scheduler was apparently removed in nRF51 SDK 8.0.0. I am not sure for the reason for it, but if you still want to use scheduler for app_button, you should need to add that functionality manually.

    In fact, the app_button handler is not executed in app_gpiote interrupt context. What happens is the following:

    • App_button is initialized and registers gpiote user and callback, creates app_timer and callback
    • When button is pushed, the APP_IRQ_PRIORITY_HIGH app_gpiote handler is executed which starts an app_timer.
    • When the app_timer expires, APP_IRQ_PRIORITY_LOW interrupt handler is executed which calls app_button interrupt handler. If scheduler was chosen when initializing the app_timer library, the app_button is also called with in main context. So it seems you control the context of the app_button handler by choosing to use scheduler or not for app_timer.
    1. I see no problem in starting a timer in app_button handler

    2. I would recommend to use the drivers and the nrf_drv_config.h driver configuration file for SDK 10.0.0. All implementation is tailored around the drivers and I find it much easier to use them for SDK 8.0.0+. All peripheral examples in SDK 10.0.0 should use the peripheral drivers, e.g. spi_master, uart, etc. You can not use the peripherals unless you enable them in nrf_drv_config.h

  • I'm also trying to port my application from SDK V6.1.0 to SDK 10.0.0 and maybe this thread will be useful as well for you. My current understanding is that, nrf_drv_config.h has to be manually edited as per the requirements. I've a custom board with nrf51822QFAA SOC and I'm using the nrf_drv_config.h template file from one of the examples under

    "C:\Keil_v5\ARM\Pack\NordicSemiconductor\nRF_Examples\10.0.0\ble_peripheral\ble_app_hrs\pca10028\s110\arm5\RTE\nRF_Drivers\nRF51422_xxAC" (Note that this example is for nrf51422 based SOC)

    for my board but using it as it is in my case causes conflicts with UART handler. While compiling, I get following error:

    Error: L6200E: Symbol UART0_IRQHandler multiply defined (by nrf_drv_uart.o and test_app_uart.o).

    Here, test_app_uart.c is part of my application and I do not wish to change the UART0_IRQHandler defined here.

    One way to get rid of this is to comment out the UART IRQ handler in nrf_drv_uart.c (C:\Keil_v5\ARM\Pack\NordicSemiconductor\nRF_Drivers\3.1.0\uart) but this is really bad and if I try not to use nrf_drv_uart by unchecking nrf_drv_uart box from the KEIL runtime environment, I get into a lot of dependency issue :( So what is the best way to solve this issue ?

    Thanks a lot for your help.

Related