What is the recommended way to use nRF52840 advanced PWM sequence and looping functions with nRF Connect SDK v2.9.0?

Hi,

I am developing an application for an nRF52840 using nRF Connect SDK v2.9.0.  The application currently uses the Zephyr driver for simple PWM functions on several GPIOs. Now, I need to add PWM sequences and looping as supported by the SOC on other GPIOs. Correct me if I am wrong, but I don't think the Zephyr driver can support the Nordic PWM module in this way.

What is the best way to do this? Some questions that come to mind: Can the Zephyr PWM driver and the nrfx PWM driver live together in the same application? Must I chose one driver or the other? How does DeviceTree manage this? I'm sure I'll have more questions once the discussion is opened.

Thank you,

Ken

Parents Reply Children
  • Hi Sigurd,

    I will check out the sample you mention.  For clarification, let me ask:

    1. If I use the nrfx driver/API for PWM, can I continue to use the Zephyr GPIO driver/API?
    2. What is the impact I will see in DeviceTree for PWM when using the nrfx driver/API?

    Ken

  • Hi again Sigurd,

    As I look into how this can be done, is there an specific documentation section on using Zephyr with nrfx at the same time?  Is there a cookbook for this situation?  Is there a particular sample showing simultaneous use of Zephyr drivers for some devices and nrfx drivers/APIs for others?

  • (Hi Sigurd,)**2

    I may not have time to figure this out today, and in case you have a look at this on Monday:  I created a new application by picking the common_mode PWM sample from the library.  Without making any changes to the sample, when I attempt to "Add build configuration", it fails with the following output:

    I would have thought this sample would have built without modification but it will not.  What do I need to do?  Is it documented somewhere?

    Thanks again,

    Ken

    CCMakeError.log contents:

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler: C:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    Build flags:
    Id flags:  

    The output was:
    1
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/lib\libc.a(lib_a-exit.o): in function `exit':
    exit.c:(.text.exit+0x34): undefined reference to `_exit'
    collect2.exe: error: ld returned 1 exit status


    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
    Compiler: C:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc.exe
    Build flags:
    Id flags:  

    The output was:
    1
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.exe: c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/lib\libc.a(lib_a-exit.o): in function `exit':
    exit.c:(.text.exit+0x34): undefined reference to `_exit'
    collect2.exe: error: ld returned 1 exit status
  • Hi Sigurd,

    Do you have any response to why the sample application you mentioned will not build?

    Thanks,

    Ken

Related