LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 10-19-2018, 02:41 AM   #1
YunchengEric0311
LQ Newbie
 
Registered: Apr 2012
Posts: 6

Rep: Reputation: Disabled
Smile Stm32f429i-disc1 with embedded Linux crashed !!!


Hi, there

I followed the instructions of this post:

https://github.com/fdu/STM32F429I-disco_Buildroot

and I got to a point where it prints:
-----------------------------------------------------------
[ 1.210000] Unhandled exception: IPSR = 00000006 LR = fffffff1
[ 1.210000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #4
[ 1.210000] Hardware name: STM32 (Device Tree Support)
[ 1.210000] PC is at ret_fast_syscall+0x2/0x58
[ 1.210000] LR is at tty_ioctl+0x3df/0x578
[ 1.210000] pc : [<08009942>] lr : [<080cc0d7>] psr: 4000000b
[ 1.210000] sp : 90791fa8 ip : 0000001c fp : 9040ecb8
[ 1.210000] r10: 00000000 r9 : 90790000 r8 : 08009b00
[ 1.210000] r7 : 00000036 r6 : 90444ef0 r5 : 00000000 r4 : 90444f4c
[ 1.210000] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : 00000000
[ 1.210000] xPSR: 4000000b
[ 1.210000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #4
[ 1.210000] Hardware name: STM32 (Device Tree Support)
[ 1.210000] [<0800be85>] (unwind_backtrace) from [<0800b20f>] (show_stack+0xb/0xc)
[ 1.210000] [<0800b20f>] (show_stack) from [<0800b7e3>] (__invalid_entry+0x4b/0x4c)
-------------------------------------------------------
Then, the system halts.

I believe the Unhandled exception is the cause, yet I don't know what to do with it. This has been reported as an issue on the repository since March this year, but no one is taking care of it. I was wondering if there is any person who is good with embedded Linux kernel here that can teach me how to go pass this issue.

Thank you.
Regards,
Eric
 
Old 10-19-2018, 05:55 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,476

Rep: Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990
Can't even guess what's going on. Post 20-30 lines before that, if there are 20-30 lines. Also detail what it's loading from (hd, prom, network, etc) and if the appropriate modules are in an initrd, if root is mounted, or what's happening. We can't see your board, you know.
 
Old 10-19-2018, 01:54 PM   #3
YunchengEric0311
LQ Newbie
 
Registered: Apr 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hello, Business kid

Thank you for replying.

If you click the link I provided above, and scroll down to the Boot Log, you will see the print out of booting process. Mine is only a few lines different than that, and I'll post it when I have my board tonight. The kernel is in the flash.

I am familiar with the RTOS used in STM32, and I was hoping to learn more of Linux kernel if this setup works.

Any comment is appreciated. Thank you.

Regards,
Eric

Last edited by YunchengEric0311; 10-19-2018 at 02:18 PM.
 
Old 10-19-2018, 02:32 PM   #4
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,476

Rep: Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990
What Link? I don't see one.

Use the <Insert Hyperlink> icon in the reply frame. It's a blue globe thing.
 
Old 10-19-2018, 02:36 PM   #5
YunchengEric0311
LQ Newbie
 
Registered: Apr 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
https://github.com/fdu/STM32F429I-disco_Buildroot

My boot Log:

[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.15.7 (root@GE-Laptop-Eric) (gcc version 6.4.0 (Buildroot 2018.02)) #4 PREEMPT Thu Oct 18 19:07:44 PDT 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: 7788K/8192K available (1193K kernel code, 127K rwdata, 404K rodata, 63K init, 114K bss, 404K 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.140000] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
[ 0.140000] pinctrl core: initialized pinctrl subsystem
[ 0.170000] stm32f429-pinctrl soc: pin-controller: GPIOA bank added
[ 0.180000] stm32f429-pinctrl soc: pin-controller: GPIOB bank added
[ 0.180000] stm32f429-pinctrl soc: pin-controller: GPIOC bank added
[ 0.180000] stm32f429-pinctrl soc: pin-controller: GPIOD bank added
[ 0.180000] stm32f429-pinctrl soc: pin-controller: GPIOE bank added
[ 0.180000] stm32f429-pinctrl soc: pin-controller: GPIOF bank added
[ 0.180000] stm32f429-pinctrl soc: pin-controller: GPIOG bank added
[ 0.190000] stm32f429-pinctrl soc: pin-controller: GPIOH bank added
[ 0.190000] stm32f429-pinctrl soc: pin-controller: GPIOI bank added
[ 0.190000] stm32f429-pinctrl soc: pin-controller: GPIOJ bank added
[ 0.190000] stm32f429-pinctrl soc: pin-controller: GPIOK bank added
[ 0.190000] stm32f429-pinctrl soc: pin-controller: Pinctrl STM32 initialized
[ 0.240000] stm32-dma 40026000.dma-controller: STM32 DMA driver registered
[ 0.250000] stm32-dma 40026400.dma-controller: STM32 DMA driver registered
[ 0.250000] clocksource: Switched to clocksource arm_system_timer
[ 0.670000] workingset: timestamp_bits=30 max_order=11 bucket_order=0
[ 0.700000] random: fast init done
[ 0.750000] io scheduler noop registered (default)
[ 0.750000] io scheduler mq-deadline registered
[ 0.750000] io scheduler kyber registered
[ 0.750000] STM32 USART driver initialized
[ 0.760000] 40011000.serial: ttyS0 at MMIO 0x40011000 (irq = 32, base_baud = 5625000) is a stm32-usart
[ 1.120000] console [ttyS0] enabled
[ 1.120000] stm32_rtc 40002800.rtc: rtc core: registered 40002800.rtc as rtc0
[ 1.140000] stm32_rtc 40002800.rtc: Date/Time must be initialized
[ 1.140000] i2c /dev entries driver
[ 1.160000] input: gpio_keys as /devices/platform/gpio_keys/input/input0
[ 1.170000] stm32_rtc 40002800.rtc: setting system clock to 2000-01-01 00:09:40 UTC (946685380)
[ 1.180000] Freeing unused kernel memory: 12K
[ 1.180000] This architecture does not have kernel memory protection.
[ 1.210000]
[ 1.210000] Unhandled exception: IPSR = 00000006 LR = fffffff1
[ 1.210000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #4
[ 1.210000] Hardware name: STM32 (Device Tree Support)
[ 1.210000] PC is at ret_fast_syscall+0x2/0x58
[ 1.210000] LR is at tty_ioctl+0x3df/0x578
[ 1.210000] pc : [<08009942>] lr : [<080cc0d7>] psr: 4000000b
[ 1.210000] sp : 90791fa8 ip : 0000001c fp : 9040ecb8
[ 1.210000] r10: 00000000 r9 : 90790000 r8 : 08009b00
[ 1.210000] r7 : 00000036 r6 : 90444ef0 r5 : 00000000 r4 : 90444f4c
[ 1.210000] r3 : 00000000 r2 : 00000000 r1 : 00000000 r0 : 00000000
[ 1.210000] xPSR: 4000000b
[ 1.210000] CPU: 0 PID: 1 Comm: init Not tainted 4.15.7 #4
[ 1.210000] Hardware name: STM32 (Device Tree Support)
[ 1.210000] [<0800be85>] (unwind_backtrace) from [<0800b20f>] (show_stack+0xb/0xc)
[ 1.210000] [<0800b20f>] (show_stack) from [<0800b7e3>] (__invalid_entry+0x4b/0x4c)

Last edited by YunchengEric0311; 10-19-2018 at 03:38 PM.
 
Old 10-20-2018, 06:28 AM   #6
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,476

Rep: Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990
Code:
[ 1.170000] stm32_rtc 40002800.rtc: setting system clock to 2000-01-01 00:09:40 UTC (946685380)
[ 1.180000] Freeing unused kernel memory: 12K
[ 1.180000] This architecture does not have kernel memory protection. 
[ 1.210000]
[ 1.210000] Unhandled exception: IPSR = 00000006 LR = fffffff1
To judge by the github link, what happens 2nd last line is that the thing should switch to internal flash and run busybox. That's evidently not happening satisfactorily. It's the standard linux equivalent of loading / ro and running init. This is where you take up the detective work. If there's a /CS or /READ line accessible on the internal flash, does it go low before you crash? Have you any ideas?
 
Old 10-20-2018, 09:14 PM   #7
YunchengEric0311
LQ Newbie
 
Registered: Apr 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hey, Business Kid

Thank you for responding again.

I am not very familiar with the Linux's kernel to answer your questions.

I guess the next step is to build a debugging U-Boot + Linux Kernel + Busybox and use the OpenOCD to debug the whole booting process.

Make Sense ?

Regards,
Eric
 
Old 10-21-2018, 05:46 AM   #8
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware & Android
Posts: 9,476

Rep: Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990Reputation: 990
Code:
[ 1.180000] Freeing unused kernel memory: 12K
[ 1.180000] This architecture does not have kernel memory protection.
At that stage, your kernel seems to have booted successfully. Now, I noticed this in the bootup procedure
Code:
[ 0.000000] Kernel command line: root=/dev/ram
So it should load /dev/ram, the ramdisk(?) and boot busybox from that. If it fails to find the root drive, it's usually a different error, and the kernel goes down in flames. Here, it seems to find the root device, but go down in flames running busybox

What exactly is /dev/ram? If you have a device in /dev, it will have major & minor numbers and we can guess from that. If it's your flash ram, and if it's loading (a 'scope is handy there) and if it's reading the format, busybox is probably puking. Sorry to be so uncertain, but you're obviously embarrassed for memory, and warnings may be missing. Does it keep logs or dmesg, and do they say anything?
 
Old 10-21-2018, 11:38 PM   #9
YunchengEric0311
LQ Newbie
 
Registered: Apr 2012
Posts: 6

Original Poster
Rep: Reputation: Disabled
Hey, Business Kid

Thank you for your insights.

Unfortunately, I am still trying to set up a good debugging environment in Linux to trace the source codes. I've always been using windows environment with Atollic Truestudio (basically eclipse) to debug stm32 mcu. The OpenOCD used in the buildroot only "flashes" the images to the device, and not debugging it. I was trying to figure out how to debug the images with it in Linux. It might take me a few days or even a week or two to figure it out, but I will. In the mean time, I won't be able to respond promptly. I want to let you know that I appreciated your comments.

Thank you.

Regards,
Eric
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with installation on disc1 (confirmation dialog) NEED HELP!!! SRneXus Fedora 5 02-23-2007 04:51 AM
Problem booting from CD with FC3-i386-disc1 antis35 Fedora - Installation 9 07-09-2005 02:21 PM
Jedi Academy keeps asking Disc1? make Linux - Games 4 03-02-2005 07:45 AM
update mandrake using disc1 only jay820 Linux - Distributions 1 07-20-2003 04:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 09:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration