ttyAMA0 fails with pHAT on RPi3


#1

Newly installed Propeller HAT on Raspberry Pi 3 fails the following command:

sudo propman Your-first-SPIN-program.binary

… with the following response:

pm.device: Failed to open device: "ttyAMA0"
pm.device: Failed to open device: "ttyAMA0"
pm.device: Failed to open device: "ttyAMA0"
pm.device: Failed to open device: "ttyAMA0"
pm.device: Failed to open device: "ttyAMA0"
pm.loader: [ttyAMA0] EROR: DEvice not open

I followed the instructions to ensure that ttyAMA0 is enabled more than once with no success.
I had first performed a lengthy update to my Jessie Pi OS, then followed the instruction to install the IDE.
Openspin failed at first, until I changes its owner and group to ‘pi’.
But uploads to the hat always fail with the above message.
Any suggestions are welcome.


#2

The Pi 3 wreaks havoc on the UART setup by giving the hardware over to Bluetooth and using, iirc, a software alternative to serve the ttyAMA0 pins. This mucks with the precise timings that the Propeller chip relies upon. You need to add dtoverlay=pi3-disable-bt or dtoverlay=pi3-miniuart-bt to /boot/config.txt

See here for details on what those do: https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README#L957-L982


#3

gadgetoid,

Thanks for you quick response.
I applied ‘dtoverlay=pi3-disable-bt’, rebooted, but no success. I get the same response as before. I searched for startup messages in /var/log/syslog, and found no hint of an error related the overlay change. I also applied ‘sudo systemctl disable hciuart’ before reboot per the info text.


#4

gadgetoid,

My suspicion is that if I place ‘dtoverlay=pi3-disable-bt’ in /boot/config.txt I must also possess a file named ‘pi3-disable-bt-overlay.dtb’ in /boot/overlays. Am I right? If so, where do I get that file?


#5

It should just be named pi3-disable-bt.dtbo and you can find it here: https://github.com/raspberrypi/firmware/tree/master/boot/overlays

It should be there as standard in a Raspbian Jessie image.


#6

Success!
I didn’t have the latest Raspian distribution. I do now.

Thanks!


#7

Is this also an issue with the Pi Zero ‘W’ as well?


#8

Yes, I believe it is.