Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use PWM pins with STM Nucleo H743ZI #34461

Closed
manuaatitya opened this issue Apr 21, 2021 · 4 comments
Closed

Unable to use PWM pins with STM Nucleo H743ZI #34461

manuaatitya opened this issue Apr 21, 2021 · 4 comments
Assignees
Labels
platform: STM32 ST Micro STM32

Comments

@manuaatitya
Copy link

Unable to use PWM with STM Nucleo H743ZI

Hi, I'm trying out to control a servo motor attached to the STM Nucleo H743Zi board running on Zephyr RTOS but the PWM pins seems to be configured improperly and I get no signal from the pins.

The issue I'm facing is very similar to this issue however, the solution provided here doesn't seem to work.

I'm attaching my source code here for your reference.

Environment

  • OS: Ubuntu 16.04
  • Toolchain Zephyr SDK

A few important points regarding my source code

  • it comes with a preconfigured PWM pin called PWM_12 as seen from the dts file of the board.
  • I'm not using any overlays for the project and using the default configuration.
  • Drive link with all the device tree files for the board for easy access.

The code actually builds without errors but on testing with an oscilloscope, there's no PWM pin output from the pin.

Any help to resolve this issue will be appreciated.

@manuaatitya manuaatitya added the bug The issue is a bug, or the PR is fixing a bug label Apr 21, 2021
@galak galak added platform: STM32 ST Micro STM32 priority: low Low impact/importance bug question and removed bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug labels Apr 21, 2021
@FRASTM
Copy link
Collaborator

FRASTM commented Apr 21, 2021

I check with the samples/basic/blinky_pwm/ on a nucleo_h723zg which is ike the nucleo h743zi, with similar PWM config. The PWM output of the Timer12 channel1 is on pin pb14. On the nucleo board (MB1364) the PB14 is on the red led. Enabling the PWM of the the TIMER 12 channel 1, will directly control the red led.

@manuaatitya
Copy link
Author

manuaatitya commented Apr 21, 2021

Hi @FRASTM, the issue is there is not output from the PWM pin and hence we do not see any blinking/flashing of LEDs,

Now I also tried out the blinky_pwm_led example as you suggested, but I get an error on build saying zephyr/include/drivers/pwm.h:374 "undefined reference to __device_ord_24'

@FRASTM
Copy link
Collaborator

FRASTM commented Apr 22, 2021

what is your zephyr branch ? With the latest (ecf8914) I can compile w/o any error
west build -p auto -b nucleo_h743zi samples/basic/blinky_pwm

-- west build: making build dir ./zephyrproject/zephyr/build pristine
-- west build: generating a build system
Including boilerplate (Zephyr base): ./zephyrproject/zephyr/cmake/app/boilerplate.cmake
-- Application: ./zephyrproject/zephyr/samples/basic/blinky_pwm
-- Zephyr version: 2.5.99 (./zephyrproject/zephyr)
-- Found Python3: /usr/bin/python3.6 (found suitable exact version "3.6.9") found components: Interpreter 
-- Found west (found suitable version "0.7.2", minimum required is "0.7.1")
-- Board: nucleo_h743zi
-- Cache files will be written to: ./.cache/zephyr
-- Using toolchain: zephyr 0.11.3 (./zephyr-sdk-0.11.3)
-- Found dtc: ./zephyr-sdk-0.11.3/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found BOARD.dts: ./zephyrproject/zephyr/boards/arm/nucleo_h743zi/nucleo_h743zi.dts
-- Generated zephyr.dts: ./zephyrproject/zephyr/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: ./zephyrproject/zephyr/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: ./zephyrproject/zephyr/build/zephyr/include/generated/device_extern.h
Parsing ./zephyrproject/zephyr/Kconfig
Loaded configuration './zephyrproject/zephyr/boards/arm/nucleo_h743zi/nucleo_h743zi_defconfig'
Merged configuration './zephyrproject/zephyr/samples/basic/blinky_pwm/prj.conf'
Configuration saved to './zephyrproject/zephyr/build/zephyr/.config'
Kconfig header saved to './zephyrproject/zephyr/build/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.0
-- The CXX compiler identification is GNU 9.2.0
-- The ASM compiler identification is GNU
-- Found assembler: ./zephyr-sdk-0.11.3/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Configuring done
-- Generating done
-- Build files have been written to: ./zephyrproject/zephyr/build
-- west build: building application
[1/145] Preparing syscall dependency handling
[138/145] Linking C executable zephyr/zephyr_prebuilt.elf
[145/145] Linking C executable zephyr/zephyr.elf
Memory region         Used Size  Region Size  %age Used
           FLASH:       25028 B         2 MB      1.19%
            SRAM:        4736 B       512 KB      0.90%
            DTCM:          0 GB       128 KB      0.00%
     BACKUP_SRAM:          0 GB         4 KB      0.00%
        IDT_LIST:          0 GB         2 KB      0.00%

@manuaatitya
Copy link
Author

Hi @FRASTM, it seems that the codebase I was not using was not in the latest zephyr branch. When reverted to the latest branch, I'm able to build the app.
The issue is resolved now.
Thanks for the help.

I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: STM32 ST Micro STM32
Projects
None yet
Development

No branches or pull requests

4 participants