I wrote pasm code that has the PRU set up a 10%-duty-cycle 33kHz square wave using PWM on the ehrpwm1B peripheral (which maps to P8_34 in mode 2).
It worked on the 3.18 kernel but doesn’t work on 4.1.12.
When my C code tries to start the PRU code, prussdrv_open returns -1 (bad).
I think the problem is related to the device-tree. I’m using the overlays:
- am33xx_pwm
- bone_pwm_P8_34
- EBB-PRU-Example (from Derek Molloy’s book)
When loading EBB-PRU-Example, I get a “No children” message from the pruss_uio subsystem:
[ 3822.302571] bone_capemgr bone_capemgr: part_number ‘EBB-PRU-Example’, version ‘N/A’
[ 3822.302633] bone_capemgr bone_capemgr: slot #8: override
[ 3822.302671] bone_capemgr bone_capemgr: Using override eeprom data at slot 8
[ 3822.302713] bone_capemgr bone_capemgr: slot #8: ‘Override Board Name,00A0,Override Manuf,EBB-PRU-Example’
[ 3822.308128] gpio-of-helper ocp:gpio_helper: ready
[ 3822.308324] bone_capemgr bone_capemgr: slot #8: dtbo ‘EBB-PRU-Example-00A0.dtbo’ loaded; overlay id #2
[ 3822.402747] pruss_uio 4a300000.pruss: No children
Also, my 4.1.12 kernel didn’t seem to include the bone_pwm_P8_34 overlay (so I found it online). Is bone_pwm_P8_34 the “old way”, and the “new way” involves loading the “universala.dts” overlay and then using the config-pin script?
Here is my code:
https://www.dropbox.com/sh/0mk6g4bd12spp9x/AAArsHYddApMdMWgKb4PbtcHa?dl=0
The ‘build-and-run.sh’ is how I compile and run everything.
I’d really appreciate any help – either with this specific problem, or resources for debugging problems with device-tree overlays. I’m a control-theory guy, not a kernel guy, but I’m happy to learn.
Thanks,
Justin