Accessing ttyS0 on Raspberry Pi 3 running Ubuntu Core

I am running Ubuntu Core on a Raspberry pi 3.
I would like to access a device using the serial port and believe this should be available at /dev/ttyS0. However there is no communication at the moment there.

From reading some other postings, it seems like the serial port is not enabled by default on the Raspberry Pi3 and in non Ubuntu Core systems the file /boot/config.txt should be edited.

Is there an equivalent step to be taken for Ubuntu Core to get this working? I don’t seem to have any gadget snaps for ttyS0, however I am running in development mode.

You might be interested in this discussion Gadget providing serial-port slot

Well, this looks more like a general issue with config.txt the interface would surely be helpful too but by default the uart is disabled in the pi bootloader …

The problem witth enabling it and thus enforcing the core speed of the GPU default is described at:

… "The Linux console can be re-enabled by adding enable_uart=1 to config.txt. This also fixes the core_freq to 250Mhz (unless force_turbo is set, when it will fixed to 400Mhz), which means that the UART baud rate stays consistent. " …

The config.txt file is writable so it can be manually edited on the installed image as a workaround nd @jenny.murphy can just add the enable_uart=1 line there.

To implement it properly the option should be added to:

… then it can be set via

snap set  core pi-config.enable_uart=1

or via a respective defaults: entry in a custom gadget in the gadget.yaml …

please create a bug at:

so it can be added properly …

1 Like

The workaround for me involved adding

enable_uart=1 to /boot/uboot/config.txt

and

removing “console=ttyAMA0,115200” from the line in /boot/uboot/cmdline.txt

Rebooting then for the changes to take effect.

try changing it to console=serial0,115200, iirc the bootloader will pick this up so you still get a serial console (in case you actually need one at least :slight_smile: )

Hi,
In cmdline.txt I have already console=tty0. Is this significant?
I don’t seem to have any /dev/serial0, /dev/serial1 mappings but I don’t need that and can work with /dev/ttyS0.
Thanks

1 Like

this is defining the graphical console (typically on HDMI on the pi) if you want any console output at all, you should keep it :slight_smile:

1 Like