beagleboard / beagleboard/librobotcontrol
pwm driver in latest Debian image
- Dominant language
- C
- Stars
- 212
- Forks
- 167
- PR merge metrics
- No merged PRs in 30d
Description
After updating my BeagleBone Blue from Debian 9.5 to Debian 9.9 2019-08-03 4GB SD IoT, rc_pwm_init() fails for any frequency except 50 Hz. For example, I've tried 40 Hz, 60 Hz, 100 Hz and 200 Hz. The program worked under Debian 9.5 for 200 Hz, but doesn't work under Debian 9.9. The following code:
if (rc_pwm_init(0, servo_hz) != 0) { // initialize PWM subsystem 0 (SPI header)
fprintf(stderr, "ERROR: failed to initialize PWM SS 0\n");
gives the following error messages:
ERROR in rc_pwm_init, failed to write to channel A period fd: Invalid argument
ERROR: failed to initialize PWM SS 0
Is this a driver issue? In pwm.c, I find the following comments:
// The ti pwm driver has gone through several revisions and it presents devices
// in the file system differently every version. For example, subsytem 2 channel A
// showed up as the following files:
// in 4.9: /sys/class/pwm/pwmchip4/pwm0/
// in 4.14.54-ti-r63: /sys/class/pwm/pwm-4:0/
// in 4.14.61-ti-r68: /sys/class/pwm/pwm-7:0/
// depending on kernel, mode is set to 0 or 1 on export, index is used for 4.14
I am currently running:
Kernel: 4.14.108-ti-r113
BeagleBoard.org Debian Image 2019-08-03
Debian: 9.9
Currently running on a:
MODEL_BB_BLUE
Robot Control library Version:
1.0.4
[rc_servo_pwm.docx](https://github.com/StrawsonDesign/librobotcontrol/files/3668227/rc_servo_pwm.docx)
Is there a fix for Debian 9.9 or do I need to revert to an older version?
(I just verified that it does work for Debian 9.5.)
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in pwm.c at rc_pwm_init() and reproduce the period-write failure on the Debian 9.9 image using the reported kernel and BeagleBone Blue configuration. Compare the PWM sysfs layout and behavior with Debian 9.5; done means supported frequencies initialize successfully without the Invalid argument error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c, debian, linux
- Domain
- embedded-iot, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100