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
  • Hi!

    The Zephyr driver API does not have the full functionality that is offered in nrfx pwm API.

    So one option it to use nrfx directly. I would not recommend trying to mix and use both APIs.

    https://github.com/zephyrproject-rtos/hal_nordic/blob/master/nrfx/samples/src/nrfx_pwm/common_mode/main.c

  • (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
Reply
  • (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
Children
No Data
Related