beagleboard / robotics-cape

5 stars 3 forks source link

Motor2_PWM can't be controlled #29

Open mingzhangqun opened 2 years ago

mingzhangqun commented 2 years ago

PRU firmware: https://github.com/mingzhangqun/cloud9-examples/tree/bbai64-cape DTS: https://github.com/mingzhangqun/BeagleBoard-DeviceTrees/tree/v5.10.x-ti-arm64-dev robotic_demo: https://github.com/mingzhangqun/robotic_demo/tree/main-dev

debian@BeagleBone:~/cloud9-examples/BeagleBone/AI-64/pru$ sudo make blinkR30
debian@BeagleBone:~/robotic_demo$ make
Please select pwm chs[0-14]:(0,1,2,3...)
1
Selected:0x0002
('q' - exit, '+' - inc, '-' - dec, 'r' - run/stop)
sh: 1: echo: echo: I/O error
sh: 1: echo: echo: I/O error
sh: 1: echo: echo: I/O error
+
duty=100
r
ctrl=1

Motor2 PWM cannot be controlled, other channels are fine.

image

jadonk commented 2 years ago

Is the 0.6 version of the schematics the latest? I'm not understanding some of the behavior myself, including something as simple as controlling LED1 and LED2.

mingzhangqun commented 2 years ago

Is the 0.6 version of the schematics the latest? I'm not understanding some of the behavior myself, including something as simple as controlling LED1 and LED2.

Yes, the 0.6 is the latest. What's your meaning of the behavior? the hardware or software?

jadonk commented 2 years ago

I cannot toggle LED1 and LED2 signals. I have a boot issue now, but hope to resolve that this morning.

mingzhangqun commented 2 years ago

I have updated the dts, and tested fine. https://github.com/mingzhangqun/BeagleBoard-DeviceTrees/blob/v5.10.x-ti-arm64-dev/src/arm64/k3-j721e-beagleboneai64-cape.dts

root@BeagleBone:/sys/class/leds# echo 1 > beaglebone\:green\:cape0/brightness
root@BeagleBone:/sys/class/leds# echo 1 > beaglebone\:green\:cape1/brightness
root@BeagleBone:/sys/class/leds# echo 1 > beaglebone\:green\:cape2/brightness
root@BeagleBone:/sys/class/leds# echo 1 > beaglebone\:green\:cape3/brightness
jadonk commented 2 years ago

I meant LED1/LED2 on the cape. I fixed it with recent patches at https://github.com/jadonk/BeagleBoard-DeviceTrees/tree/ai64

I'm going to try Motor2 again soon (probably tomorrow morning), but I wanted to try to understand why my interface had issues. I had forgotten that PIN_OUTPUT in the device tree simply disables the input. It seems it also had some impact on being able to configure for gpio output as well somehow. I'm trying to determine if there was a conflict driven or a lack of GPIO enabled on one of your pins needed for Motor2.