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

  • yes i saw that and i have added the nrf_uart.h/app_uart_fifo.c/nrf_uart.c/app_fifo.h/app_fifo.c/ those files but still it is showing the same errors alomost 22errors both the errors are coming from these two files app_uart_fifo.c/nrf_uart.c only even though modifying these line in #define UART0_ENABLED 1 in nrf_drv_config.h file

  • 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.

  • Thank you so much for your kind reply now i can able to make the buzzer work in SDK 9 itself but i am using this function

    app_pwm_config_t pwm1_cfg = APP_PWM_DEFAULT_CONFIG_2CH(160UL,6,7);//6.3KHz

    pwm1_cfg.pin_polarity[1] = APP_PWM_POLARITY_ACTIVE_HIGH;

    i connected two buzzers inorder to test both the pin are providing current but only the 6 pin of the buzzer is making beep sound if i set the acitive polarity to LOW and for the pin 7 it does not making any sound and it is not working i dont know there is some issue in my gpio configuration ? and also i checked the voltage on both pins by keeping this configuration

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

    bot the pins are showing voltage 2.9 but after the buzzer making sound the voltage on the pin 6 drops to 1.44v and the voltage on the pin 7 remains 2.9but it is not producing any sound i dont understand why this happening and how to produce beep sound on both pins 6 and 7 can you please suggest me some ideas

  • why are you setting the polarity to HIGH for one buzzer?

  • i thought i have to set it to high then only it can produce sounds on both pins but really i dont understand this function clearly why to set LOW and why to set high ? the reason for setting both the pin 6 and 7 in standard high drive mode 5mA because then only it will deliver more current to the buzzer so that buzzer can produce more sound it my therotical concept am i right or wrong please suggest me about this idea

Related