-
Notifications
You must be signed in to change notification settings - Fork 265
Update start.elf for customized Raspberry Pis #102
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
Comments
That change just told the firmware that custom boards exist and what their properties are. That information is still in the current firmware, so something else must have changed to break it. The commits page (https://github.com/raspberrypi/usbboot/commits/master) shows all the releases since f4e3f0f. There are a lot, and testing them all would take a long time. Fortunately git can help:
git chooses a point halfway between the good and bad pointers.
If it works:
otherwise:
Repeat from
|
Thank you for the detailed steps @pelwell , the first commit that breaks this is:
|
Thanks - we have some ideas of what to try first. |
Thank you, please let me know when I can test them. |
The main difference between those two commits is that Please run |
Thanks @pelwell , I've added logs from 4 cases here: https://gist.github.com/acostach/523d2ddc5f16d3a6e6d13fb4d6225a10 Indeed, I've now seen that msd.elf was renamed, the failure in d7b97b3 is most likely unrelated. Please let me know what I should test further. |
Am I right in thinking that the only visible difference between the two cases (apart from the start.elf file size) is that in the failure case the MSD devices never appear? Does your custom device have a jumper or similar to disable the EMMC/SD card access for |
@pelwell indeed, there's no msd device created in the failure case. No, the pi does not use any jumper or gpio, I just plug the micro-usb program port in the host PC, then plug in the micro-usb power and that's enough to start running usbboot. |
Which GPIO is used to re-enable the eMMC ? |
The boot ROM will always try booting from SD/EMMC before USB, so rpiboot relies on something preventing the device from accessing the local storage. For some applications, on say a Zero, removing the SD card is sufficient, but for MSD use it has to be reinserted while the image is being downloaded - the window is several seconds long so the timing isn't difficult. What is stopping the custom Pi booting from the SD/EMMC? |
To stop it from booting from the emmc it's enough to plug in the micro usb debug port to the host PC, and then power the device trough the power micro usb port. That's all. I could only find this in the custom dtblob:
Also, there's no sd-card on this type of device @pelwell |
Thanks @pelwell , I've tried fb86716 and it unfortunately it still doesn't show up as msd. The logs are the following:
After that I replaced msd/start.elf with the on known to work, did not change anything else, make clean && make:
And it worked fine, msd was mounted:
I've aslo tried the second commit c3ee230, no changes, only make clean && make:
Then I replaced again msd/start.elf with the old known to work one with MD5 735af16c0652dfdff701d5b794e85cae , no other changes, make clean && make, same commit that failed but with the old start.elf and it worked:
|
Yes - that would be helpful. |
Sure @pelwell , I checked and this is what I've observed: First commit that changes start.elf after the revision that worked is
and it is also the first msd.elf/start.elf that stopped working. So the start.elf from it and commit f4e3f0f (which works by default) the device is not put in MSD mode. However, if I put msd.elf from f4e3f0f in this commit ec9155c, the device is put in MSD mode and the only difference is that ./rpiboot never returns:
Next commit that modifies start.elf is
its start.elf doesn't work either with the known to work revision f4e3f0f. Next commit that adds changes to start.elf is:
And the start.elf from this one unfortunately doesn't work either. |
I've run out of time this week - continue using the old version for now and I'll try to get the magic patch from Mr Hollingworth. |
I've found the problem, and should be able to give you at least a trial MSD start.elf today. |
I have an updated image that appears as an MSD as before, but I'm concerned that it doesn't know about the EMMC_ENABLE pin used by your custom board. Are you currently patching the downloaded msd/start.elf to specify the custom EMMC_ENABLE pin? There's a magic byte sequence in the .elf file ( |
You can download the trial image (which you'll have to rename to |
Thank you for the trial image @pelwell. No, we're not patching any of the binaries, we're using them as they are for all boards. Hopefully this firmware could work for all boards because the device is not distinguishable by vid/pid. My test results with the binary you prepared are:
|
So there is no misunderstanding, can you explain what you mean by unpatched and patched? |
Hi @pelwell, by unpatched I mean the original start.elf you provided in g-drive, and patched is the same binary but with the original sequence
|
Thanks - that's what I would expect it to mean, but I was thrown by your comment that "we're not patching any of the binaries". As I said above, the issue with supporting custom boards is that the MSD start.elf has to know which GPIO to use as an EMMC_ENABLE. If they all use the same pin - GPIO 6 on the expander in your case - then a single patched binary can be used for all devices, otherwise you will need multiple versions and some way of ensuring you download the correct one. I can think of nicer ways to provide the EMMC_ENABLE value, but the problem of associating boards to pins isn't one I can solve for you. So, is using expander GPIO 6 as EMMC_ENABLE common to all your custom boards? |
Thanks @pelwell, this is the only type of custom board based on the Pi3 that we're dealing with, so the answer is Yes, it is common for all units of this custom device type. I don't have other custom types to check. Regarding the other boards, I was referring mostly to the CM3, trying to ensure that this change doesn't affect them. I checked a RevPi Core3 and a BalenaFIN with a 2018 CM3+ in it and they worked fine with this new patched binary. |
That's great. Although I like to make sweeping, unifying changes, the risk of breaking the corner cases outweighs any benefits in this case. The trial build I gave you can become the next release, and the software patch that made it work will be merged to our internal software repo. Make a note somewhere that any future updates from us will require the same patching process - it's not a bug fix, it's a low-tech, low-overhead communication channel from the user to the MSD application. |
Thank you very much again for your help, looking forward to test the next release when it will become available. |
See: #102 Signed-off-by: Phil Elwell <[email protected]>
It's there now. |
Implemented in the above commit. |
kernel: Add V4L2_CID_NOTIFY_GAINS control See: raspberrypi/linux#4782 kernel: Fix for cursor corruption with overscan See: raspberrypi/linux#4776 kernel: Add panel driver NWE080 and overlay for CutiePi See: raspberrypi/linux#4742 firmware: ldconfig: Discard subsequent chunks from a truncated line See: #1669 firmware: cec: Fail set_passive_mode when running with kms firmware: Firmware: Remove PWM/audio traits for CM4 firmware: usb: Fix non-BCM2711 MSD support See: raspberrypi/usbboot#102
kernel: Add V4L2_CID_NOTIFY_GAINS control See: raspberrypi/linux#4782 kernel: Fix for cursor corruption with overscan See: raspberrypi/linux#4776 kernel: Add panel driver NWE080 and overlay for CutiePi See: raspberrypi/linux#4742 firmware: ldconfig: Discard subsequent chunks from a truncated line See: raspberrypi/firmware#1669 firmware: cec: Fail set_passive_mode when running with kms firmware: Firmware: Remove PWM/audio traits for CM4 firmware: usb: Fix non-BCM2711 MSD support See: raspberrypi/usbboot#102
- firmware: ldconfig: Discard subsequent chunks from a truncated line See: #1669 - firmware: cec: Fail set_passive_mode when running with kms - firmware: Firmware: Remove PWM/audio traits for CM4 - firmware: usb: Fix non-BCM2711 MSD support See: raspberrypi/usbboot#102 - firmware: arm-loader: Fix kernel8.img selection on 2837 with arm_64bit=1 See: #1671 - firmware: improve firmware camera detection - firmware: arm_loader: Load vl805 overlay on CM4 See: https://forums.raspberrypi.com/viewtopic.php?t=326088 - firmware: gencmdserv: Add mailbox interface to gencmd - firmware: arm_loader: Only clip min/max to the same value for turbo clocks - firmware: dtoverlay: Don't mix non-fatal errors and offsets See: #1686 - firmware: platform: Limit max clock-id to CLOCK_VEC for now See: #1688 - firmware: mmal: Add mapping for IL OMX_IndexParamBrcmEnableIJGTableScaling param See: raspberrypi/linux#4669
Hi @ghollingworth , not sure if you still work with this, would it be possible to have start.elf updated to put the same customized Pis in msd mode as you've done in f4e3f0f ? I've replaced start.elf with msd.elf from your commit in the HEAD revision and it puts the device in mass storage mode, however with the current latest start.elf it doesn't work.
Thank you and please let me know if I can test some commit or branch.
The text was updated successfully, but these errors were encountered: