Skip to content

Image file will not boot #1344

@chuckb

Description

@chuckb

Describe the bug
When I build an image file with https://github.com/waldheinz/fat32-lib (version 0.6.5) using the SuperFloppyFormatter and ImageBuilder classes, and deploy to an SD using dd, my Pi will not boot. No lights, no nothing.

To reproduce
boot.img file located:
https://drive.google.com/drive/folders/1bOQQDtUStYeXudJpcb74RGdh9JHHchZ1?usp=sharing

Copy image to an SD card.
sudo dd if=boot.img of=/dev/disk2 bs=512

NOTE: Replace /dev/disk2 with location of your SD card

Mount card on a host. Add uart_2ndstage=1 to the config.txt file.

Connect a serial cable to GPIO14 and 15. Start a serial terminal. Set baud rate to 115200. Power up PiZero. Nothing is printed to the terminal. No booting is occurring.

To repro behavior in additional context below, the individual image files are also located in the provided google folder.

Expected behaviour
I can deploy my image using dd on to an SD card and the Pi will boot.

Actual behaviour
Pi does not boot as expected.

System
PiZeroW
No OS...bare metal.
Firmware version: Tried both 1.20190925 and master.
Kernel = Serial bootloader located: https://github.com/chuckb/raspbootin

Additional context
Setting the uart_2ndstage=1 produces no output in terminal. When I mount the card on my Mac, I see bootcode.bin, start.elf, config.txt, kernel.img, and fixup.dat files as expected. Further, if I md5 the files, they match my source files.

If I then copy all my source files on top of SD card image deployed files on my Mac, then the Pi will boot as expected (I am using a custom serial bootloader kernel...not Linux).

If I copy just bootcode.bin (on top of a freshly deployed image), I get

Raspberry Pi Bootcode
Read File: config.txt, 84

and 4 short green LED flashes (start.elf not found according to docs...but nevertheless appears to be there according to Mac Finder).

If I then copy start.elf, then the Pi will boot correctly. Interestingly the log notes that it can load the kernel.img (which I did not copy over).

Raspberry Pi Bootcode
Read File: config.txt, 84
Read File: start.elf, 2877988 (bytes)
MESS:00:00:01.138486:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:01.142659:0: brfs: File read: 84 bytes
MESS:00:00:01.157027:0: HDMI:EDID error reading EDID block 0 attempt 0
MESS:00:00:01.163095:0: HDMI:EDID error reading EDID block 0 attempt 1
MESS:00:00:01.169339:0: HDMI:EDID error reading EDID block 0 attempt 2
MESS:00:00:01.175589:0: HDMI:EDID error reading EDID block 0 attempt 3
MESS:00:00:01.181840:0: HDMI:EDID error reading EDID block 0 attempt 4
MESS:00:00:01.188089:0: HDMI:EDID error reading EDID block 0 attempt 5
MESS:00:00:01.194339:0: HDMI:EDID error reading EDID block 0 attempt 6
MESS:00:00:01.200589:0: HDMI:EDID error reading EDID block 0 attempt 7
MESS:00:00:01.206839:0: HDMI:EDID error reading EDID block 0 attempt 8
MESS:00:00:01.213089:0: HDMI:EDID error reading EDID block 0 attempt 9
MESS:00:00:01.219103:0: HDMI:EDID giving up on reading EDID block 0
MESS:00:00:01.224392:0: HDMI:EDID error reading EDID block 0 attempt 0
MESS:00:00:01.231579:0: HDMI:EDID error reading EDID block 0 attempt 1
MESS:00:00:01.237830:0: HDMI:EDID error reading EDID block 0 attempt 2
MESS:00:00:01.244079:0: HDMI:EDID error reading EDID block 0 attempt 3
MESS:00:00:01.250329:0: HDMI:EDID error reading EDID block 0 attempt 4
MESS:00:00:01.256579:0: HDMI:EDID error reading EDID block 0 attempt 5
MESS:00:00:01.262830:0: HDMI:EDID error reading EDID block 0 attempt 6
MESS:00:00:01.269079:0: HDMI:EDID error reading EDID block 0 attempt 7
MESS:00:00:01.275329:0: HDMI:EDID error reading EDID block 0 attempt 8
MESS:00:00:01.281580:0: HDMI:EDID error reading EDID block 0 attempt 9
MESS:00:00:01.287593:0: HDMI:EDID giving up on reading EDID block 0
MESS:00:00:01.305479:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:01.309658:0: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not define
d
MESS:00:00:01.498925:0: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not define
d
MESS:00:00:01.504739:0: *** Restart logging
MESS:00:00:01.508624:0: brfs: File read: 84 bytes
MESS:00:00:01.513449:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
MESS:00:00:01.521062:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
MESS:00:00:01.527827:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
MESS:00:00:01.534598:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
MESS:00:00:01.541369:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
MESS:00:00:01.548139:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
MESS:00:00:01.554911:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
MESS:00:00:01.561681:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
MESS:00:00:01.568452:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
MESS:00:00:01.575223:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
MESS:00:00:01.581758:0: hdmi: HDMI:EDID giving up on reading EDID block 0
MESS:00:00:01.587576:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 0
MESS:00:00:01.595275:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 1
MESS:00:00:01.602046:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 2
MESS:00:00:01.608818:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 3
MESS:00:00:01.615587:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 4
MESS:00:00:01.622358:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 5
MESS:00:00:01.629129:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 6
MESS:00:00:01.635900:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 7
MESS:00:00:01.642671:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 8
MESS:00:00:01.649442:0: hdmi: HDMI:EDID error reading EDID block 0 attempt 9
MESS:00:00:01.655976:0: hdmi: HDMI:EDID giving up on reading EDID block 0
MESS:00:00:01.661510:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_di
splay_state instead
MESS:00:00:01.670256:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_di
splay_state instead
MESS:00:00:01.680135:0: Failed to open command line file 'cmdline.txt'
MESS:00:00:01.690071:0: Failed to load Device Tree file 'bcm2708-rpi-0-w.dtb'
MESS:00:00:01.698115:0: brfs: File read: /mfs/sd/kernel.img
MESS:00:00:01.701990:0: Loading 'kernel.img' to 0x2000000 size 0x518
MESS:00:00:01.708099:0: gpioman: gpioman_get_pin_num: pin EMMC_ENABLE not define
d
MESS:00:00:01.716179:0: uart: Set PL011 baud rate to 103448.300000 Hz
MESS:00:00:01.722989:0: uart: Baud rate change done...
MESS:00:00:01.726418:0: uart: Baud rate change done...
MESS:00:00:01.731934:0: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER|
Raspbootin V2
#############
Built for: Raspberry Pi
#############

It appears to me that FAT file handling is different between loading bootcode.bin, within bootcode.bin, and then works further differently within start.elf (given that it can find kernel.img without an over copy).

I suspect that my FAT library and the FAT handling contained within the firmware have some compatibility issues. But my Mac has no problem mounting, reading/finding the files after image is deployed to the card with dd. I can also run a file system check after deploying the image and it reports no errors.

I am willing to troubleshoot the FAT library, but it would be great if I can get some more diagnostics from the firmware as to why it is having trouble reading the files. Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions