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

PWM in Mesh SDK 2.0.0

Hi,

I would like to use a PWM application with mesh SDK. However when I try to compile, I got an error because "app_pwm.h" is missing (No such file or directory).

The only related topics I found was here and here but I guess this is outdated as "The nRF5 SDK for Mesh now requires the nRF5 SDK to compile. By default, the nRF5 SDK is expected to be adjacent to the nRF5 SDK for Mesh".

Can someone help me with this?

Parents
  • hello,

    Assuming that you are using Segger Embedded Studio (SES), you can follow the directions in the .\nrf5-mesh-sdk_v2.01\doc\getting_started\SES.md file... This will allow you to direct SES to the location of your nRF5 SDK.

    # nRF5 SDK for Mesh Segger Embedded Studio first time setup
    
    Segger Embedded Studio determines the location of the nRF5 SDK through macros.
    Before building the example, you must first configure the `SDK_ROOT` macro
    in Segger Embedded Studio. This is a one time global configuration that will
    still be valid the next time you open Segger Embedded Studio. The `SDK_ROOT`
    variable defaults to an nRF5 SDK 15.0.0 instance unzipped right next to the mesh
    folder if not set.
    
    The `SDK_ROOT` macro can be set by navigating to Tools -> Options, then
    "Building". Under "Build" in the configuration list, edit "Global macros" to
    contain `SDK_ROOT=<the path to your nRF5 SDK 15 instance>`. Save the
    configuration.
    
    The path can be verified by opening one of the source files under the "nRF5 SDK"
    file group. If the macro was set correctly, the file should open in the editor
    window. If not, it will show an error message telling you that the file couldn't
    be found.
    
    For more info on Segger Embedded Studio macros, see
    https://studio.segger.com/ide_project_macros.htm

    Alternatively, you can simply ensure that the nRF5 SDK is located adjacently to the nRF5 Mesh SDK as depicted in the image below...

    Regards,

Reply
  • hello,

    Assuming that you are using Segger Embedded Studio (SES), you can follow the directions in the .\nrf5-mesh-sdk_v2.01\doc\getting_started\SES.md file... This will allow you to direct SES to the location of your nRF5 SDK.

    # nRF5 SDK for Mesh Segger Embedded Studio first time setup
    
    Segger Embedded Studio determines the location of the nRF5 SDK through macros.
    Before building the example, you must first configure the `SDK_ROOT` macro
    in Segger Embedded Studio. This is a one time global configuration that will
    still be valid the next time you open Segger Embedded Studio. The `SDK_ROOT`
    variable defaults to an nRF5 SDK 15.0.0 instance unzipped right next to the mesh
    folder if not set.
    
    The `SDK_ROOT` macro can be set by navigating to Tools -> Options, then
    "Building". Under "Build" in the configuration list, edit "Global macros" to
    contain `SDK_ROOT=<the path to your nRF5 SDK 15 instance>`. Save the
    configuration.
    
    The path can be verified by opening one of the source files under the "nRF5 SDK"
    file group. If the macro was set correctly, the file should open in the editor
    window. If not, it will show an error message telling you that the file couldn't
    be found.
    
    For more info on Segger Embedded Studio macros, see
    https://studio.segger.com/ide_project_macros.htm

    Alternatively, you can simply ensure that the nRF5 SDK is located adjacently to the nRF5 Mesh SDK as depicted in the image below...

    Regards,

Children
  • Hello leonwj,

    Thanks for the quick reply.

    Unfortunately, that is not the solution. I had  nRF5 SDK located adjacently to the nRF5 Mesh SDK already. That part is fine, since I was able to Build the light_switch server example without changes.

    I also checked through the instructions: "The path can be verified by opening one of the source files under the "nRF5 SDK" file group. If the macro was set correctly, the file should open in the editor window. If not, it will show an error message telling you that the file couldn't be found." and it worked.

    But if I try to include other header files it fails with the message No such file or directory as described before.


    Then I still edited the "Global macro" as described, but still it doesn't work (I tried app_pwm.h and nrf_drv_pwm.h).

    Regards,

  • ok, you didn't include your error log in your original post so my initial observation was to highlight how to get the nRF5 SDK configured into a mesh solution...

    The app_pwm.h file is included in the nRF5 SDK so you may have to explicitly configure your SES settings to include the .\nrf5_sdk_15.0.0_a53641a\components\libraries\pwm directory into your build path (see below):

    Edit Options...->Preprocessor

    Regards,

  • Hello leonwj,

    I explicitly configured my SES settings to include the .\nrf5_sdk_15.0.0_a53641a\components\libraries\pwm directory into your build path (as well as 2 other include file that were stated as missing in further Build attempts):

    I also added the file app_pwm.c to my project files under nRF SDK.

    However I got 7 errors like this when trying to Build again:

    What do I need to do more? Is there a sdk_config.h that needs to be edited as well in Mesh SDK?

  • Yes, examples in the mesh also have sdk_config.h (found in the include folder for the mesh example). here you need to set APP_PWM_ENABLED to 1

  • Hi,

    So, I edited sdk_config.h to enable and set APP_PWM_ENABLED 1, I got 48 errors this time. Then I tried to enable NRFX_TIMERNRFX_PPI and NRFX_GPIOTE with no results.

Related