Open fly-studio opened 2 years ago
I read the implement of startPWMbyDMA
, I think a memory leak was caused by allocateCB
to /dev/vcio
mailboxTx32(mbReleaseMemory, m.handle)
maybe not work correctly
It'll not hung when useDMA=false
,
so GPIO_13 GPIO_19 can works without hung
useDMA := false
switch p.number {
case 12, 40: // PWM0 alt0: disabled
useDMA = true
case 13, 41, 45: // PWM1
f = alt0
case 18: // PWM0 alt5: disabled
useDMA = true
case 19: // PWM1
f = alt5
default:
useDMA = true
}
Describe the bug
run code, and after some indeterminate time, exit and report:
restart and hung when call PWM(duty > 0) , Ctrl+C will not works. AND raspberry pi cannot restart normally via
init 6
, MUST shutdown the powerBUT
RPi.GPIO
(python) orwiringpi
(C) can works normally with the same GPIO after hangedTo Reproduce Steps to reproduce the behavior:
Pulse light
import ( "fmt" "log" "periph.io/x/conn/v3/gpio" "periph.io/x/conn/v3/physic" "periph.io/x/host/v3" "periph.io/x/host/v3/rpi" "time" )
func main() {
}