djlegge
Posts: 11
Joined: Tue Jul 07, 2015 1:55 pm

13 seconds boot delay

Tue Jul 07, 2015 2:45 pm

Hi
I am just debugging a new board with the CM and have an annoying little problem I can't seem to solve.
When power is applied to the board, or RUN is allowed to go HIGH after being held at 0v, the CM seems to do nothing for 13 seconds. After that, I see 'Uncompressing Linux...' on the serial port and it boots up fine. The 13 seconds delay is also present if I issue a reboot command from Linux.

Now, if I plug the same CM into the CMIO board, it starts to boot almost instantly. Clearly, it's something about my board but I'm a bit stuck for ideas. I checked :
- rpi-buildroot and Raspian (with rpi-update today). Both behave the same.
- 2 different CM's and 2 different base boards.
- EMMC_DISABLE_N is always HIGH.

Our board has a LAN9512 and some I2C / SPI peripherals (currently not configured) and some GPIO inputs and outputs. It also has an HDMI to LVDS conversion but there is no connection to HDMI_CEC, HDMI_SCL and HDMI_SDA. We put hdmi_force_hotplug = 1 in config.txt and set the hdmi group / mode to allow for this. Is there anything else we should be doing ?

Thanks for any pointers as to where to look, or if anyone has seen this before...

Briarios
Posts: 119
Joined: Thu Feb 21, 2013 11:35 am
Location: Perth, Western Australia
Contact: Website

Re: 13 seconds boot delay

Wed Jul 08, 2015 4:30 am

do an update with rpi-update and see if that solves the issue. other than debug i am not sure what else could be a problem.
http://rpi.pmfg.me -- Test board Eagle Cad Files.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 3834
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: 13 seconds boot delay

Wed Jul 08, 2015 5:39 am

Type "sudo vcdbg log msg", then look for warning messages and long gaps in the output. If it still isn't clear, upload the log somewhere and post a link here.

djlegge
Posts: 11
Joined: Tue Jul 07, 2015 1:55 pm

Re: 13 seconds boot delay

Wed Jul 08, 2015 9:36 am

Thanks for your help. From the videocore logs it is obvious what is happening - it is trying to read the HDMI EDID, twice with 10 attempts each time. Each attempt is 500ms before it retries.
If I use :

Code: Select all

hdmi_ignore_edid=0xa5000080
or

Code: Select all

hdmi_edid_file=1
in config.txt it prevents the second block of 10 attempts which halves the delay.
On the CMIO board (with no monitor plugged in), it does the same thing but the attempts are 1ms apart rather than 500ms so the delay is negligible. I suspect this is because the CMIO board has pull-ups on HDMI_SCL / HDMI_SDA but I'll have to solder these to the legs of the 200pin connector on out board to find out...Thanks again.

EDIT : In case anyone else runs in to this, a pull-up on HDMI_SDA fixed it.

User avatar
rew
Posts: 445
Joined: Fri Aug 26, 2011 3:25 pm

Re: 13 seconds boot delay

Fri Jun 01, 2018 11:29 am

I think this can be easily fixed in the firmware: https://github.com/raspberrypi/firmware/issues/1002
(My PCB is crowded enough as it is).
Check out our raspberry pi addons: https://www.bitwizard.nl/shop/

dmh24
Posts: 6
Joined: Fri Sep 18, 2020 11:10 pm

Re: 13 seconds boot delay

Fri Sep 18, 2020 11:15 pm

Hi there, I wanted to bump this post because I am running into the same issue again, but this time on both custom board and the CMIO daughterboard.

I've added the following to /boot/config.txt

hdmi_ignore_hotplug=1
hdmi_ignore_edid=1
hdmi_edid_file=1

as well as checking vcdbg log msg for edid bank scan errors, there are none. this is on a fresh image (4.19.118-v7+) as well as latest 5.4 after updating. anyone have any ideas what changed to cause it to happen again? I have verified pullups to 5v on
HDMI_CEC
HDMI_SDA
HDMI_SDL
as well

cleverca22
Posts: 3550
Joined: Sat Aug 18, 2012 2:33 pm

Re: 13 seconds boot delay

Sat Sep 19, 2020 12:32 pm

dmh24 wrote:
Fri Sep 18, 2020 11:15 pm
Hi there, I wanted to bump this post because I am running into the same issue again, but this time on both custom board and the CMIO daughterboard.

I've added the following to /boot/config.txt

hdmi_ignore_hotplug=1
hdmi_ignore_edid=1
hdmi_edid_file=1

as well as checking vcdbg log msg for edid bank scan errors, there are none. this is on a fresh image (4.19.118-v7+) as well as latest 5.4 after updating. anyone have any ideas what changed to cause it to happen again? I have verified pullups to 5v on
HDMI_CEC
HDMI_SDA
HDMI_SDL
as well
i would start by turning on BOOT_UART (using sed, its in the official docs) and also put `uart_2ndstage=1` into config.txt, then watch the uart on gpio14/15 for activity, what is it doing during the long pause?

dmh24
Posts: 6
Joined: Fri Sep 18, 2020 11:10 pm

Re: 13 seconds boot delay

Sat Sep 19, 2020 6:14 pm

Thanks for that, that was useful info I had missed before.
I tried this on two different CM3 modules, one light and one eMMC.

Here's what prints during startup for eMMC:

Code: Select all

Raspberry Pi Bootcode
Read File: config.txt, 2137
Read File: start_cd.elf, 820188 (bytes)
Read File: fixup_cd.dat, 3159 (bytes)
That takes probably ~1 second. Once the fixup_cd.dat prints, there is a ~6 second delay with no additional prints then the usual linux boot dmesg starts.

I then tried a sdcard on a lite, and got some output during boot so its more useful, but shows same behavior:

Code: Select all

Raspberry Pi Bootcode

Read File: config.txt, 1886

Read File: start.elf, 2884708 (bytes)

Read File: fixup.dat, 6746 (bytes)

MESS:00:00:01.519818:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:01.524758:0: brfs: File read: 1886 bytes
MESS:00:00:01.557332:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:01.562238:0: gpioman: gpioman_get_pin_num: pin DISPLAY_SDA not defined
MESS:00:00:01.568421:0: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
MESS:00:00:01.585414:0: gpioman: gpioman_get_pin_num: pin BT_ON not defined
MESS:00:00:01.590682:0: gpioman: gpioman_get_pin_num: pin WL_ON not defined
MESS:00:00:01.630241:0: gpioman: gpioman_get_pin_num: pin LEDS_PWR_OK not defined
MESS:00:00:01.636057:0: *** Restart logging
MESS:00:00:01.639942:0: brfs: File read: 1886 bytes
MESS:00:00:01.645068:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
MESS:00:00:01.653310:0: hdmi: HDMI:hdmi_get_state is deprecated, use hdmi_get_display_state instead
MESS:00:00:01.663259:0: gpioman: gpioman_get_pin_num: pin CAMERA_0_SDA_PIN not defined
MESS:00:00:01.669713:0: gpioman: gpioman_get_pin_num: pin CAMERA_0_SCL_PIN not defined
MESS:00:00:01.677354:0: gpioman: gpioman_get_pin_num: pin CAMERA_0_I2C_PORT not defined
MESS:00:00:01.692467:0: brfs: File read: /mfs/sd/bcm2710-rpi-cm3.dtb
MESS:00:00:01.697129:0: Loading 'bcm2710-rpi-cm3.dtb' to 0x100 size 0x6352
MESS:00:00:01.903324:0: brfs: File read: 25426 bytes
MESS:00:00:01.910497:0: brfs: File read: /mfs/sd/config.txt
MESS:00:00:01.914949:0: dtparam: audio=on
MESS:00:00:01.947901:0: brfs: File read: 1886 bytes
MESS:00:00:01.953621:0: brfs: File read: /mfs/sd/cmdline.txt
MESS:00:00:01.957608:0: Read command line from file 'cmdline.txt':
MESS:00:00:01.963483:0: 'console=serial0,115200 console=tty1 root=PARTUUID=f1aa7a92-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait'
MESS:00:00:04.180291:0: gpioman: gpioman_get_pin_num: pin WL_ON not defined
MESS:00:00:04.200420:0: brfs: File read: 121 bytes
MESS:00:00:04.585586:0: brfs: File read: /mfs/sd/kernel7.img
MESS:00:00:04.589551:0: Loading 'kernel7.img' to 0x8000 size 0x536ac8
MESS:00:00:04.595723:0: Device tree loaded to 0x2eff9800 (size 0x6757)
MESS:00:00:04.602930:0: uart: Set PL011 baud rate to 103448.300000 Hz
MESS:00:00:04.609681:0: uart: Baud rate change done...
MESS:00:00:04.613110:0: uart: Baud rate change done...
MESS:00:00:04.618760:0: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
MESS:00:00:06.024411:0: vchiq_core: vchiq_init_state: slot_zero = 0xfad80000, is_master = 1
[    0.000000] Booting Linux on physical CPU 0x0

I did rpi-update both the eMMC and the sdcard versions before this so the difference is a little odd to me. But that aside, on the CMIO board,
USB slave boot enable is off per usual. confirmed eMMC_DISABLE_N pin is high.

All told I can probably live with ~6 second delay but it used to be noticeably faster is why im shaving this yak

cleverca22
Posts: 3550
Joined: Sat Aug 18, 2012 2:33 pm

Re: 13 seconds boot delay

Sat Sep 19, 2020 10:32 pm

dmh24 wrote:
Sat Sep 19, 2020 6:14 pm
Here's what prints during startup for eMMC:

Code: Select all

Raspberry Pi Bootcode
Read File: config.txt, 2137
Read File: start_cd.elf, 820188 (bytes)
Read File: fixup_cd.dat, 3159 (bytes)
That takes probably ~1 second. Once the fixup_cd.dat prints, there is a ~6 second delay with no additional prints then the usual linux boot dmesg starts.
that 6 second delay sounds like one of the "bad" start.elf versions, where uart_2ndstage was turned off, and you can only use `vcdbg log` after a successfull boot

dmh24 wrote:
Sat Sep 19, 2020 6:14 pm

Code: Select all

MESS:00:00:01.963483:0: 'console=serial0,115200 console=tty1 root=PARTUUID=f1aa7a92-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait'
MESS:00:00:04.180291:0: gpioman: gpioman_get_pin_num: pin WL_ON not defined
...
MESS:00:00:04.618760:0: gpioman: gpioman_get_pin_num: pin SDCARD_CONTROL_POWER not defined
MESS:00:00:06.024411:0: vchiq_core: vchiq_init_state: slot_zero = 0xfad80000, is_master = 1
[    0.000000] Booting Linux on physical CPU 0x0

and the logs with MESS in them come from start.elf, and the timestamp is relative to when RUN was released (before bootcode.bin even begins executing)
i can see a clear ~3sec and ~2sec gap in the logs, but the cause is not obvious to me
we would need an rpi engineer that knows the source to say what is happening in those times

Return to “Compute Module”