miegl / PiFmAdv

Advanced Raspberry Pi FM transmitter with RDS encoding
GNU General Public License v3.0
487 stars 82 forks source link

Using GPIO 34 on Pi 3, 3B+ and Zero W interferences with wifi #41

Closed caraiz closed 5 years ago

caraiz commented 5 years ago

Hi,

im testing it with a Raspberry Pi 3 and 3B+, the radio works but when the program exits it brokes the network connections. The wifi is still connected, but ping, ssh,... do not work anymore.

I have debugging a bit and it hangs at terminate function "Set GPIOs to be an output (instead of ALT FUNC 0, which is the clock)."

Trying with an older version, works fine at Pi 3, but at Pi3B+ occurs the same at code "Switch EMMC over to PLLD"

Thanks.

miegl commented 5 years ago

This is weird... Don't know if it's specific to pi 3 or if it's due to firmware updates. Can somebody test this on a raspi 2?

caraiz commented 5 years ago

Hi,

i found that the problem appears executing this line at terminate function:

gpio_reg[3] = (gpio_reg[3] & ~(7 << 12)) | (1 << 12); //GPIO34

Im using default gpio (4).

arhico commented 5 years ago

Have the same problem on my zero W. Commented out gpio 34 release to get it to work ok.

miegl commented 5 years ago

Hm, weird. Works fine on my Pi 2. Maybe it has something to do with wifi?

miegl commented 5 years ago

GPIO 34 is indeed used by the SDIO interface, which is used for wifi. https://github.com/raspberrypi/linux/blob/rpi-4.14.y/arch/arm/boot/dts/bcm2710-rpi-3-b.dts#L48

miegl commented 5 years ago

I will update the README to warn about GPIO usage and improve the terminate function to set only the used GPIO.