0% found this document useful (0 votes)
10 views2 pages

"Unhandled Exception - Illegal Instruction" During Linux Kernel Startup in U-Boot

The document discusses an issue encountered while attempting to boot a Linux kernel on a RISC-V board using an SPI driver, resulting in an 'Illegal instruction' exception during startup. The user details the steps taken to load the kernel and device tree blob from an SD card, as well as the attempts to analyze the memory dump from the board. Despite successful loading of the device tree, the kernel fails to boot, prompting a reset of the board.

Uploaded by

Lui Sze
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

"Unhandled Exception - Illegal Instruction" During Linux Kernel Startup in U-Boot

The document discusses an issue encountered while attempting to boot a Linux kernel on a RISC-V board using an SPI driver, resulting in an 'Illegal instruction' exception during startup. The user details the steps taken to load the kernel and device tree blob from an SD card, as well as the attempts to analyze the memory dump from the board. Despite successful loading of the device tree, the kernel fails to boot, prompting a reset of the board.

Uploaded by

Lui Sze
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

群组 会话 在“[email protected].

org”中搜索会话

 新会话  

"Unhandled
 我的群组 exception: Illegal instruction" during linux kernel startup in U-Boot - RISCV Architecture. 订阅
近期的群组
已查看 209 次
收藏的群组
Venkatakrishnan Sutharsan 2021年7⽉9⽇ 13:28:29 
收件⼈ RISC-V SW Dev

 已加星标的会话
Hi,

I have been writing SPI Driver for a RISCV Board and is currently trying to use that to boot linux kernel from SD Card. Right now, I have the card detected and can view Mles in
RISC-V SW Dev
various partitions in the SD Card. After that I try to copy the uImage (created using mkimage command and vmlinux image Mle) and dtb into the memory and start the kernel
using the following command :
会话 99+
=> ext4load mmc 0:1 ${kernel_addr_r} /boot/uImage; ext4load mmc 0:1 ${fdt_addr_r} /boot/shakti_100t.dtb; bootm ${kernel_addr_r} - ${fdt_addr_r}
关于16131968 bytes read in 1227747 ms (12.7 KiB/s)
2852 bytes read in 504 ms (4.9 KiB/s)
## Booting kernel from Legacy Image at 84000000 ...
Image Name: Shakti-Vajra
Image Type: RISC-V Linux Kernel Image (uncompressed)
Data Size: 16131904 Bytes = 15.4 MiB
Load Address: 84000000
Entry Point: 84000000
Verifying Checksum ... OK
## Flattened Device Tree blob at 88000000
Booting using the fdt blob at 0x88000000
Loading Kernel Image
Using Device Tree in place at 0000000088000000, end 0000000088003b23

Starting kernel ...

Unhandled exception: Illegal instruction


EPC: 0000000084000000 RA: 000000008ff9905c TVAL: 00000000464c457f
EPC: 0000000074268000 RA: 000000008020105c reloc adjusted
resetting ...
reset not supported yet
### ERROR ### Please RESET the board ###

And to check the dump I was not able to create the dump using riscv64-unknown-elf-objdump command in my computer so I used the md.b command to get the dump from
RAM in the board. The dump were as follows :

84000000: 27 05 19 56 02 e3 5d 33 60 e2 a7 a5 00 f6 27 40 '..V..]3`.....'@
84000010: 84 00 00 00 84 00 00 00 ee 5e 8f 20 05 1a 02 00 .........^. ....
84000020: 53 68 61 6b 74 69 2d 56 61 6a 72 61 00 00 00 00 Shakti-Vajra....
84000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000040: 7f 45 4c 46 02 01 01 00 00 00 00 00 00 00 00 00 .ELF............
84000050: 02 00 f3 00 01 00 00 00 00 00 00 00 e0 ff ff ff ................
84000060: 40 00 00 00 00 00 00 00 00 22 f6 00 00 00 00 00 @........"......
84000070: 00 00 00 00 40 00 38 00 04 00 40 00 15 00 14 00 [email protected]...@.....
84000080: 01 00 00 00 05 00 00 00 00 10 00 00 00 00 00 00 ................
84000090: 00 00 00 00 e0 ff ff ff 00 00 00 00 00 00 00 00 ................
840000a0: f4 ab 01 00 00 00 00 00 f4 ab 01 00 00 00 00 00 ................
840000b0: 00 10 00 00 00 00 00 00 01 00 00 00 07 00 00 00 ................
840000c0: 00 c0 01 00 00 00 00 00 00 b0 01 00 e0 ff ff ff ................
840000d0: 00 b0 01 00 00 00 00 00 c0 a4 e6 00 00 00 00 00 ................
840000e0: c0 a4 e6 00 00 00 00 00 00 10 00 00 00 00 00 00 ................
840000f0: 04 00 00 00 04 00 00 00 c0 78 e1 00 00 00 00 00 .........x......
84000100: c0 68 e1 00 e0 ff ff ff c0 68 e1 00 00 00 00 00 .h.......h......
84000110: 3c 00 00 00 00 00 00 00 3c 00 00 00 00 00 00 00 <.......<.......
84000120: 04 00 00 00 00 00 00 00 51 e5 74 64 06 00 00 00 ........Q.td....
84000130: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000140: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000150: 00 00 00 00 00 00 00 00 10 00 00 00 00 00 00 00 ................
84000160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000190: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
840001a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
840001b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
840001c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
840001d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
840001e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
840001f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000200: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000210: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000220: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000230: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000240: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000250: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
84000260: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
while the FDT loading seems to happen correctly as below. There is a huge number of zeros in the above dump after which there is some data(after 0x84001078). I can also
say that what I see in my hex editor in my computer can be seen in md.b dump in the RAM.

=> md.b ${fdt_addr_r}


88000000: d0 0d fe ed 00 00 0b 24 00 00 00 38 00 00 08 54 .......$...8...T
88000010: 00 00 00 28 00 00 00 11 00 00 00 10 00 00 00 00 ...(............
88000020: 00 00 02 d0 00 00 08 1c 00 00 00 00 00 00 00 00 ................
88000030: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
88000040: 00 00 00 03 00 00 00 04 00 00 00 00 00 00 00 02 ................
88000050: 00 00 00 03 00 00 00 04 00 00 00 0f 00 00 00 02 ................
88000060: 00 00 00 03 00 00 00 16 00 00 00 1b 73 68 61 6b ............shak
88000070: 74 69 2c 73 70 69 6b 65 2d 62 61 72 65 2d 64 65 ti,spike-bare-de
88000080: 76 00 00 00 00 00 00 03 00 00 00 12 00 00 00 26 v..............&
88000090: 73 68 61 6b 74 69 2c 73 70 69 6b 65 2d 62 61 72 shakti,spike-bar
880000a0: 65 00 00 00 00 00 00 01 63 70 75 73 00 00 00 00 e.......cpus....
880000b0: 00 00 00 03 00 00 00 04 00 00 00 00 00 00 00 01 ................
880000c0: 00 00 00 03 00 00 00 04 00 00 00 0f 00 00 00 00 ................
880000d0: 00 00 00 03 00 00 00 04 00 00 00 2c 00 00 80 00 ...........,....
880000e0: 00 00 00 01 63 70 75 40 30 00 00 00 00 00 00 03 ....cpu@0.......
880000f0: 00 00 00 04 00 00 00 3f 63 70 75 00 00 00 00 03 .......?cpu.....
88000100: 00 00 00 04 00 00 00 4b 00 00 00 00 00 00 00 03 .......K........
88000110: 00 00 00 05 00 00 00 4f 6f 6b 61 79 00 00 00 00 .......Ookay....
88000120: 00 00 00 03 00 00 00 06 00 00 00 1b 72 69 73 63 ............risc
88000130: 76 00 00 00 00 00 00 03 00 00 00 09 00 00 00 56 v..............V
88000140: 72 76 36 34 69 6d 61 63 00 00 00 00 00 00 00 03 rv64imac........
88000150: 00 00 00 0b 00 00 00 60 72 69 73 63 76 2c 73 76 .......`riscv,sv
88000160: 33 39 00 00 00 00 00 03 00 00 00 04 00 00 00 69 39.............i
88000170: 02 fa f0 80 00 00 00 01 69 6e 74 65 72 72 75 70 ........interrup
88000180: 74 2d 63 6f 6e 74 72 6f 6c 6c 65 72 00 00 00 00 t-controller....

You might also like