Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpiboot won't see NVME drives #119

Closed
klslz opened this issue Feb 24, 2022 · 13 comments
Closed

rpiboot won't see NVME drives #119

klslz opened this issue Feb 24, 2022 · 13 comments

Comments

@klslz
Copy link

klslz commented Feb 24, 2022

I ran latest rpiboot against a CM4 on a Waveshare-IO-BASE-A module.

  1. uSD card is working fine - as expected

  2. The NVME fs /dev/nvme0n1p1 and /dev/nvme0n1p2 won't be recognised though.

Is there anything I can do about it. Or is it simply not supported?

This to me would be a major drawback.

  • no simple backups
  • no simple corrections/edits
  • eeprom update would also require an uSD card to be inserted
@timg236
Copy link
Collaborator

timg236 commented Feb 24, 2022

It's not supported because the firmware does not have write support for NVMe. The USB-MSD firmware is a pretty old legacy stack so unlikely to be improved.

However, the Raspberry Pi Imager embedded version can be launched via rpiboot (you need the very latest release) and that supports NVMe. I think the future direction is to load a Linux RD which can then use standard Linux commands to modify the file-system e.g. HTTP download etc or use a USB gadget driver from Linux.

@klslz
Copy link
Author

klslz commented Feb 24, 2022

I am wondering if the rpi-imager is the right tool for day2day maintenance tasks.

The way I'd see it. You'd basically would have to disassemble the whole device or you'd need to insert and boot an uSD to run this or that maintenance task.

However. That's the way it is.

Would be nice to see a note about that IMO serious limitation in the otherwise excellent RPI online doc:

https://github.com/raspberrypi/documentation/blob/develop/documentation/asciidoc/computers/raspberry-pi/boot-nvme.adoc

Otherwise more people will run into this trap.

THX

@timg236
Copy link
Collaborator

timg236 commented Feb 24, 2022

It's more likely to be a Linux-initrd that exposes the block device(s) via the OTG in gadget mode, although MTP might also be an option. That way it will work with whatever hardware the Linux kernel supports rather than baking all of this into the VPU stack.

@klslz
Copy link
Author

klslz commented Feb 24, 2022

I see. Let me put it my words, just to make sure I understood what you're saying.

You mean a special "maintenance" boot-mode on the NVMe could be an option, that'd put the RPI into gadget mode, while exposing the nvme filesystems.
Similar to what's being done (process wise), with the overlay feature (which also creates a special initrd). Meaning. A new
feature inside raspi-config that would enable gadget mode after a reboot would perhaps be required.

@timg236
Copy link
Collaborator

timg236 commented Feb 24, 2022

If it works then msd.elf will be replaced by a boot.img file containing a minimal Linux init-rd that exposes block devices via USB OTG gadget mode. It won't be Raspberry Pi OS or interactive and in the first instance would just replace what the custom msd.elf firmware does i.e. export EMMC. In principle it could export other block devices and since it's just a buildroot image anyone can roll their own.

@timg236
Copy link
Collaborator

timg236 commented Mar 10, 2022

@klslz I've uploaded an early release of the rpiboot replacement. #121

The usage is pretty much the same as msd but will will export NVMe, SCSI block devices in addition to EMMC

git clone https://github.com/timg236/usbboot.git usbboot-msg
cd usbboot-msg
git checkout mass-storage-gadget
make
cd mass-storage-gadget
../rpiboot -d .

@klslz
Copy link
Author

klslz commented Mar 11, 2022

Just ran a test against my Waveshare board and a Samsung PM991.
It works! Great stuff.

I had to change the clone command though.

git clone https://github.com/timg236/usbboot.git usbboot-msg

Thanx a lot for your efforts.

I have a couple more drives and MBs over here. I'll do some more
testing next week.

@timg236
Copy link
Collaborator

timg236 commented Mar 11, 2022

Just ran a test against my Waveshare board and a Samsung PM991. It works! Great stuff.

I had to change the clone command though.

git clone https://github.com/timg236/usbboot.git usbboot-msg

Thanx a lot for your efforts.

I have a couple more drives and MBs over here. I'll do some more testing next week.

Thanks. Hopefully, it can be merged into the main repo next week.

@klslz
Copy link
Author

klslz commented Mar 12, 2022

2nd test:

DFRobot DFR0767 MBO + CM4 - 8GB EMMC

OK!!

@klslz
Copy link
Author

klslz commented Mar 13, 2022

Hi Tim.

How would the eeprom update (recovery) work now??

@klslz
Copy link
Author

klslz commented Mar 14, 2022

So. Final feedback.

I just tested the Eeprom update. It also works.
I also tested a Samsung 980Pro on a PCI-E adapter on the CM4 IO Board. Works great too.

Bottom line.
3 MBOs, 3 media types. All OK.

From my POW the case can be closed as soon as the update is merged.

Thx again.

@timg236
Copy link
Collaborator

timg236 commented Mar 14, 2022

@peterharperuk @pelwell ok to merge?

@timg236
Copy link
Collaborator

timg236 commented Mar 14, 2022

@klslz Thanks for the test report. This is now merged.

@timg236 timg236 closed this as completed Mar 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants