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

Merging two SDK examples in SES

Hi all,

I am trying to get a hang of SES platform(Using the nRF52840 Preview DK, SDK 15.3) and it's my first few trails with it. I am trying something very basic now to integrate ble_app_uart and pwm_driver to set a particular duty cycle from the nRF UART app using a phone to get the basic flow going.

I am editing the ble_app_uart and adding pwm_driver example-code to it. Whenever I am compiling the code, I am getting the following 2 errors

#error "No enabled PWM instances. Check <nrfx_config.h>."
and
'NRFX_PWM0_INST_IDX' undeclared here (not in a function); did you mean 'NRFX_PWM_INSTANCE'?

Searching for them on the forum here, I was able to find some information on it. I have edited the sdk_config.h(to the best of my knowledge) to make sure the NRFX_PWM is enabled. I have also added nrfx_pwm.c in the nRF_Drivers folder in SES project. But I think the issue lies here as I cant seem to find Dependencies and Output Files for this file as shown below.

Is it something to do with adding the header files? I have added the nrfx_pwm.h file via the Project Options through Preprocessor (User Include Directories) but I am not sure if its added correctly. Are there any other files to be added?

Can anyone help me out to solve this issue? What am I doing wrong here?

I am attaching the SES project folder which I was making. (It should run if its placed in SDK 15.2 examples\ble_peripheral\ble_app_uart folder\pca10056\s140 folder)

ses.zip

Parents
  • Hello, 

    I am attaching the SES project folder which I was making. (It should run if its placed in SDK 15.2 examples\ble_peripheral\ble_app_uart folder\pca10056\s140 folder)

     I added the folder to the specified folder and was able to build. Did you try to build after adding the file? (I am however missing you sdk_config.h in the file you sent)

     

    Edit: (DevZone not working properly and replying before I was done with the answer)

    Make sure that you have enabled the correct instance of PWM in sdk_config.h

    // <e> NRFX_PWM_ENABLED - nrfx_pwm - PWM peripheral driver
    //==========================================================
    #ifndef NRFX_PWM_ENABLED
    #define NRFX_PWM_ENABLED 1
    #endif
    // <q> NRFX_PWM0_ENABLED  - Enable PWM0 instance
     
    
    #ifndef NRFX_PWM0_ENABLED
    #define NRFX_PWM0_ENABLED 1
    #endif

    Kind regards,
    Øyvind

Reply
  • Hello, 

    I am attaching the SES project folder which I was making. (It should run if its placed in SDK 15.2 examples\ble_peripheral\ble_app_uart folder\pca10056\s140 folder)

     I added the folder to the specified folder and was able to build. Did you try to build after adding the file? (I am however missing you sdk_config.h in the file you sent)

     

    Edit: (DevZone not working properly and replying before I was done with the answer)

    Make sure that you have enabled the correct instance of PWM in sdk_config.h

    // <e> NRFX_PWM_ENABLED - nrfx_pwm - PWM peripheral driver
    //==========================================================
    #ifndef NRFX_PWM_ENABLED
    #define NRFX_PWM_ENABLED 1
    #endif
    // <q> NRFX_PWM0_ENABLED  - Enable PWM0 instance
     
    
    #ifndef NRFX_PWM0_ENABLED
    #define NRFX_PWM0_ENABLED 1
    #endif

    Kind regards,
    Øyvind

Children
Related