Johannes15
Posts: 8
Joined: Fri Jun 18, 2021 9:00 am

CM4 - Boot process is slow

Fri Jun 18, 2021 9:21 am

Hi,

I use the CM4 module with a custom board. I noticed that the boot process is very slow.

I have then output the boot messages via UART. I noticed that there is no activity for about 20 seconds. The corresponding log looks like the following:



10:47:48.354869 - '\x00'
10:47:48.356966 - 'PM_RSTS: 0x00001000'
10:47:48.371459 - 'RPi: BOOTLOADER release VERSION:c2f8c388 DATE: Apr 29 2021 TIME: 17:11:29 BOOTMODE: 0x00000006 part: 0 BUILD_TIMESTAMP=1619712685 0x7e31ffb7 0x00b03140 0x000b359e'
10:47:48.373424 - 'PM_RSTS: 0x00001000'
10:47:48.375771 - 'part 00000000 reset00'
10:47:48.378792 - 'uSD voltage 3.3V'
10:47:48.378999 - ''
10:47:48.397382 - "Initialising SDRAM 'Samsung' 16Gb x1 total-size: 16 Gbit 3200"
10:47:48.397561 - ''
10:47:49.261848 - ''
10:47:49.263360 - 'PCI reset'
10:47:49.263524 - ''
10:47:49.287377 - 'XHCI-STOP'
10:47:49.287642 - ''
10:47:49.296380 - 'xHC ver: 256 HCS: 08000820 24000011 00000000 HCC: 014050cf'
10:47:49.296573 - ''
10:47:50.297796 - ''
10:47:51.299099 - ''
10:47:52.300407 - ''
10:47:53.301718 - ''
10:47:54.301823 - ''
10:47:54.304971 - 'USB xHC init failed'
10:47:54.305214 - ''
10:47:54.307875 - 'Boot mode: SD (01) order 0'
10:47:54.308044 - ''
10:47:54.326421 - 'SD HOST: 250000000 CTL0: 0x00000000 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080'
10:47:54.326607 - ''
10:47:54.342103 - 'SD HOST: 250000000 CTL0: 0x00000f00 BUS: 100000 Hz actual: 100000 HZ div: 2500 (1250) status: 0x1fff0000 delay: 1080'
10:47:54.342296 - ''
10:47:54.483183 - ''
10:47:54.488929 - 'CID: 00035344535333324780d9e5308d0149'
10:47:54.489074 - ''
10:47:54.492280 - 'CSD: 400e00325b590000edc87f800a404000'
10:47:54.492419 - ''
10:47:54.499083 - 'SD: bus-width: 4 spec: 2 SCR: 0x02358043 0x00000000'
10:47:54.499257 - ''
10:47:54.514279 - 'SD HOST: 250000000 CTL0: 0x00000f04 BUS: 50000000 Hz actual: 41666666 HZ div: 6 (3) status: 0x1fff0000 delay: 2'
10:47:54.514447 - ''
10:47:54.516993 - 'MBR: 0x00002000, 142310 type: 0x0c'
10:47:54.517138 - ''
10:47:54.519630 - 'MBR: 0x00026000, 4194304 type: 0x83'
10:47:54.519782 - ''
10:47:54.522239 - 'MBR: 0x00426000, 2097152 type: 0x83'
10:47:54.522378 - ''
10:47:54.524832 - 'MBR: 0x00627ffe, 4202498 type: 0x0f'
10:47:54.524969 - ''
10:47:54.526418 - 'Trying partition: 0'
10:47:54.526569 - ''
10:47:54.532028 - "lba: 8192 oem: 'mkfs.fat' volume: ' V ^ '"
10:47:54.532251 - ''
10:47:54.537820 - 'rsc 4 fat-sectors 140 c-count 35498 c-size 4 r-dir 1 r-sec 32'
10:47:54.538013 - ''
10:47:54.539338 - 'PM_RSTS: 0x00001000'
10:47:54.539479 - ''
10:47:54.540722 - 'Trying partition: 0'
10:47:54.540845 - ''
10:47:54.544770 - "lba: 8192 oem: 'mkfs.fat' volume: ' V ^ '"
10:47:54.544915 - ''
10:47:54.551329 - 'rsc 4 fat-sectors 140 c-count 35498 c-size 4 r-dir 1 r-sec 32'
10:47:54.551513 - ''
10:47:54.563407 - 'Read config.txt bytes 36478 hnd 0x00000068 '
10:47:54.563547 - ''
10:47:55.158170 - 'Read start4.elf bytes 2231744 hnd 0x000032b0 '
10:47:55.158393 - ''
10:47:55.164781 - 'Read fixup4.dat bytes 5444 hnd 0x0000007e '
10:47:55.164986 - ''
10:47:55.622373 - 'Firmware: a48d332c35ee1c1c1ab433228e23317f62dcc5fb Apr 21 2021 15:47:51'
10:47:55.622603 - ''
10:47:55.625726 - '0x00b03140 0x00000000 0x000003ff'
10:47:55.625938 - ''
10:47:55.628912 - 'MEM GPU: 76 ARM: 948 TOTAL: 1024'
10:47:55.629098 - ''
10:47:55.730323 - 'Starting start4.elf @ 0xfec00200 partition 0'
10:47:55.730518 - ''
10:47:55.977701 - 'PCI reset'
10:47:55.977928 - ''
10:47:55.979169 - 'Stop display'
10:47:55.979354 - ''
10:47:56.018992 - 'Display stopped'
10:47:56.019203 - ''
10:47:56.019479 - '+'
10:47:56.019662 - ''
10:47:56.019842 - ''
10:47:57.021064 - ''
10:47:58.022370 - ''
10:47:59.023685 - ''
10:48:00.025046 - ''
10:48:01.026393 - ''
10:48:02.027766 - ''
10:48:03.029070 - ''
10:48:04.030341 - ''
10:48:05.031614 - ''
10:48:06.032921 - ''
10:48:07.034224 - ''
10:48:08.035526 - ''
10:48:09.036840 - ''
10:48:10.038154 - ''
10:48:11.039441 - ''
10:48:12.040753 - ''
10:48:13.042055 - ''
10:48:14.043356 - ''
10:48:15.044671 - ''
10:48:16.045981 - ''
10:48:17.047287 - ''
10:48:18.047981 - ''


--> 20 SECONDS NOTHING THAN THE LINUX STARTS BOOTING <--

10:48:18.477404 - ''
10:48:18.507455 - '[ 0.000000] Linux version 5.10.31-v8 (oe-user@oe-host) (aarch64-poky-linux-gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36.1.20210209) #1 SMP PREEMPT Fri Apr 23 15:16:49 UTC 2021'
10:48:18.507664 - ''
10:48:18.512880 - '[ 0.000000] Machine model: Raspberry Pi Compute Module 4 Rev 1.0'
10:48:18.513046 - ''
10:48:18.515903 - '[ 0.000000] efi: UEFI not found.'
10:48:18.516069 - ''
10:48:18.523109 - '[ 0.000000] Reserved memory: created CMA memory pool at 0x000000001ec00000, size 256 MiB'
10:48:18.523317 - ''
10:48:18.530975 - '[ 0.000000] OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool'
10:48:18.531174 - ''
10:48:18.534151 - '[ 0.000000] Zone ranges:'
10:48:18.534337 - ''
10:48:18.539868 - '[ 0.000000] DMA [mem 0x0000000000000000-0x000000003fffffff]'
10:48:18.540063 - ''
10:48:18.545869 - '[ 0.000000] DMA32 [mem 0x0000000040000000-0x000000007fffffff]'
10:48:18.546062 - ''
10:48:18.548905 - '[ 0.000000] Normal empty'
10:48:18.549099 - ''
10:48:18.553336 - '[ 0.000000] Movable zone start for each node'




The CM4 module uses the latest firmware from 29.04.2021.

Can someone help me and tell me why nothing happens after "Display stopped" for 20 seconds?

Thanks for your help

Johannes

aBUGSworstnightmare
Posts: 3152
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM4 - Boot process is slow

Fri Jun 18, 2021 11:50 am

Do you have a monitor connected?
CM3 was booting slow ehen there were no pull-ups on the HDMI I2C bus.

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 871
Joined: Thu Jun 21, 2018 4:30 pm

Re: CM4 - Boot process is slow

Fri Jun 18, 2021 2:20 pm

Adding uart_2ndstage=1 to config.txt would reveal what start.elf is doing.

https://www.raspberrypi.org/documentati ... xt/boot.md

Johannes15
Posts: 8
Joined: Fri Jun 18, 2021 9:00 am

Re: CM4 - Boot process is slow

Wed Jun 23, 2021 5:11 am

aBUGSworstnightmare wrote: Do you have a monitor connected?
CM3 was booting slow ehen there were no pull-ups on the HDMI I2C bus.
Yes i have a Monitor connected. But it is connected via a onboard HDMI switch that switches the source active after my CM4 is booted.
Is ther a possibility to ignore the HDMI i2C bus or something?

timg236 wrote: Adding uart_2ndstage=1 to config.txt would reveal what start.elf is doing.

https://www.raspberrypi.org/documentati ... xt/boot.md
Thanks for this advice, I will try it.

User avatar
Gavinmc42
Posts: 5817
Joined: Wed Aug 28, 2013 3:31 am

Re: CM4 - Boot process is slow

Wed Jun 23, 2021 5:54 am

What is the boot order?
It could be looking for a USB drive via a USB3 chip on PCIe/xHCI?
I think 20secs was the timeout.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

aBUGSworstnightmare
Posts: 3152
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM4 - Boot process is slow

Wed Jun 23, 2021 6:02 am

Johannes15 wrote:
Wed Jun 23, 2021 5:11 am
aBUGSworstnightmare wrote: Do you have a monitor connected?
CM3 was booting slow ehen there were no pull-ups on the HDMI I2C bus.
Yes i have a Monitor connected. But it is connected via a onboard HDMI switch that switches the source active after my CM4 is booted.
Is ther a possibility to ignore the HDMI i2C bus or something?
how do you determine the correct resolution then? What type of switch do you use and how does the schematic look like?

Johannes15
Posts: 8
Joined: Fri Jun 18, 2021 9:00 am

Re: CM4 - Boot process is slow

Wed Jun 23, 2021 6:34 am

Gavinmc42 wrote: What is the boot order?
It could be looking for a USB drive via a USB3 chip on PCIe/xHCI?
I think 20secs was the timeout.

I had the same idea, but than I set the Boot Order to 0xf1 --> It should only looking for SD-card but still the same result (slow boot time)

Johannes15
Posts: 8
Joined: Fri Jun 18, 2021 9:00 am

Re: CM4 - Boot process is slow

Wed Jun 23, 2021 6:40 am

aBUGSworstnightmare wrote: how do you determine the correct resolution then? What type of switch do you use and how does the schematic look like?
In my boot.config I added hdmi_safe=1 so I think the hdmi_mode 4 is used.
The HDMI switch is from Texas Instruments TMDS351

aBUGSworstnightmare
Posts: 3152
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM4 - Boot process is slow

Wed Jun 23, 2021 3:34 pm

Johannes15 wrote:
Wed Jun 23, 2021 6:40 am
aBUGSworstnightmare wrote: how do you determine the correct resolution then? What type of switch do you use and how does the schematic look like?
In my boot.config I added hdmi_safe=1 so I think the hdmi_mode 4 is used.
The HDMI switch is from Texas Instruments TMDS351
o.k. Had a look at the switch spec https://www.ti.com/lit/ds/symlink/tmds3 ... 52FTMDS351; doesn't look like rocket science.

Questions:
- where in the HDMI chain is your RPI and what is the HDMI sink (real monitor or something special)?
- all HDMI I2C busses have their pull-ups in place?
- post your config.txt

Johannes15
Posts: 8
Joined: Fri Jun 18, 2021 9:00 am

Re: CM4 - Boot process is slow

Thu Jul 01, 2021 9:38 am

aBUGSworstnightmare wrote:
o.k. Had a look at the switch spec https://www.ti.com/lit/ds/symlink/tmds3 ... 52FTMDS351; doesn't look like rocket science.

Questions:
- where in the HDMI chain is your RPI and what is the HDMI sink (real monitor or something special)?
- all HDMI I2C busses have their pull-ups in place?
- post your config.txt

I used different monitors e.g. Dell monitor/Samsung TV or Canvys monitor. My RPI is connected via HDMI0 to the first HDMI input (0) of the switch.
There is a pull-up at the HDMI_OUT of the switch.

Here is my config.txt

Code: Select all

#HDMI
hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
config_hdmi_boost=4
hdmi_group=2
hdmi_mode=39

#I2C & SPI
dtoverlay=vc4-kms-v3d
dtparam=i2c_arm=on
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi,addr=0x51
dtparam=spi=on
dtoverlay=dwc2,dr_mode=peripheral
dtoverlay=mcp251xfd,spi0-0,oscillator=20000000,interrupt=25

aBUGSworstnightmare
Posts: 3152
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM4 - Boot process is slow

Thu Jul 01, 2021 12:45 pm

Johannes15 wrote:
Thu Jul 01, 2021 9:38 am
aBUGSworstnightmare wrote:
o.k. Had a look at the switch spec https://www.ti.com/lit/ds/symlink/tmds3 ... 52FTMDS351; doesn't look like rocket science.

Questions:
- where in the HDMI chain is your RPI and what is the HDMI sink (real monitor or something special)?
- all HDMI I2C busses have their pull-ups in place?
- post your config.txt

I used different monitors e.g. Dell monitor/Samsung TV or Canvys monitor. My RPI is connected via HDMI0 to the first HDMI input (0) of the switch.
There is a pull-up at the HDMI_OUT of the switch.

Here is my config.txt

Code: Select all

#HDMI
hdmi_force_hotplug=1
hdmi_ignore_edid=0xa5000080
config_hdmi_boost=4
hdmi_group=2
hdmi_mode=39

#I2C & SPI
dtoverlay=vc4-kms-v3d
dtparam=i2c_arm=on
dtoverlay=i2c-rtc,pcf85063a,i2c_csi_dsi,addr=0x51
dtparam=spi=on
dtoverlay=dwc2,dr_mode=peripheral
dtoverlay=mcp251xfd,spi0-0,oscillator=20000000,interrupt=25
config_hdmi_boost=4 has no effect on an Rpi4 yet
The Raspberry Pi 4B does not yet support config_hdmi_boost, support for this option will be added in a future software update.
sorry, but you did not provide answer to my question how HDMI signals are connected to the switch. Do you have the pull-ups on the HDMI I2C in place or not? Can you post that part of your schematic?

Johannes15
Posts: 8
Joined: Fri Jun 18, 2021 9:00 am

Re: CM4 - Boot process is slow

Thu Jul 01, 2021 1:01 pm

Thanks for that hint.

Here is the schematic:

https://1drv.ms/u/s!Aky62OHDJMfIhMEvFww ... w?e=jWgp05

S1, S2, HPD_SINK and EQ are connected to GPIO 17, 18, 26 and 27.


Thanks for your help!

aBUGSworstnightmare
Posts: 3152
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM4 - Boot process is slow

Thu Jul 01, 2021 1:21 pm

Johannes15 wrote:
Thu Jul 01, 2021 1:01 pm
Thanks for that hint.

Here is the schematic:

https://1drv.ms/u/s!Aky62OHDJMfIhMEvFww ... w?e=jWgp05

S1, S2, HPD_SINK and EQ are connected to GPIO 17, 18, 26 and 27.


Thanks for your help!
sorry, but I can't see if there are pull-ups for HDMI0-SDA. There is R33 connected to HDMI0-SCL which is 47k5 --> way to big for an I2C pull-up

Johannes15
Posts: 8
Joined: Fri Jun 18, 2021 9:00 am

Re: CM4 - Boot process is slow

Thu Jul 01, 2021 1:34 pm

Yes you'r right because there is no pull-up for HDMI0_SDA.
Can that cause the 20 seconds "doing nothing"?

aBUGSworstnightmare
Posts: 3152
Joined: Tue Jun 30, 2015 1:35 pm

Re: CM4 - Boot process is slow

Thu Jul 01, 2021 1:43 pm

Johannes15 wrote:
Thu Jul 01, 2021 1:34 pm
Yes you'r right because there is no pull-up for HDMI0_SDA.
Can that cause the 20 seconds "doing nothing"?
add suitable pull-ups and see if it makes a difference. On CM3 it did.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11459
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM4 - Boot process is slow

Thu Jul 01, 2021 1:44 pm

Johannes15 wrote:
Thu Jul 01, 2021 1:34 pm
Yes you'r right because there is no pull-up for HDMI0_SDA.
Can that cause the 20 seconds "doing nothing"?
If something were pulling the I2C SCL lines down then the host interprets it as clock stretching up to a timeout limit on each and every transfer.

https://datasheets.raspberrypi.org/cm4/ ... asheet.pdf
2.6. Dual HDMI 2.0
...
Basic onboard ESD protection is provided for the I2C EDID signals and the CEC signals, internal pullup and down resistors are also provided. On the {rpi4} the HDMI signals don’t have any extra ESD protection , depending on the application extra ESD protection maybe required
So as long as your switch isn't pulling SCL down, you should be fine.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11459
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: CM4 - Boot process is slow

Thu Jul 01, 2021 1:59 pm

Looking at your schematic, you're deviating from the recommendation for the DDC lines.
Page 17
DDC Channels
The DDC circuits (SDA,SCL) are powered by a 5-V supply. The I/O pins can connect to the 5-V termination voltages directly.
A 47-kΩ pull-up resistor to the 5 V is recommended on the SCL1, SCL2, and SCL3 pins. There is no pull-up resistor on the SDA pins.The pull-up resistor can be replaced with a different value.
You have a 47k pull up on SCL_SINK (and SDA_SINK) to 3.3V, not 5V. Nothing on SCL1, 2, or 3.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Johannes15
Posts: 8
Joined: Fri Jun 18, 2021 9:00 am

Re: CM4 - Boot process is slow

Wed Jul 07, 2021 11:27 am

Thanks for your help. I will try it and come back with the result.

Return to “Compute Module”