fdu / STM32F429I-disco_Buildroot

39 stars 24 forks source link

Boot on Latest Discovery429-DISC1 gets Stuck #1

Open gligorov opened 6 years ago

gligorov commented 6 years ago

Thank you for the great setup and instructions. I was able to build it, using Ubuntu VM.

Since I work on Windows, I did this to flash the board:

st-flash.exe --reset write stm32f429i-disco.bin 0x08000000 st-flash.exe --reset write stm32f429-disco.dtb 0x08004000 st-flash.exe --reset write xipImage 0x08008000

Next I restart the board, and use the serial to view the boot sequence, and you can see the image where it gets stuck below:

linuxboot

Last line that is pending is [ 1.220000] [<0800b20f>] (show_stack) from [<0800b7e3>] (__invalid_entry+0x4b/0x4c)

linuxboot

Any hints on what I am missing or not? I am using the DISC1 - latest version of the discovery, and I see on your images you have the prior version, not sure if there are any differences?

Thanks.

Zan

yann77500 commented 5 years ago

Hello,

I have the same problem on STM32F769-disco board project. Do you solved this issue?

Thank you

Pve88 commented 5 years ago

Hello, I have the same problem with stm32f429I-disco I have tried to download latest buildroot (2018.05.x) and built with stm32f429_disco_defconfig It works, but without display

BhavnaHarani commented 5 years ago

Hello , I am not able to flash the board. I have follow the steps which are in README file. I have performed bootstrap and build. I got this error on make flash command.

" make flash cd buildroot/output/build/host-openocd-0.10.0/tcl && ../../../host/usr/bin/openocd \ -f board/stm32f429discovery.cfg \ -c "init" \ -c "reset init" \ -c "flash probe 0" \ -c "flash info 0" \ -c "flash write_image erase ../../../images/stm32f429i-disco.bin 0x08000000" \ -c "flash write_image erase ../../../images/stm32f429-disco.dtb 0x08004000" \ -c "flash write_image erase ../../../images/xipImage 0x08008000" \ -c "reset run" -c shutdown Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD adapter speed: 2000 kHz adapter_nsrst_delay: 100 none separate srst_only separate srst_nogate srst_open_drain connect_deassert_srst Info : Unable to match requested speed 2000 kHz, using 1800 kHz Info : Unable to match requested speed 2000 kHz, using 1800 kHz Info : clock speed 1800 kHz Error: open failed in procedure 'init' in procedure 'ocd_bouncer'

make: *** [flash] Error 1

" Is there any special connection required on stm32f429I disco board to flash the board? please let me its work around.

Thanks, bhavna

ericgebionics commented 5 years ago

Hi, all I have the same issue with no screen. Yet, I tried to hook up the serial on either USART1 or USART3, but seeing no output from the terminal of the putty.

Have you all resolved your issues already ?

Thanks. Eric

Update: It turns out that I didn't have the driver of CP2012 installed correctly. USART1 works.

adenis78 commented 5 years ago

It works, but without display

Is it means works and display to tty with serial port , just does not display on board screen? tty connection is ok?

ericyuncheng commented 5 years ago

Yes, if you hook up a CP2012 to the USART1, and reset the board, you will see the Linux booting process up to the point shown by Zan. I am not good enough to figure out what's wrong with it...

adenis78 commented 5 years ago

After building with binutils2.28 (not 2.29 or newer) = it's ok (not at all, however, see tty screen link below).

link to "Revert "configs/stm32f429: force usage of binutils 2.28.x"

tty screen link (the message is constantly repeated (again and again): can't open /dev/tty2: No such device or address
can't open /dev/tty3: No such device or address
can't open /dev/tty4: No such device or address can't open /dev/tty2: No such device or address
can't open /dev/tty3: No such device or address
can't open /dev/tty4: No such device or address ....

Then, look at busybox init/init.c code:

/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
 * then parse_inittab() simply adds in some default
 * actions (i.e., runs INIT_SCRIPT and then starts a pair
 * of "askfirst" shells).  If CONFIG_FEATURE_USE_INITTAB
 * _is_ defined, but /etc/inittab is missing, this
 * results in the same set of default behaviors.
 */
static void parse_inittab(void)
{
#if ENABLE_FEATURE_USE_INITTAB
        char *token[4];
        parser_t *parser = config_open2("/etc/inittab", fopen_for_read);

        if (parser == NULL)
#endif
        {
                /* No inittab file - set up some default behavior */
                /* Sysinit */
                new_init_action(SYSINIT, INIT_SCRIPT, "");
                /* Askfirst shell on tty1-4 */
                new_init_action(ASKFIRST, bb_default_login_shell, "");
//TODO: VC_1 instead of ""? "" is console -> ctty problems -> angry users
                new_init_action(ASKFIRST, bb_default_login_shell, VC_2);
                new_init_action(ASKFIRST, bb_default_login_shell, VC_3);
                new_init_action(ASKFIRST, bb_default_login_shell, VC_4);

(...)

fredricktoy commented 5 years ago

Hello , I am not able to flash the board. I have follow the steps which are in README file. I have performed bootstrap and build. I got this error on make flash command.

" make flash cd buildroot/output/build/host-openocd-0.10.0/tcl && ../../../host/usr/bin/openocd -f board/stm32f429discovery.cfg -c "init" -c "reset init" -c "flash probe 0" -c "flash info 0" -c "flash write_image erase ../../../images/stm32f429i-disco.bin 0x08000000" -c "flash write_image erase ../../../images/stm32f429-disco.dtb 0x08004000" -c "flash write_image erase ../../../images/xipImage 0x08008000" -c "reset run" -c shutdown Open On-Chip Debugger 0.10.0 Licensed under GNU GPL v2 For bug reports, read http://openocd.org/doc/doxygen/bugs.html Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD adapter speed: 2000 kHz adapter_nsrst_delay: 100 none separate srst_only separate srst_nogate srst_open_drain connect_deassert_srst Info : Unable to match requested speed 2000 kHz, using 1800 kHz Info : Unable to match requested speed 2000 kHz, using 1800 kHz Info : clock speed 1800 kHz Error: open failed in procedure 'init' in procedure 'ocd_bouncer'

make: *** [flash] Error 1

" Is there any special connection required on stm32f429I disco board to flash the board? please let me its work around.

Thanks, bhavna

Use stm32f429disc1.cfg for the new order code

eleree commented 5 years ago

[ 0.000000] interrupt-controller@40013c00: bank0, External IRQs available:0x7fffff [ 0.000000] clocksource: arm_system_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 331816030 ns [ 0.000000] ARM System timer initialized as clocksource [ 0.000000] /soc/timer@40000c00: STM32 clockevent driver initialized (32 bits) [ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns [ 0.080000] Calibrating delay loop... 118.68 BogoMIPS (lpj=593408) [ 0.090000] pid_max: default: 4096 minimum: 301 [ 0.090000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.090000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.090000] Hierarchical SRCU implementation. [ 0.100000] devtmpfs: initialized [ 0.150000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.150000] pinctrl core: initialized pinctrl subsystem [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOA bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOB bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOC bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOD bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOE bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOF bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOG bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOH bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOI bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOJ bank added [ 0.220000] stm32f429-pinctrl soc:pin-controller: GPIOK bank added [ 0.220000] stm32f429-pinctrl soc:pin-controller: Pinctrl STM32 initialized [ 0.250000] stm32-dma 40026000.dma-controller: STM32 DMA driver registered [ 0.260000] stm32-dma 40026400.dma-controller: STM32 DMA driver registered [ 0.270000] clocksource: Switched to clocksource arm_system_timer [ 0.680000] workingset: timestamp_bits=30 max_order=11 bucket_order=0 [ 0.710000] random: fast init done [ 0.760000] io scheduler noop registered (default) [ 0.760000] io scheduler mq-deadline registered [ 0.760000] io scheduler kyber registered [ 0.760000] STM32 USART driver initialized [ 0.770000] 40011000.serial: ttyS0 at MMIO 0x40011000 (irq = 32, base_baud = 5625000) is a stm32-usart [ 1.130000] console [ttyS0] enabled [ 1.130000] stm32_rtc 40002800.rtc: rtc core: registered 40002800.rtc as rtc0 [ 1.150000] stm32_rtc 40002800.rtc: Date/Time must be initialized [ 1.150000] i2c /dev entries driver [ 1.170000] input: gpio_keys as /devices/platform/gpio_keys/input/input0 [ 1.180000] stm32_rtc 40002800.rtc: setting system clock to 2000-01-01 00:00:16 UTC (946684816) [ 1.190000] Freeing unused kernel memory: 12K [ 1.200000] This architecture does not have kernel memory protection. [ 1.220000] [ 1.220000] Unhandled exception: IPSR = 00000006 LR = fffffff1 [ 1.220000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #1 [ 1.220000] Hardware name: STM32 (Device Tree Support) [ 1.220000] PC is at ret_fast_syscall+0x2/0x58 [ 1.220000] LR is at tty_ioctl+0x3df/0x578 [ 1.220000] pc : [<08009942>] lr : [<080cc0d7>] psr: 4000000b [ 1.220000] sp : 90791fa8 ip : 0000001c fp : 9040e7f2 [ 1.220000] r10: 00000000 r9 : 90790000 r8 : 08009b00 [ 1.220000] r7 : 00000036 r6 : 90444ef0 r5 : 00000000 r4 : 90444f4c [ 1.220000] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : 00000000 [ 1.220000] xPSR: 4000000b [ 1.220000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #1 [ 1.220000] Hardware name: STM32 (Device Tree Support) [ 1.220000] [<0800be85>] (unwind_backtrace) from [<0800b20f>] (show_stack+0xb/0xc) [ 1.220000] [<0800b20f>] (show_stack) from [<0800b7e3>] (invalid_entry+0x4b/0x4c) ..[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.15.7 (ti@DX3001) (gcc version 6.4.0 (Buildroot 2018.02-00002-g158caf3-dirty)) #1 PREEMPT Mon Apr 16 08:38:22 CST 2018 [ 0.000000] CPU: ARMv7-M [410fc241] revision 1 (ARMv7M), cr=00000000 [ 0.000000] CPU: unknown data cache, unknown instruction cache [ 0.000000] OF: fdt: Machine model: STMicroelectronics STM32F429i-DISCO board [ 0.000000] Built 1 zonelists, mobility grouping off. Total pages: 2032 [ 0.000000] Kernel command line: root=/dev/ram [ 0.000000] Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.000000] Memory: 7784K/8192K available (1193K kernel code, 127K rwdata, 404K rodata, 63K init, 114K bss, 408K reserved, 0K cma-reserved) [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0x00000000 - 0x00001000 ( 4 kB) [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB) [ 0.000000] vmalloc : 0x00000000 - 0xffffffff (4095 MB) [ 0.000000] lowmem : 0x90000000 - 0x90800000 ( 8 MB) [ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (1598 kB) [ 0.000000] .init : 0x(ptrval) - 0x(ptrval) ( 12 kB) [ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 128 kB) [ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 115 kB) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] Preemptible hierarchical RCU implementation. [ 0.000000] Tasks RCU enabled. [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] interrupt-controller@40013c00: bank0, External IRQs available:0x7fffff [ 0.000000] clocksource: arm_system_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 331816030 ns [ 0.000000] ARM System timer initialized as clocksource [ 0.000000] /soc/timer@40000c00: STM32 clockevent driver initialized (32 bits) [ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns [ 0.080000] Calibrating delay loop... 118.68 BogoMIPS (lpj=593408) [ 0.090000] pid_max: default: 4096 minimum: 301 [ 0.090000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.090000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.090000] Hierarchical SRCU implementation. [ 0.100000] devtmpfs: initialized [ 0.150000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 0.150000] pinctrl core: initialized pinctrl subsystem [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOA bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOB bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOC bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOD bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOE bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOF bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOG bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOH bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOI bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOJ bank added [ 0.220000] stm32f429-pinctrl soc:pin-controller: GPIOK bank added [ 0.220000] stm32f429-pinctrl soc:pin-controller: Pinctrl STM32 initialized [ 0.250000] stm32-dma 40026000.dma-controller: STM32 DMA driver registered [ 0.260000] stm32-dma 40026400.dma-controller: STM32 DMA driver registered [ 0.270000] clocksource: Switched to clocksource arm_system_timer [ 0.680000] workingset: timestamp_bits=30 max_order=11 bucket_order=0 [ 0.710000] random: fast init done [ 0.760000] io scheduler noop registered (default) [ 0.760000] io scheduler mq-deadline registered [ 0.760000] io scheduler kyber registered [ 0.760000] STM32 USART driver initialized [ 0.770000] 40011000.serial: ttyS0 at MMIO 0x40011000 (irq = 32, base_baud = 5625000) is a stm32-usart [ 1.130000] console [ttyS0] enabled [ 1.130000] stm32_rtc 40002800.rtc: rtc core: registered 40002800.rtc as rtc0 [ 1.150000] stm32_rtc 40002800.rtc: Date/Time must be initialized [ 1.150000] i2c /dev entries driver [ 1.170000] input: gpio_keys as /devices/platform/gpio_keys/input/input0 [ 1.180000] stm32_rtc 40002800.rtc: setting system clock to 2000-01-01 00:00:32 UTC (946684832) [ 1.190000] Freeing unused kernel memory: 12K [ 1.200000] This architecture does not have kernel memory protection. [ 1.220000] [ 1.220000] Unhandled exception: IPSR = 00000006 LR = fffffff1 [ 1.220000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #1 [ 1.220000] Hardware name: STM32 (Device Tree Support) [ 1.220000] PC is at ret_fast_syscall+0x2/0x58 [ 1.220000] LR is at tty_ioctl+0x3df/0x578 [ 1.220000] pc : [<08009942>] lr : [<080cc0d7>] psr: 4000000b [ 1.220000] sp : 90791fa8 ip : 0000001c fp : 9040e7f2 [ 1.220000] r10: 00000000 r9 : 90790000 r8 : 08009b00 [ 1.220000] r7 : 00000036 r6 : 90444ef0 r5 : 00000000 r4 : 90444f4c [ 1.220000] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : 00000000 [ 1.220000] xPSR: 4000000b [ 1.220000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #1 [ 1.220000] Hardware name: STM32 (Device Tree Support) [ 1.220000] [<0800be85>] (unwind_backtrace) from [<0800b20f>] (show_stack+0xb/0xc) [ 1.220000] [<0800b20f>] (show_stack) from [<0800b7e3>] (invalid_entry+0x4b/0x4c)

boot failed.

eleree commented 5 years ago

After building with binutils2.28 (not 2.29 or newer) = it's ok (not at all, however, see tty screen link below).

link to "Revert "configs/stm32f429: force usage of binutils 2.28.x"

tty screen link (the message is constantly repeated (again and again): can't open /dev/tty2: No such device or address can't open /dev/tty3: No such device or address can't open /dev/tty4: No such device or address can't open /dev/tty2: No such device or address can't open /dev/tty3: No such device or address can't open /dev/tty4: No such device or address ....

Then, look at busybox init/init.c code:

/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
 * then parse_inittab() simply adds in some default
 * actions (i.e., runs INIT_SCRIPT and then starts a pair
 * of "askfirst" shells).  If CONFIG_FEATURE_USE_INITTAB
 * _is_ defined, but /etc/inittab is missing, this
 * results in the same set of default behaviors.
 */
static void parse_inittab(void)
{
#if ENABLE_FEATURE_USE_INITTAB
        char *token[4];
        parser_t *parser = config_open2("/etc/inittab", fopen_for_read);

        if (parser == NULL)
#endif
        {
                /* No inittab file - set up some default behavior */
                /* Sysinit */
                new_init_action(SYSINIT, INIT_SCRIPT, "");
                /* Askfirst shell on tty1-4 */
                new_init_action(ASKFIRST, bb_default_login_shell, "");
//TODO: VC_1 instead of ""? "" is console -> ctty problems -> angry users
                new_init_action(ASKFIRST, bb_default_login_shell, VC_2);
                new_init_action(ASKFIRST, bb_default_login_shell, VC_3);
                new_init_action(ASKFIRST, bb_default_login_shell, VC_4);

(...)

fixed as adenis78 said.

fredricktoy commented 5 years ago

After building with binutils2.28 (not 2.29 or newer) = it's ok (not at all, however, see tty screen link below). link to "Revert "configs/stm32f429: force usage of binutils 2.28.x" tty screen link (the message is constantly repeated (again and again): can't open /dev/tty2: No such device or address can't open /dev/tty3: No such device or address can't open /dev/tty4: No such device or address can't open /dev/tty2: No such device or address can't open /dev/tty3: No such device or address can't open /dev/tty4: No such device or address .... Then, look at busybox init/init.c code:

/* NOTE that if CONFIG_FEATURE_USE_INITTAB is NOT defined,
 * then parse_inittab() simply adds in some default
 * actions (i.e., runs INIT_SCRIPT and then starts a pair
 * of "askfirst" shells).  If CONFIG_FEATURE_USE_INITTAB
 * _is_ defined, but /etc/inittab is missing, this
 * results in the same set of default behaviors.
 */
static void parse_inittab(void)
{
#if ENABLE_FEATURE_USE_INITTAB
        char *token[4];
        parser_t *parser = config_open2("/etc/inittab", fopen_for_read);

        if (parser == NULL)
#endif
        {
                /* No inittab file - set up some default behavior */
                /* Sysinit */
                new_init_action(SYSINIT, INIT_SCRIPT, "");
                /* Askfirst shell on tty1-4 */
                new_init_action(ASKFIRST, bb_default_login_shell, "");
//TODO: VC_1 instead of ""? "" is console -> ctty problems -> angry users
                new_init_action(ASKFIRST, bb_default_login_shell, VC_2);
                new_init_action(ASKFIRST, bb_default_login_shell, VC_3);
                new_init_action(ASKFIRST, bb_default_login_shell, VC_4);

(...)

fixed as adenis78 said.

how to fix the issue that tty message is constantly repeated?

adenis78 commented 5 years ago

how to fix the issue that tty message is constantly repeated?

just have to do (both) : 1) comment strings (tty2...4) in file $YourBuildRootPath/buildroot/output/build/busybox-1.27.2/init/init.c as done below:

static void parse_inittab(void)
{
#if ENABLE_FEATURE_USE_INITTAB
char *token[4];
parser_t *parser = config_open2("/etc/inittab", fopen_for_read);

if (parser == NULL)
#endif
{
/* No inittab file - set up some default behavior */
/* Sysinit */
new_init_action(SYSINIT, INIT_SCRIPT, "");
/* Askfirst shell on tty1-4 */
new_init_action(ASKFIRST, bb_default_login_shell, "");
//TODO: VC_1 instead of ""? "" is console -> ctty problems -> angry users
/*new_init_action(ASKFIRST, bb_default_login_shell, VC_2);
new_init_action(ASKFIRST, bb_default_login_shell, VC_3);
new_init_action(ASKFIRST, bb_default_login_shell, VC_4);*/

2) change file $YourBuildRootPath/config/busybox to: CONFIG_FEATURE_USE_INITTAB=n

Then the problem should be gone.

fangyaodong commented 5 years ago

I have completed the following steps, but the same problem still appears. Is there anything I have missed?

  1. According to link to "Revert "configs/stm32f429: force usage of binutils 2.28.x" prompt,I change "buildroot/linux/Config.in" with 1 addition comment "Linux kernel may fail to boot with binutils >= 2.29" depends on BR2_ARM_CPU_ARMV7M depends on !BR2_BINUTILS_VERSION_2_28_X

    2.comment_ strings (tty2...4) in file $YourBuildRootPath/buildroot/output/build/busybox-
    1.27.2/init/init.c /new_init_action(ASKFIRST, bb_default_login_shell, VC_2); new_init_action(ASKFIRST, bb_default_login_shell, VC_3); new_init_action(ASKFIRST, bb_default_login_shell, VC_4);/

    3.change file $YourBuildRootPath/config/busybox to: CONFIG_FEATURE_USE_INITTAB=n

And I use DISC1 ,Through the ST-LINK Utility flash。

Thanks.

fangyaodong commented 5 years ago

Thank you for the great setup and instructions. I was able to build it, using Ubuntu VM.

Since I work on Windows, I did this to flash the board:

st-flash.exe --reset write stm32f429i-disco.bin 0x08000000 st-flash.exe --reset write stm32f429-disco.dtb 0x08004000 st-flash.exe --reset write xipImage 0x08008000

Next I restart the board, and use the serial to view the boot sequence, and you can see the image where it gets stuck below:

linuxboot

Last line that is pending is [ 1.220000] [<0800b20f>] (show_stack) from [<0800b7e3>] (__invalid_entry+0x4b/0x4c)

linuxboot

Any hints on what I am missing or not? I am using the DISC1 - latest version of the discovery, and I see on your images you have the prior version, not sure if there are any differences?

Thanks.

Zan

hello
I also use DISC1 board,Are you running normally?

slaskhas commented 5 years ago

I had some success doing the following.

I was able to boot without (__invalid_entry+0x4b/0x4c) using recent binutils, by manually applying the following patch to arch/arm/include/asm/assembler.h ;


@@ -195,13 +195,19 @@ 
        .irp    c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
        .macro  badr\c, rd, sym
 #ifdef CONFIG_THUMB2_KERNEL
-       adr\c   \rd, \sym + 1
+       __badr  \c, \rd, \sym
 #else
        adr\c   \rd, \sym
 #endif
        .endm
        .endr

+       /* this needs to be a separate macro or \@ does not work correctly */
+       .macro  __badr, c, rd, sym
+       .eqv    .Lsym\@, \sym
+       adr\c   \rd, .Lsym\@ + 1
+       .endm
+
 /*
  * Get current thread_info.
  */

Source from https://lkml.org/lkml/2018/6/19/927

I ending up with the endless can't open /dev/tty2: No such device or address can't open /dev/tty3: No such device or address can't open /dev/tty4: No such device or address

but after applying the patch by https://github.com/adenis78 above , I get the prompt. No gui though.

lu1kaifeng commented 4 years ago

why no display on disco1 is it a driver problem or because of the board differences?

rodrigo455 commented 3 years ago

linuxboot

this commit solves your problem, but it is in mainline. For v4.15.7 you should perform the following changes:

diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index e655dcd0a..dd8d22156 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -46,6 +46,7 @@ saved_pc  .req    lr
  * features make this path too inefficient.
  */
 ret_fast_syscall:
+__ret_fast_syscall:
  UNWIND(.fnstart   )
  UNWIND(.cantunwind    )
    disable_irq_notrace         @ disable interrupts
@@ -75,6 +76,7 @@ fast_work_pending:
  * r0 first to avoid needing to save registers around each C function call.
  */
 ret_fast_syscall:
+__ret_fast_syscall:
  UNWIND(.fnstart   )
  UNWIND(.cantunwind    )
    str r0, [sp, #S_R0 + S_OFF]!    @ save returned r0
@@ -242,7 +244,7 @@ local_restart:
    bne __sys_trace

    cmp scno, #NR_syscalls      @ check upper syscall limit
-   badr    lr, ret_fast_syscall        @ return address
+   badr    lr, __ret_fast_syscall      @ return address
    ldrcc   pc, [tbl, scno, lsl #2]     @ call sys_* routine

    add r1, sp, #S_OFF
--
robopp55 commented 3 years ago

linuxboot

this commit solves your problem, but it is in mainline. For v4.15.7 you should perform the following changes:

diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
index e655dcd0a..dd8d22156 100644
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -46,6 +46,7 @@ saved_pc    .req    lr
  * features make this path too inefficient.
  */
 ret_fast_syscall:
+__ret_fast_syscall:
  UNWIND(.fnstart )
  UNWIND(.cantunwind  )
  disable_irq_notrace         @ disable interrupts
@@ -75,6 +76,7 @@ fast_work_pending:
  * r0 first to avoid needing to save registers around each C function call.
  */
 ret_fast_syscall:
+__ret_fast_syscall:
  UNWIND(.fnstart )
  UNWIND(.cantunwind  )
  str r0, [sp, #S_R0 + S_OFF]!    @ save returned r0
@@ -242,7 +244,7 @@ local_restart:
  bne __sys_trace

  cmp scno, #NR_syscalls      @ check upper syscall limit
- badr    lr, ret_fast_syscall        @ return address
+ badr    lr, __ret_fast_syscall      @ return address
  ldrcc   pc, [tbl, scno, lsl #2]     @ call sys_* routine

  add r1, sp, #S_OFF
--

I've applied this patch running v4.15.7 of the Linux kernel and I'm still stuck __invalid_entry. Here's the kernel output:

[ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 4.15.7 (rob@rob-XPS-15-9500) (gcc version 6.4.0 (Buildroot 2018.02-00002-g158caf3)) #9 PREEMPT Sun Mar 14 01:08:07 EST 2021 [ 0.000000] CPU: ARMv7-M [410fc241] revision 1 (ARMv7M), cr=00000000 [ 0.000000] CPU: unknown data cache, unknown instruction cache [ 0.000000] OF: fdt: Machine model: STMicroelectronics STM32F429i-DISCO board [ 0.000000] Built 1 zonelists, mobility grouping off. Total pages: 2032 [ 0.000000] Kernel command line: root=/dev/ram [ 0.000000] Dentry cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.000000] Memory: 7784K/8192K available (1193K kernel code, 127K rwdata, 404K roda ta, 63K init, 114K bss, 408K reserved, 0K cma-reserved) [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0x00000000 - 0x00001000 ( 4 kB) [ 0.000000] fixmap : 0xffc00000 - 0xfff00000 (3072 kB) [ 0.000000] vmalloc : 0x00000000 - 0xffffffff (4095 MB) [ 0.000000] lowmem : 0x90000000 - 0x90800000 ( 8 MB) [ 0.000000] .text : 0x(ptrval) - 0x(ptrval) (1598 kB) [ 0.000000] .init : 0x(ptrval) - 0x(ptrval) ( 12 kB) [ 0.000000] .data : 0x(ptrval) - 0x(ptrval) ( 128 kB) [ 0.000000] .bss : 0x(ptrval) - 0x(ptrval) ( 115 kB) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] Preemptible hierarchical RCU implementation. [ 0.000000] Tasks RCU enabled. [ 0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16 [ 0.000000] interrupt-controller@40013c00: bank0, External IRQs available:0x7fffff [ 0.000000] clocksource: arm_system_timer: mask: 0xffffff max_cycles: 0xffffff, max_ idle_ns: 331816030 ns [ 0.000000] ARM System timer initialized as clocksource [ 0.000000] /soc/timer@40000c00: STM32 clockevent driver initialized (32 bits) [ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474 836475000000ns [ 0.080000] Calibrating delay loop... 118.68 BogoMIPS (lpj=593408) [ 0.090000] pid_max: default: 4096 minimum: 301 [ 0.090000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.090000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.090000] Hierarchical SRCU implementation. [ 0.100000] devtmpfs: initialized [ 0.150000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ ns: 19112604462750000 ns [ 0.150000] pinctrl core: initialized pinctrl subsystem [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOA bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOB bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOC bank added [ 0.200000] stm32f429-pinctrl soc:pin-controller: GPIOD bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOE bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOF bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOG bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOH bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOI bank added [ 0.210000] stm32f429-pinctrl soc:pin-controller: GPIOJ bank added [ 0.220000] stm32f429-pinctrl soc:pin-controller: GPIOK bank added [ 0.220000] stm32f429-pinctrl soc:pin-controller: Pinctrl STM32 initialized [ 0.250000] stm32-dma 40026000.dma-controller: STM32 DMA driver registered [ 0.260000] stm32-dma 40026400.dma-controller: STM32 DMA driver registered [ 0.270000] clocksource: Switched to clocksource arm_system_timer [ 0.680000] workingset: timestamp_bits=30 max_order=11 bucket_order=0 [ 0.710000] random: fast init done [ 0.760000] io scheduler noop registered (default) [ 0.760000] io scheduler mq-deadline registered [ 0.760000] io scheduler kyber registered [ 0.770000] STM32 USART driver initialized [ 0.770000] 40011000.serial: ttyS0 at MMIO 0x40011000 (irq = 32, base_baud = 5625000 ) is a stm32-usart [ 1.130000] console [ttyS0] enabled [ 1.140000] stm32_rtc 40002800.rtc: rtc core: registered 40002800.rtc as rtc0 [ 1.150000] stm32_rtc 40002800.rtc: Date/Time must be initialized [ 1.160000] i2c /dev entries driver [ 1.170000] input: gpio_keys as /devices/platform/gpio_keys/input/input0 [ 1.180000] stm32_rtc 40002800.rtc: setting system clock to 2000-01-01 00:27:23 UTC (946686443) [ 1.190000] Freeing unused kernel memory: 12K [ 1.200000] This architecture does not have kernel memory protection. [ 1.220000] [ 1.220000] Unhandled exception: IPSR = 00000006 LR = fffffff1 [ 1.220000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #9 [ 1.220000] Hardware name: STM32 (Device Tree Support) [ 1.220000] PC is at ret_fast_syscall+0x2/0x58 [ 1.220000] LR is at tty_ioctl+0x3df/0x578 [ 1.220000] pc : [<08009942>] lr : [<080cc0d7>] psr: 4000000b [ 1.220000] sp : 90791fa8 ip : 0000001c fp : 9040ed34 [ 1.220000] r10: 00000000 r9 : 90790000 r8 : 08009b00 [ 1.220000] r7 : 00000036 r6 : 90444ef0 r5 : 00000000 r4 : 90444f4c [ 1.220000] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : 00000000 [ 1.220000] xPSR: 4000000b [ 1.220000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #9 [ 1.220000] Hardware name: STM32 (Device Tree Support) [ 1.220000] [<0800be85>] (unwind_backtrace) from [<0800b20f>] (show_stack+0xb/0xc) [ 1.220000] [<0800b20f>] (show_stack) from [<0800b7e3>] (__invalid_entry+0x4b/0x4c)

Any help is greatly appreciated!

rodrigo455 commented 3 years ago

hmmm I can't tell exactly what is happening, but in order to get higher verbosity I recommend you to port this patch to the 4.15.7 kernel. It is from the emcraft's fork of the linux tree and it tells you more info about the exception.

ALTracer commented 2 years ago

@rodrigo455 Thanks for the assembly patch, it helped me boot this Buildroot on a stm32f429-disco board. The space constraints are too strict though -- I could barely fit inside the 2MiB Flash while tweaking configs of buildroot, busybox and linux kernel; enabling SPI, LTDC, disabling USB, stripping the DTB etc.

Here's my boot log, note it may be different from builds of clean checkout and default configs:

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.15.7 (mint-user@Workstation451) (gcc version 6.4.0 (Buildroot 2018.02)) #29 PREEMPT Fri Feb 4 20:03:33 MSK 2022
[    0.000000] CPU: ARMv7-M [410fc241] revision 1 (ARMv7M), cr=00000000
[    0.000000] CPU: unknown data cache, unknown instruction cache
[    0.000000] OF: fdt: Machine model: STMicroelectronics STM32F429i-DISCO board
[    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2032
[    0.000000] Kernel command line: root=/dev/ram
[    0.000000] Dentry cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.000000] Memory: 7808K/8192K available (1381K kernel code, 100K rwdata, 332K rodata, 62K init, 107K bss, 384K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]     vector  : 0x00000000 - 0x00001000   (   4 kB)
[    0.000000]     fixmap  : 0xffc00000 - 0xfff00000   (3072 kB)
[    0.000000]     vmalloc : 0x00000000 - 0xffffffff   (4095 MB)
[    0.000000]     lowmem  : 0x90000000 - 0x90800000   (   8 MB)
[    0.000000]       .text : 0x(ptrval) - 0x(ptrval)   (1714 kB)
[    0.000000]       .init : 0x(ptrval) - 0x(ptrval)   (  16 kB)
[    0.000000]       .data : 0x(ptrval) - 0x(ptrval)   ( 101 kB)
[    0.000000]        .bss : 0x(ptrval) - 0x(ptrval)   ( 108 kB)
[    0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] Preemptible hierarchical RCU implementation.
[    0.000000]  Tasks RCU enabled.
[    0.000000] NR_IRQS: 16, nr_irqs: 16, preallocated irqs: 16
[    0.000000] interrupt-controller@40013c00: bank0, External IRQs available:0x7fffff
[    0.000000] clocksource: arm_system_timer: mask: 0xffffff max_cycles: 0xffffff, max_idle_ns: 331816030 ns
[    0.000000] ARM System timer initialized as clocksource
[    0.000000] /soc/timer@40000c00: STM32 clockevent driver initialized (32 bits)
[    0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
[    0.080000] Calibrating delay loop... 118.68 BogoMIPS (lpj=593408)
[    0.090000] pid_max: default: 4096 minimum: 301
[    0.090000] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090000] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
[    0.090000] Hierarchical SRCU implementation.
[    0.100000] devtmpfs: initialized
[    0.150000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[    0.150000] pinctrl core: initialized pinctrl subsystem
[    0.210000] stm32f429-pinctrl soc:pin-controller: GPIOA bank added
[    0.210000] stm32f429-pinctrl soc:pin-controller: GPIOB bank added
[    0.210000] stm32f429-pinctrl soc:pin-controller: GPIOC bank added
[    0.210000] stm32f429-pinctrl soc:pin-controller: GPIOD bank added
[    0.210000] stm32f429-pinctrl soc:pin-controller: GPIOE bank added
[    0.210000] stm32f429-pinctrl soc:pin-controller: GPIOF bank added
[    0.220000] stm32f429-pinctrl soc:pin-controller: GPIOG bank added
[    0.220000] stm32f429-pinctrl soc:pin-controller: GPIOH bank added
[    0.220000] stm32f429-pinctrl soc:pin-controller: GPIOI bank added
[    0.220000] stm32f429-pinctrl soc:pin-controller: GPIOJ bank added
[    0.220000] stm32f429-pinctrl soc:pin-controller: GPIOK bank added
[    0.220000] stm32f429-pinctrl soc:pin-controller: Pinctrl STM32 initialized
[    0.270000] stm32-dma 40026000.dma-controller: STM32 DMA driver registered
[    0.270000] stm32-dma 40026400.dma-controller: STM32 DMA driver registered
[    0.280000] pps_core: LinuxPPS API ver. 1 registered
[    0.280000] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
[    0.280000] clocksource: Switched to clocksource arm_system_timer
[    0.730000] workingset: timestamp_bits=30 max_order=11 bucket_order=0
[    0.810000] random: fast init done
[    0.810000] io scheduler noop registered (default)
[    0.810000] io scheduler deadline registered
[    0.810000] io scheduler kyber registered
[    0.810000] STM32 USART driver initialized
[    0.810000] 40011000.serial: ttyS0 at MMIO 0x40011000 (irq = 34, base_baud = 5625000) is a stm32-usart
[    1.190000] console [ttyS0] enabled
[    1.220000] loop: module loaded
[    1.240000] dummy-irq: no IRQ given.  Use irq=N
[    1.240000] mtdoops: mtd device (mtddev=name/number) must be supplied
[    1.250000] stm32_rtc 40002800.rtc: rtc core: registered 40002800.rtc as rtc0
[    1.260000] stm32_rtc 40002800.rtc: Date/Time must be initialized
[    1.270000] i2c /dev entries driver
[    1.280000] stmpe-i2c 0-0041: stmpe811 detected, chip id: 0x811
[    1.340000] input: stmpe-ts as /devices/platform/soc/40005c00.i2c/i2c-0/0-0041/stmpe-ts/input/input0
[    1.340000] stmpe-i2c 0-0041: platform wants blocks (0x8) not present on variant
[    1.340000] stm32f4-i2c 40005c00.i2c: STM32F4 I2C driver registered
[    1.340000] input: gpio_keys as /devices/platform/gpio_keys/input/input1
[    1.340000] stm32_rtc 40002800.rtc: setting system clock to 2000-01-01 00:00:00 UTC (946684800)
[    1.340000] Freeing unused kernel memory: 16K
[    1.340000] This architecture does not have kernel memory protection.
init started: BusyBox v1.27.2 (2022-02-04 18:46:36 MSK)

Welcome to Buildroot
(none) login: root
Password: 
Jan  1 00:01:58 login[27]: root login on 'console'

BusyBox v1.27.2 (2022-02-04 18:46:36 MSK) hush - the humble shell
Enter 'help' for a list of built-in commands.

~ # uname -a
Linux (none) 4.15.7 #29 PREEMPT Fri Feb 4 20:03:33 MSK 2022 armv7ml GNU/Linux
~ # date -s "2022-02-04 18:11:00"
Fri Feb  4 18:11:00 UTC 2022
~ # hwclock -w

@gligorov Consider closing once you confirm the patch resolves your booting issue. To everyone else: I couldn't get the display to work after backporting DTS patches as there seems to be no panel driver for it. The README.md picture was taken from previous uCLinux builds, apparently. You should rather try fresh mainline kernel builds (5.15, 5.17) for any hope of working display.

zzsczz commented 9 months ago

how to tweak configs ?
can you share the tweaking steps and the final output of hex file ?

@rodrigo455 Thanks for the assembly patch, it helped me boot this Buildroot on a stm32f429-disco board. The space constraints are too strict though -- I could barely fit inside the 2MiB Flash while tweaking configs of buildroot, busybox and linux kernel; enabling SPI, LTDC, disabling USB, stripping the DTB etc.

Here's my boot log, note it may be different from builds of clean checkout and default configs: