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

button exmaple is not working in SDK version 9.0.0

Hello evryone,

i cloned button example form github to sdk version 9.0.0 and i modified the neccesary changes between app.gpiote.c//nrf_drv_gpiote.c files and set the GPIOTE ENABLED to 0 after that it is getting compiled with no errors but the baord shows nothing if the press any of the button can anyone suggest me what modifications has to be done or any changes?

ble_app_template.zip

Thank you

prabhu

Parents
  • Hi prabhudurai,

    still havent gone through your code, but had a quick look. I saw this below code in your init_gpio() function

    NRF_GPIO->PIN_CNF[6] = (GPIO_PIN_CNF_DRIVE_H0D1 << GPIO_PIN_CNF_DRIVE_Pos);

    This is wrong as you are setting every other bits to '0' and only setting the drive strength. With this the pin will be configured as input. To do this correctly, you need to do this below

    NRF_GPIO->PIN_CNF[6] &= ~(GPIO_PIN_CNF_DRIVE_Msk); // reset drive setting
    NRF_GPIO->PIN_CNF[6] |= (GPIO_PIN_CNF_DRIVE_H0D1 << GPIO_PIN_CNF_DRIVE_Pos); // set to high drive
    

    you need to do this for pin settings 7 also.

  • I am now looking at your attached project...OK lets see.... Looks like in SDK9.0 you were using packs to create your project, that is the reason lots of SDK9.0 specific files were copied into your project RTE folder and those are creating the problem.

    1. When i compiled your project it says that nrf_delay.h and nrf_delay.c were not found. This might be because they have changed their location from SDK9 components\drivers_nrf\hal\ to SDK10 components\drivers_nrf\delay Fix these first.
    2. app_uart_fifo.c is moved from SDK9 components\drivers_nrf\uart to SDK10 components\libraries\uart
    3. Instead of using nrf_drv_config.h fie located at components\drivers_nrf\config\ you are using your own local copy of your_project\config\nrf_drv_config.h file in your project. Your local copy of this file is from SDK9.0 and does not suit well for SDK10. delete the local copy and use the one in the SDK10.0\components\driver_nrf\config\ folder and enable GPIOTE_ENABLED , TIMER1_ENABLED and UART0_ENABLED and #define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 5 in nrf_drv_config.h
    4. add components\drivers_nrf\uart\nrf_drv_uart.c file to your project
    5. Uncomment your uart initialization code
    6. remove while(true) code in your buttons_init function (i think you forgot to delete it after some debugging)
    7. change the definition of static app_timer_id_t m_timer_id; to APP_TIMER_DEF(m_timer_id); read more documentation for this change here
    8. you were using void pwm_start(); in timer handle, that will not call be create a definition of pwm_start()

    now it compiles

    "._build\nrf51422_xxac.axf" - 0 Error(s), 0 Warning(s).

    To debug your code you have to change the optimizations in Target_settings->C/C++->Optimization to Level 0 (for your final product change it back to Level 3)

    I have testednow I am attaching the main file just in case main.c I have tested the outputs and they work well. good luck. please do not forget to accept this answer if it works for you too.

Reply
  • I am now looking at your attached project...OK lets see.... Looks like in SDK9.0 you were using packs to create your project, that is the reason lots of SDK9.0 specific files were copied into your project RTE folder and those are creating the problem.

    1. When i compiled your project it says that nrf_delay.h and nrf_delay.c were not found. This might be because they have changed their location from SDK9 components\drivers_nrf\hal\ to SDK10 components\drivers_nrf\delay Fix these first.
    2. app_uart_fifo.c is moved from SDK9 components\drivers_nrf\uart to SDK10 components\libraries\uart
    3. Instead of using nrf_drv_config.h fie located at components\drivers_nrf\config\ you are using your own local copy of your_project\config\nrf_drv_config.h file in your project. Your local copy of this file is from SDK9.0 and does not suit well for SDK10. delete the local copy and use the one in the SDK10.0\components\driver_nrf\config\ folder and enable GPIOTE_ENABLED , TIMER1_ENABLED and UART0_ENABLED and #define GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 5 in nrf_drv_config.h
    4. add components\drivers_nrf\uart\nrf_drv_uart.c file to your project
    5. Uncomment your uart initialization code
    6. remove while(true) code in your buttons_init function (i think you forgot to delete it after some debugging)
    7. change the definition of static app_timer_id_t m_timer_id; to APP_TIMER_DEF(m_timer_id); read more documentation for this change here
    8. you were using void pwm_start(); in timer handle, that will not call be create a definition of pwm_start()

    now it compiles

    "._build\nrf51422_xxac.axf" - 0 Error(s), 0 Warning(s).

    To debug your code you have to change the optimizations in Target_settings->C/C++->Optimization to Level 0 (for your final product change it back to Level 3)

    I have testednow I am attaching the main file just in case main.c I have tested the outputs and they work well. good luck. please do not forget to accept this answer if it works for you too.

Children
No Data
Related