Skip to contentSkip to conversation

u-boot 2022-07 on STM32F746G-DISCO

DISCUSSION Waldemar Brodkorb 3 participants 14 messages Sep 19, 2022 – Sep 20, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

I use following openocd command to flash the output of the build:

openocd \
        -f interface/stlink.cfg -f board/stm32f7discovery.cfg \
        -c "init" \
        -c "reset init" \
        -c "flash probe 0" \
        -c "flash info 0" \
        -c "flash write_image erase u-boot-spl.bin 0x08000000" \
        -c "flash write_image erase u-boot-dtb.bin 0x08008000" \
        -c "reset run" \
        -c "shutdown"

The output looks like:
Open On-Chip Debugger 0.11.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Warn : Interface already configured, ignoring
Error: already specified hl_layout stlink
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD Info : clock speed 2000 kHz
Info : STLINK V2J25M14 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.240633
Warn : Silicon bug: single stepping may enter pending exception handler!
Info : stm32f7x.cpu: hardware has 8 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f7x.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x080003fc msp: 0x20050000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Info : device id = 0x10016449
Info : flash size = 1024 kbytes
flash 'stm32f2x' found at 0x08000000

#0 : stm32f2x at 0x08000000, size 0x00100000, buswidth 0, chipwidth 0

	#  0: 0x00000000 (0x8000 32kB) not protected
	#  1: 0x00008000 (0x8000 32kB) not protected
	#  2: 0x00010000 (0x8000 32kB) not protected
	#  3: 0x00018000 (0x8000 32kB) not protected
	#  4: 0x00020000 (0x20000 128kB) not protected
	#  5: 0x00040000 (0x40000 256kB) not protected
	#  6: 0x00080000 (0x40000 256kB) not protected
	#  7: 0x000c0000 (0x40000 256kB) not protected

STM32F7[4|5]x - Rev: Z

auto erase enabled
wrote 32768 bytes from file u-boot-spl.bin in 0.802971s (39.852 KiB/s)

auto erase enabled
wrote 491520 bytes from file u-boot-dtb.bin in 8.638284s (55.567 KiB/s)

Info : Unable to match requested speed 2000 kHz, using 1800 kHz Info : Unable to match requested speed 2000 kHz, using 1800 kHz shutdown command invoked

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

Is ttyACM0 the wrong device to get u-boots serial output?
I have only one USB cable connected between USB ST-Link and my laptop.

What I am doing wrong?

best regards
Waldemar

#1 lore raw

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Seems like a regression to me.

best regards
Waldemar

#2 lore raw

Hi Waldemar

Quoted 59 lines · Waldemar Brodkorb

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Quoted 4 lines

Seems like a regression to me.

best regards
Waldemar

There are several issues with SPL with STM32F7 based boards. I am currently working on it.
A series will be submitted very soon ;-)

Patrice

#3 lore raw
In reply to Waldemar Brodkorb

I forgot to mention that information can be directly found in doc/board/st/stm32_MCU.rst

Patrice

Quoted 63 lines · Waldemar Brodkorb

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Seems like a regression to me.

best regards
Waldemar

#4 lore raw
In reply to Waldemar Brodkorb

Hi Waldemar

Quoted 59 lines · Waldemar Brodkorb

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Quoted 4 lines

Seems like a regression to me.

best regards
Waldemar

There are several issues with SPL with STM32F7 based boards. I am currently working on it.
A series will be submitted very soon

Patrice

#5 lore raw

Waldemar,

You can applied the following series on current U-Boot master branch (a0759684e015bd7252be3af508c0fcfdbb8ec5dc):

https://patchwork.ozlabs.org/project/uboot/list/?series=318991

Thanks
Patrice

Quoted 72 lines · Patrice CHOTARD

Hi Waldemar

Quoted 59 lines · Waldemar Brodkorb

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Quoted 4 lines

Seems like a regression to me.

best regards
Waldemar

There are several issues with SPL with STM32F7 based boards. I am currently working on it.
A series will be submitted very soon

Patrice

#6 lore raw

Hi Patrice,
Patrice CHOTARD wrote,

Quoted 7 lines

Waldemar,

You can applied the following series on current U-Boot master branch (a0759684e015bd7252be3af508c0fcfdbb8ec5dc):

https://patchwork.ozlabs.org/project/uboot/list/?series=318991

I applied the patches on top of u-boot master and the non-SPL build still works fine. It seems only 2022.07 is broken, master is fine.

The SPL build compiles, but I get no output via serial console after flashing. I changed the openocd command to use 0x8009000 for u-boot.

/home/wbx/openadk/host_x86_64-linux-gnu/usr/bin/openocd \
        -f interface/stlink.cfg -f board/stm32f7discovery.cfg \
        -c "init" \
        -c "reset init" \
        -c "flash probe 0" \
        -c "flash info 0" \
        -c "flash write_image erase spl/u-boot-spl.bin 0x08000000" \
        -c "flash write_image erase u-boot-dtb.bin 0x08009000" \
        -c "reset run" \
        -c "shutdown"

Is this change correct or do I misread your patches?

BTW: Do you have a working Linux configuration file you can share with me? Which Linux version do you use on the device?

best regards
Waldemar

#7 lore raw

Hi Waldemar

Quoted 28 lines · Waldemar Brodkorb

Hi Patrice,
Patrice CHOTARD wrote,

Quoted 7 lines

Waldemar,

You can applied the following series on current U-Boot master branch (a0759684e015bd7252be3af508c0fcfdbb8ec5dc):

https://patchwork.ozlabs.org/project/uboot/list/?series=318991

I applied the patches on top of u-boot master and the non-SPL build still works fine. It seems only 2022.07 is broken, master is fine.

The SPL build compiles, but I get no output via serial console after flashing. I changed the openocd command to use 0x8009000 for u-boot.

/home/wbx/openadk/host_x86_64-linux-gnu/usr/bin/openocd \
        -f interface/stlink.cfg -f board/stm32f7discovery.cfg \
        -c "init" \
        -c "reset init" \
        -c "flash probe 0" \
        -c "flash info 0" \
        -c "flash write_image erase spl/u-boot-spl.bin 0x08000000" \
        -c "flash write_image erase u-boot-dtb.bin 0x08009000" \
        -c "reset run" \
        -c "shutdown"
Quoted 1 line

Is this change correct or do I misread your patches?

Due to the flash layout (the 4 first sectors size is 32KB) using "flash write_image erase" command, as you did, can't be used anymore due to the SPL size increase.

SPL size is over 32KB (0x8000), so SPL binary occupies the first and a part of the second 32KB sectors.

When you execute "flash write_image erase u-boot-dtb.bin 0x08009000", this command erase the second 32KB sector (where a part of SPL has been previously copied) before copying the u-boot-dtb.bin binary.

So i advice you to use the method described in doc/board/st/stm32_MCU.rst Copy directly the generated binary u-boot-with-spl.bin into the mass-storage exposed by the board.

Example, under Ubuntu you should see the following directory /media/$USER/DIS_F746NG

Quoted 3 lines

BTW: Do you have a working Linux configuration file you can share with me? Which Linux version do you use on the device?

Yes, i have tested the kernel v6.0-rc4 on STM32F746-disco board recently. Before you have to apply the attached patch.

Patrice

Quoted 3 lines

best regards
Waldemar

arch/arm/configs/stm32_defconfig +2 -4
index 1f5446cda8b6..e1f86bd1eed4 100644
@@ -17,12 +17,10 @@ CONFIG_EMBEDDED=y
 CONFIG_ARCH_STM32=y
 CONFIG_CPU_V7M_NUM_IRQ=240
 CONFIG_SET_MEM_PARAM=y
-CONFIG_DRAM_BASE=0x90000000
-CONFIG_FLASH_MEM_BASE=0x08000000
+CONFIG_DRAM_BASE=0xC0000000
+CONFIG_DRAM_SIZE=0x01000000
 CONFIG_FLASH_SIZE=0x00200000
 # CONFIG_ATAGS is not set
-CONFIG_XIP_KERNEL=y
-CONFIG_XIP_PHYS_ADDR=0x08008000
 CONFIG_BINFMT_FLAT=y
 # CONFIG_COREDUMP is not set
 # CONFIG_VM_EVENT_COUNTERS is not set
#8 lore raw

Hi Patrice,
Patrice CHOTARD wrote,

Quoted 44 lines

Hi Waldemar

Quoted 28 lines · Waldemar Brodkorb

Hi Patrice,
Patrice CHOTARD wrote,

Quoted 7 lines

Waldemar,

You can applied the following series on current U-Boot master branch (a0759684e015bd7252be3af508c0fcfdbb8ec5dc):

https://patchwork.ozlabs.org/project/uboot/list/?series=318991

I applied the patches on top of u-boot master and the non-SPL build still works fine. It seems only 2022.07 is broken, master is fine.

The SPL build compiles, but I get no output via serial console after flashing. I changed the openocd command to use 0x8009000 for u-boot.

/home/wbx/openadk/host_x86_64-linux-gnu/usr/bin/openocd \
        -f interface/stlink.cfg -f board/stm32f7discovery.cfg \
        -c "init" \
        -c "reset init" \
        -c "flash probe 0" \
        -c "flash info 0" \
        -c "flash write_image erase spl/u-boot-spl.bin 0x08000000" \
        -c "flash write_image erase u-boot-dtb.bin 0x08009000" \
        -c "reset run" \
        -c "shutdown"
Quoted 1 line

Is this change correct or do I misread your patches?

Due to the flash layout (the 4 first sectors size is 32KB) using "flash write_image erase" command, as you did, can't be used anymore due to the SPL size increase.

SPL size is over 32KB (0x8000), so SPL binary occupies the first and a part of the second 32KB sectors.

When you execute "flash write_image erase u-boot-dtb.bin 0x08009000", this command erase the second 32KB sector (where a part of SPL has been previously copied) before copying the u-boot-dtb.bin binary.

Quoted 5 lines

So i advice you to use the method described in doc/board/st/stm32_MCU.rst Copy directly the generated binary u-boot-with-spl.bin into the mass-storage exposed by the board.

Example, under Ubuntu you should see the following directory /media/$USER/DIS_F746NG

When I copy u-boot-with-spl.bin to the mass-storage device I get following output on the serial console:
U-Boot SPL 2022.10-rc5-00009-g41530b5b3e (Sep 20 2022 - 12:37:40 +0200)
Trying to boot from XIP
fdt_root: FDT_ERR_BADMAGIC
Hard fault

pc : 08009000    lr : 0800070b    xPSR : 41000000

r12 : 2004f108 r3 : 40011000 r2 : 080c0000
r1 : ffffffff r0 : 00000000
Resetting CPU ...

resetting ...

How is it supposed to work to start the full u-boot-dtb.bin and u-boot-with-spl.bin? When I copy both files I get no output, it seems this is not supported, right?

Maybe I should stick with the normal non-SPL boot, I see no advantage to have the SPL boot. What is the advantage of the SPL build?

best regards
Waldemar

#9 lore raw

Hi Waldemar

Quoted 65 lines · Waldemar Brodkorb

Hi Patrice,
Patrice CHOTARD wrote,

Quoted 44 lines

Hi Waldemar

Quoted 28 lines · Waldemar Brodkorb

Hi Patrice,
Patrice CHOTARD wrote,

Quoted 7 lines

Waldemar,

You can applied the following series on current U-Boot master branch (a0759684e015bd7252be3af508c0fcfdbb8ec5dc):

https://patchwork.ozlabs.org/project/uboot/list/?series=318991

I applied the patches on top of u-boot master and the non-SPL build still works fine. It seems only 2022.07 is broken, master is fine.

The SPL build compiles, but I get no output via serial console after flashing. I changed the openocd command to use 0x8009000 for u-boot.

/home/wbx/openadk/host_x86_64-linux-gnu/usr/bin/openocd \
        -f interface/stlink.cfg -f board/stm32f7discovery.cfg \
        -c "init" \
        -c "reset init" \
        -c "flash probe 0" \
        -c "flash info 0" \
        -c "flash write_image erase spl/u-boot-spl.bin 0x08000000" \
        -c "flash write_image erase u-boot-dtb.bin 0x08009000" \
        -c "reset run" \
        -c "shutdown"
Quoted 1 line

Is this change correct or do I misread your patches?

Due to the flash layout (the 4 first sectors size is 32KB) using "flash write_image erase" command, as you did, can't be used anymore due to the SPL size increase.

SPL size is over 32KB (0x8000), so SPL binary occupies the first and a part of the second 32KB sectors.

When you execute "flash write_image erase u-boot-dtb.bin 0x08009000", this command erase the second 32KB sector (where a part of SPL has been previously copied) before copying the u-boot-dtb.bin binary.

Quoted 5 lines

So i advice you to use the method described in doc/board/st/stm32_MCU.rst Copy directly the generated binary u-boot-with-spl.bin into the mass-storage exposed by the board.

Example, under Ubuntu you should see the following directory /media/$USER/DIS_F746NG

When I copy u-boot-with-spl.bin to the mass-storage device I get following output on the serial console:
U-Boot SPL 2022.10-rc5-00009-g41530b5b3e (Sep 20 2022 - 12:37:40 +0200)
Trying to boot from XIP
fdt_root: FDT_ERR_BADMAGIC
Hard fault

pc : 08009000    lr : 0800070b    xPSR : 41000000

r12 : 2004f108 r3 : 40011000 r2 : 080c0000
r1 : ffffffff r0 : 00000000
Resetting CPU ...

Quoted 5 lines

resetting ...

How is it supposed to work to start the full u-boot-dtb.bin and u-boot-with-spl.bin? When I copy both files I get no output, it seems this is not supported, right?

u-boot-with-spl.bin is the concatenation of 2 binaries:
u-boot-with-spl.bin = u-boot-spl.bin + u-boot.bin

You should only copy u-boot-with-spl.bin in the board mass-storage.

At the end of u-boot-spl.bin binary, some padding is added to make sure that u-boot.bin will be located at the expected offset, in our case offset
0x9000 (see CONFIG_SPL_PAD_TO 0x9000 in stm32f746-disco-spl_defconfig)

So u-boot-spl.bin is first executed, located at offset 0 (0x08000000), then jump in u-boot.bin located at offset 0x9000 (0x08009000).

it's weird because everything looks correct in your log, pc is set with 0x08009000 but i can't understand why u-boot.bin is not executed in your
case ....

Quoted 4 lines

Maybe I should stick with the normal non-SPL boot, I see no advantage to have the SPL boot. What is the advantage of the SPL build?

At the very beginning of stm32f746-disco support, Vikas Manocha introduces SPL mode to use falcon mode (see doc/README.falcon)
With this mode you can jump directly in kernel after U-Boot SPL execution :
U-Boot SPL -> Kernel (previously flashed at offset 0x9000 and configured in XIP)

If during boot, you maintain the "c" key pressed, the SPL flow will be:
U-Boot SPL -> U-Boot (located in flash) -> Kernel (located in SD-card)

Have you try with stm32f746_disco_defconfig ? in this case, you have to copy u-boot.bin binary in board mass-storage.

Patrice

Quoted 3 lines

best regards
Waldemar

#10 lore raw
In reply to Waldemar Brodkorb

Hi Waldemar,

Quoted 60 lines · Waldemar Brodkorb

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Quoted 1 line

Seems like a regression to me.

Yes, can you use git bisect to find it?

Regards,
Simon

#11 lore raw

Hi Simon,
Simon Glass wrote,

Quoted 63 lines

Hi Waldemar,

Quoted 60 lines · Waldemar Brodkorb

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Quoted 3 lines
Quoted 1 line

Seems like a regression to me.

Yes, can you use git bisect to find it?

cd82f199852d88218e1f17f5ec07cdd9112a89c4 is the first bad commit.

When I revert this commit on master I get:
U-Boot SPL 2022.10-rc5-00001-gdbcc7add19-dirty (Sep 20 2022 - 00:59:21 +0200)
Trying to boot from XIP

U-Boot 2022.10-rc5-00001-gdbcc7add19-dirty (Sep 20 2022 - 00:59:21 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB

stm32fx_rcc_clock rcc@40023800: set_rate not implemented for clock index 4
stm32fx_rcc_clock rcc@40023800: set_rate not implemented for clock index 4
stm32fx_rcc_clock rcc@40023800: set_rate not implemented for clock index 4

Core:  38 devices, 22 uclasses, devicetree: separate
Flash: 1 MiB
MMC:   sdio1@40012c00: 0
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - 7e:cf:cf:fc:30:4a
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
MMC: no card present

looks good without the problematic commit.

best regards
Waldemar

#12 lore raw

Hi Waldemar

Quoted 66 lines · Waldemar Brodkorb

Hi Simon,
Simon Glass wrote,

Quoted 63 lines

Hi Waldemar,

Quoted 60 lines · Waldemar Brodkorb

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

Seems like a regression to me.

Yes, can you use git bisect to find it?

cd82f199852d88218e1f17f5ec07cdd9112a89c4 is the first bad commit.

I remember i encountered an issue with patch in the past and by updating my toolchain everything goes fine.

Which toolchain version do you use ?

On my side i am using this one :
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.1.0/x86_64-gcc-11.1.0-nolibc-arm-linux-gnueabi.tar.xz

Patrice

Quoted 37 lines

When I revert this commit on master I get:
U-Boot SPL 2022.10-rc5-00001-gdbcc7add19-dirty (Sep 20 2022 - 00:59:21 +0200)
Trying to boot from XIP

U-Boot 2022.10-rc5-00001-gdbcc7add19-dirty (Sep 20 2022 - 00:59:21 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB

stm32fx_rcc_clock rcc@40023800: set_rate not implemented for clock index 4
stm32fx_rcc_clock rcc@40023800: set_rate not implemented for clock index 4
stm32fx_rcc_clock rcc@40023800: set_rate not implemented for clock index 4

Core:  38 devices, 22 uclasses, devicetree: separate
Flash: 1 MiB
MMC:   sdio1@40012c00: 0
Loading Environment from nowhere... OK
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - 7e:cf:cf:fc:30:4a
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
MMC: no card present

looks good without the problematic commit.

best regards
Waldemar

#13 lore raw

Hi Patrice, Hi Simon,
Patrice CHOTARD wrote,

Quoted 71 lines

Hi Waldemar

Quoted 68 lines · Waldemar Brodkorb

Hi Simon,
Simon Glass wrote,

Quoted 65 lines

Hi Waldemar,

Quoted 61 lines · Waldemar Brodkorb

Hi again,

Waldemar Brodkorb wrote,

Quoted 7 lines

Hi,

I am trying to run u-boot on a STM32F746G-DISCO device. I am configuring u-boot with stm32f746-disco_spl_defconfig.

But nothing happens on the LCD nor on the serial console. I use screen /dev/ttyACM0 115200 under Linux to connect.

It seems my USB port on my laptop was buggy, after reboot I get following output via serial console:

U-Boot SPL 2022.07 (Sep 19 2022 - 13:20:08 +0200)
Trying to boot from XIP

U-Boot 2022.07 (Sep 19 2022 - 13:20:08 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Hard fault
pc : 080087d6    lr : c05aa775    xPSR : a1000000

r12 : 00000010 r3 : 080087c1 r2 : 0805344d
r1 : 08008001 r0 : c05aa000
Resetting CPU ...

resetting ...

I get a Hard fault. I then tried an older version of u-boot using the information from https://github.com/fdu/STM32F746G-disco_Buildroot
as a hint. With U-Boot 2018.11 I get a working binary (I had to disable Falcon mode):

U-Boot SPL 2018.11 (Sep 19 2022 - 13:41:50 +0200)
Trying to boot from XIP

U-Boot 2018.11 (Sep 19 2022 - 13:41:50 +0200)

Model: STMicroelectronics STM32F746-DISCO board
DRAM:  8 MiB
Flash: 1 MiB
MMC:   sdio@40012c00: 0
In:    serial
Out:   serial
Err:   serial

usr button is at LOW LEVEL
Net:
Warning: ethernet@40028000 (eth0) using random MAC address - fe:f8:94:5f:5e:26
eth0: ethernet@40028000
Hit SPACE in 3 seconds to stop autoboot.
Wrong Image Format for bootm command
ERROR: can't get kernel image!
U-Boot >

Seems like a regression to me.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

Yes, can you use git bisect to find it?

cd82f199852d88218e1f17f5ec07cdd9112a89c4 is the first bad commit.

I remember i encountered an issue with patch in the past and by updating my toolchain > everything goes fine.

Which toolchain version do you use ?

I used arm-gnu-toolchain-11.3.rel1-x86_64-arm-none-eabi.tar.xz from ARM.
https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads

Quoted 2 lines

On my side i am using this one :
https://www.kernel.org/pub/tools/crosstool/files/bin/x86_64/11.1.0/x86_64-gcc-11.1.0-nolibc-arm-linux-gnueabi.tar.xz

Well it really seems to be an toolchain issue, with this one I can compile U-Boot master and it runs on the system without failure.

best regards
Waldemar