USB bug in 5.28
Chris Hall (132) 3554 posts |
When using the CM4 on the RPi IO board or on the Waveshare IO board, I get two errors from RISC OS 5.28: These can be worked around on the RPi IO board by fitting a USB board to the PCI Express slot but that means it is no longer available for fast storage. Is there a simple tweak I can do to the sources to cure this bug? Linux works fine. |
Chris Hall (132) 3554 posts |
Some progress using a 4GB/WiFi/32GB CM4 on a Waveshare ‘IO board mini B’ (which is in stock for next day delivery from Amazon) although the compute modules themselves seem be rather rarely in stock. Fortunately I got some at the end of 2021. RISC OS 5.28 throws an error just after (about 0.5s) showing the Supervisor prompt – as shown below: but if I then type
(I have to use the name as the two USB drives enumerate seemingly at random as drives 0 and 1) it then boots into the RISC OS desktop with no errors, networking works. One start up in four, the mouse pointer shows correctly and it all appears to be working apart from being able to read the eMMc from which the board (but not the RISC OS desktop) has booted. With the error on start up there’s no point in setting the CMOS to boot from SCSI drive 1. On the RPi IO board I have done that (using a Rpi4B to set the correct CMOS setting [filesystem scsi and drive 0] and then copying the file ‘CMOS’ to the eMMc using Linux – which can see the FAT partitions and the eMMc) and it boots up fine (still can’t read the eMMc though). Test set up can be viewed here. Underneath the Waveshare IO board is a m.2 NVMe slot for fast storage. I have a drive on order and will let you know whether it works under RISC OS when it arrives next week. So far as I can see this setup is roughly what RISC OS Developments/R-Comp were talking about for a custom PCB for the CM4. |
Chris Hall (132) 3554 posts |
Further info on the USB bug on CM4: Sometimes at an early stage of start up I get abort on data transfer at FC200C2C (offset 5B6C in USB Driver RISC OS 5.28)
Then I get the error aodt at &2000447C (in RTSupport workspace)
Hope this helps. With a PCI Ex USB board fitted, and CMOS set to SCSI drive 0 boot, RISC OS boots up correctly with no error (but the major benefit of the PCI Ex for fast storage is lost). With the PCI slot empty and CMOS set to SCSI drive 0 boot, then the AODT error occurs at the Supervisor prompt and thereafter there is a ‘Filecore in use’ error. With the PCI slot empty and CMOS set to default SDFS boot (the eMMc is seen as empty) then the AODT error comes up at the supervisor prompt and a manual boot works OK. These errors do not occur if a PCI Express USB board is fitted. On the Waveshare IO board, with SDFS boot set, manual boot into SCSI after the AODT error, ignore the ‘not set up’ error, all appears to work although on 70% of start ups the mouse pointer remains invisible. So .. on 30% of the start ups all is well. So if I can find a tweak to the sources so that the error at 2000447C does not occur at start up, then that would be a major step forward. |
Chris Hall (132) 3554 posts |
Further to the above, it seems that so long as I have something plugged in to the PCI Express slot on the Rasp Pi IO board (whether a USB board or a PCI to M.2 connector with a m.2 drive in it) or something plugged in to the MVMe M.2 slot on the Waveshare IO board, the error does not come up. So RISC OS boots up with no error. Clearly RISC OS expects certain behaviour from devices it ‘knows’ to be provided on the PCI Express bus (on the Pi 4B this is the two USB 3 sockets) and throws an error when the non-fitting causes unexpected results. However RISC OS cannot read the m.2 drive – it does not show up in USBdevices and the XHCIDriver module is dormant. Doing a RMReInit XHCIDriver causes the error ‘No XHCI controllers spare’. Any suggestions please? |
RISCOSBits (3000) 143 posts |
I can confirm that, after Chris’s discovery that any old PCIe device enabled the CM4 to boot RISC OS (I thought it needed to be a PCIe device with the Pi 4’s USB 3 chipset), I have now set up a Waveshare Mini-IO-board (mine is pre the A or B models) to dual boot both RISC OS and Linux without the need for USB drives. As Chris says, the NVMe drive is invisible to RISC OS, but hey ho! Linux can see it and run nicely from it. |
Chris Hall (132) 3554 posts |
Yes, using the Lite CM4 board, RISC OS can use the SD card and Linux can use the NVMe drive so there is no need for USB drives. Fitting the NVMe drive is enough to ensure the XHCI driver remains dormant on RISC OS and does not generate errors for missing hardware. It is unfortunate that the only Lite CM4 I have is only 1GB RAM. |
Chris Hall (132) 3554 posts |
After a bit of a struggle, I now have a CM4 dual-booting from eMMc either into Linux (on the attached nvme m.2 drive) or into RISC OS (on a USB stick). The dual boot is controlled by a switch between pins 29 and 30 of the 40 pin header. The nvme image only takes up 32GB of the 500GB on the nvme drive until I work out how to make it use the whoile drive… |