canonical / pi-gadget

Universal pi (pi2,pi3,pi4,cm3,cm4 and future) gadget snap for Ubuntu Core and classic systems.
37 stars 62 forks source link

Pi 3 USB not enumerating #59

Closed RuhanSA079 closed 3 years ago

RuhanSA079 commented 4 years ago

Hello.

I am trying to make a armhf gadget snap, but I realised after building the armhf gadget snap and adding it to my own image build, it does not enumerate USB devices. (the Pi3 boots the image)

I git cloned this repo, changed the branch over to 18-armhf, built the image, etc. as all per instructions. Can someone tell me where and what went wrong? My model file: { "type": "model", "series": "16", "model": "core18-armhf-pi3", "display-name":"Ubuntu Core 18 (armhf)", "architecture": "armhf", "kernel": "pi-kernel=18-pi3", "gadget": "my-gadget", "base": "core18", "required-snaps": ["core"], "authority-id": "-removed-", "brand-id": "-removed-", "timestamp": "2020-11-25T16:50:51+00:00" } gadget snap yaml: Bone stock, except for the name change { name: my-gadget version: 18-1 summary: Raspberry Pi3 gadget description: | Support files for booting Raspberry Pi. This gadget snap supports the Raspberry Pi 2B, 3B, 3A+, 3B+, 4B, Compute Module 3, and the Compute Module 3+ universally. type: gadget base: core18 architectures:

Ubuntu-image command: sudo ubuntu-image -c stable --image-size 4G --snap ./gadget/pi-gadget/my-gadget_18-1_armhf.snap models/core18-armhf-pi3.model

RuhanSA079 commented 3 years ago

Somehow the u-boot is causing this problem, I fixed my image post-build by replacing the bootable partition's files with the files from the official Ubuntu Core image. Maybe this is something to look into at some time?

rodmaz commented 3 years ago

We are facing a similar issue with USB. We tracked down the issue to this bug in the linux-raspi2 package.

https://bugs.launchpad.net/ubuntu/+source/linux-raspi2/+bug/1847248

RuhanSA079 commented 3 years ago

@rodmaz I have fixed my issue by getting the pi_kernel snap file from the official Ubuntu Core image, and specified it in my model file. So, manually building the kernel snap into the ubuntu-image program, resulting a bootable image with a "static" kernel, until the linux-raspi2 package bug is fixed.

EDIT: It may help other people getting the Pi image booting without having to meddle with the boot partition, kernel, etc.