Skip to content

Instantly share code, notes, and snippets.

@lupyuen
Created January 15, 2024 03:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lupyuen/84ceeb5bd4eed98d9d1a3cd83d712dab to your computer and use it in GitHub Desktop.
Save lupyuen/84ceeb5bd4eed98d9d1a3cd83d712dab to your computer and use it in GitHub Desktop.
NuttX on Ox64: getprime + hello crashes
[I][]
[I][] ____ ____ __ __ _
[I][] / __ \ | _ \ / _|/ _| | |
[I][] | | | |_ __ ___ _ __ | |_) | ___ _ _| |_| |_ __ _| | ___
[I][] | | | | '_ \ / _ \ '_ \| _ < / _ \| | | | _| _/ _` | |/ _ \
[I][] | |__| | |_) | __/ | | | |_) | (_) | |_| | | | || (_| | | (_) |
[I][] \____/| .__/ \___|_| |_|____/ \___/ \__,_|_| |_| \__,_|_|\___/
[I][] | |
[I][] |_|
[I][]
[I][] Powered by BouffaloLab
[I][] Build:11:52:04,Mar 6 2023
[I][] Copyright (c) 2023 OpenBouffalo team
[I][] Copyright (c) 2022 Bouffalolab team
[I][] dynamic memory init success,heap s[I][LowLoad] D0 start...
[I][LowLoad] low_load start...
[I][LowLoad] Header at 0x5d5ff000
[I][LowLoad] Section dtb(1) - Start 0x5d5ff100, Size 14314
[I][LowLoad] Copying DTB to 0x51ff8000...0x51ffb7ea
[I][LowLoad] Done!
[I][LowLoad] Section OpenSBI(2) - Start 0x5d60f100, Size 109864
[I][LowLoad] Copying OpenSBI to 0x3ef80000...0x3ef9ad28
[I][LowLoad] Done!
[I][LowLoad] Section Kernel(3) - Start 0x5d62f100, Size 315597
[I][LowLoad] Uncompressing Kernl to 0x50000000...
[I][LowLoad] Done!
[I][LowLoad] CRC: 00000000
[I][LowLoad] load time: 61311 us
[I][LowLoad] Setting PMP
[I][LowLoad] Booting OpenSBI at 0x000000003ef80000 with DTB at 0x51ff8000
OpenSBI v1.2
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : Pine64 Ox64 (D0)
Platform Features : medeleg
Platform HART Count : 1
Platform IPI Device : aclint-mswi
Platform Timer Device : aclint-mtimer @ 1000000Hz
Platform Console Device : bflb_uart
Platform HSM Device : ---
Platform PMU Device : ---
Platform Reboot Device : ---
Platform Shutdown Device : ---
Firmware Base : 0x3ef80000
Firmware Size : 200 KB
Runtime SBI Version : 1.0
Domain0 Name : root
Domain0 Boot HART : 0
Domain0 HARTs : 0*
Domain0 Region00 : 0x00000000e4008000-0x00000000e400bfff (I)
Domain0 Region01 : 0x00000000e4000000-0x00000000e4007fff (I)
Domain0 Region02 : 0x000000003ef80000-0x000000003efbffff ()
Domain0 Region03 : 0x0000000000000000-0xffffffffffffffff (R,W,X)
Domain0 Next Address : 0x0000000050000000
Domain0 Next Arg1 : 0x0000000051ff8000
Domain0 Next Mode : S-mode
Domain0 SysReset : yes
Boot HART ID : 0
Boot HART Domain : root
Boot HART Priv Version : v1.11
Boot HART Base ISA : rv64imafdcvx
Boot HART ISA Extensions : time
Boot HART PMP Count : 8
Boot HART PMP Granularity : 4096
Boot HART PMP Address Bits: 38
Boot HART MHPM Count : 8
Boot HART MIDELEG : 0x0000000000000222
Boot HART MEDELEG : 0x000000000000b109
U-Boot 2023.04-rc2 (Mar 06 2023 - 11:48:40 +0000)
DRAM: 64 MiB
Core: 36 devices, 17 uclasses, devicetree: board
MMC: mmc@20060000: 0
Loading Environment from FAT... Unable to read "uboot.env" from mmc0:2...
Loading Environment from nowhere... OK
In: serial@30002000
Out: serial@30002000
Err: serial@30002000
Net:
Warning: emac@20070000 (eth0) using random MAC address - 1a:f8:d0:0f:6e:ea
eth0: emac@20070000
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:2...
Found /extlinux/extlinux.conf
Retrieving file: /extlinux/extlinux.conf
Select the boot mode
1:.Pine64 0X64 Kernel
2:.Sipeed M1SDock Kernel
Enter choice: 1:.Pine64 0X64 Kernel
Retrieving file: /extlinux/../Image
append: root=PARTLABEL=rootfs rootwait rw rootfstype=ext4 console=ttyS0,2000000 loglevel=8 earlycon=sbi
Retrieving file: /extlinux/../bl808-pine64-ox64.dtb
## Flattened Device Tree blob at 51ff8000
Booting using the fdt blob at 0x51ff8000
Working FDT set to 51ff8000
Loading Device Tree to 0000000053f22000, end 0000000053f25fab ... OK
Working FDT set to 53f22000
Starting kernel ...
ABC
NuttShell (NSH) NuttX-12.4.0
nsh> uname -a
NuttX 12.4.0 96c2707737 Jan 15 2024 10:35:29 risc-v ox64
nsh>
nsh> getprime
Set thread priority to 10
Set thread policy to SCHED_RR
Start thread #0
thread #0 started, looking for primes < 10000, doing 10 run(s)
thread #0 finished, found 1230 primes, last one was 9973
Done
getprime took 0 msec
nsh>
nsh> hello
riscv_exception: EXCEPTION: Store/AMO page fault. MCAUSE: 000000000000000f, EPC: 0000000050208fcc, MTVAL: 0000000080200000
riscv_exception: PANIC!!! Exception = 000000000000000f
_assert: Current Version: NuttX 12.4.0 96c2707737 Jan 15 2024 10:34:53 risc-v
_assert: Assertion failed panic: at file: common/riscv_exception.c:85 task: /system/bin/init process: /system/bin/init 0x8000004a
up_dump_register: EPC: 0000000050208fcc
up_dump_register: A0: 0000000080200000 A1: 0000000000000000 A2: 00000000000002a8 A3: 00000000000002a8
up_dump_register: A4: 0000000000000000 A5: 0000000080200000 A6: 0000000000000000 A7: 0000000000000000
up_dump_register: T0: 0000000000000003 T1: 0000000000000007 T2: 0000000000000020 T3: 00000000802002a8
up_dump_register: T4: 0000000080200000 T5: 00000000000000ff T6: 000000000000000f
up_dump_register: S0: 0000000080200000 S1: 0000000000080d58 S2: 0000000000000000 S3: 0000000080202988
up_dump_register: S4: 0000000000000001 S5: 00000000802008c8 S6: 0000000050409940 S7: 0000000000000000
up_dump_register: S8: 0000000000000001 S9: 0000000000000000 S10: 0000000000000000 S11: 0000000000000000
up_dump_register: SP: 000000005040b200 FP: 0000000080200000 TP: 0000000000000000 RA: 000000005020976e
dump_stack: Kernel Stack:
dump_stack: base: 0x5040aaa0
dump_stack: size: 00003072
dump_stack: sp: 0x5040b200
stack_dump: 0x5040b1e0: 00000018 00000000 50213f30 00000000 504099b0 00000000 5040b830 00000000
stack_dump: 0x5040b200: 50409940 00000000 80202988 00000000 504098d0 00000000 504099c0 00000000
stack_dump: 0x5040b220: 80200000 00000000 5020a186 00000000 00000000 00000000 50213d52 00000000
stack_dump: 0x5040b240: 5040b2c8 00000000 80000000 00000000 80101000 00000000 00000000 00000000
stack_dump: 0x5040b260: 5040b7f0 00000000 50408190 00000000 00000008 00000000 80200000 00000000
stack_dump: 0x5040b280: 00000000 0000816d 464c457f 00010102 00000000 00000000 00f30001 00000001
stack_dump: 0x5040b2a0: 0000001a 00000000 00000000 00000000 00081b10 00000000 00000005 00000040
stack_dump: 0x5040b2c0: 00400000 001c001d 00000000 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b2e0: 50409940 00000000 5040b830 00000000 50409f10 00000000 fffffffc ffffffff
stack_dump: 0x5040b300: ffffff83 ffffffff 50407c00 00000000 50408190 00000000 502098ee 00000000
stack_dump: 0x5040b320: 802008c8 00000000 504098d0 00000000 50407c00 00000000 50207b14 00000000
stack_dump: 0x5040b340: 50408190 00000000 504098d0 00000000 00000000 00000000 50209812 00000000
stack_dump: 0x5040b360: 00000000 00000000 50213c4c 00000000 504098c0 00000000 00000064 00000000
stack_dump: 0x5040b380: 80200570 00000000 80202a28 00000000 802008c8 00000000 00042022 00000002
stack_dump: 0x5040b3a0: 80202988 00000000 504098d0 00000000 00000000 00000000 50212f62 00000000
stack_dump: 0x5040b3c0: 00000000 00000000 00000000 00000000 0000000a 00000000 0000000b 00000000
stack_dump: 0x5040b3e0: 80015cc8 00000000 00000000 00000000 80202a28 00000000 80202a28 00000000
stack_dump: 0x5040b400: 80202978 00000000 802008c8 00000000 00000000 00000000 50216aa0 00000000
stack_dump: 0x5040b420: 80202988 00000000 80200570 00000000 80202a9f 00000000 00000000 00000000
stack_dump: 0x5040b440: 802008c8 00000000 00000000 00000000 802008c8 00000000 802005d0 00000000
stack_dump: 0x5040b460: 00000000 00000000 502073b6 00000000 80202b40 00000000 5020143a 00000000
stack_dump: 0x5040b480: 80004cb0 00000000 00000032 00000025 50201422 00000000 80004cb0 00000000
stack_dump: 0x5040b4a0: 5040b490 00000000 00000000 00000000 00000000 00000000 5020707c 00000000
stack_dump: 0x5040b4c0: 80202988 00000000 00000020 00000000 00000000 00000000 802005d0 00000000
stack_dump: 0x5040b4e0: 0000001b 00000000 80202978 00000000 802008c8 00000000 80202980 00000000
stack_dump: 0x5040b500: 80202988 00000000 80202a28 00000000 80200570 00000000 80202a28 00000000
stack_dump: 0x5040b520: 802008c8 00000000 00000000 00000000 80202a28 00000000 00000000 00000000
stack_dump: 0x5040b540: 80015cc8 00000000 0000000b 00000000 0000000a 00000000 00000000 00000000
stack_dump: 0x5040b560: 00000000 00000000 00000000 00000000 80202980 00000000 802008c8 00000000
stack_dump: 0x5040b580: 80202978 00000000 0000000f 00000000 00042120 00000002 00000000 00000000
stack_dump: 0x5040b5a0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b5c0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b5e0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b600: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b620: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b640: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b660: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b680: 00000000 00000000 50203382 00000000 00000000 00000000 00000000 00000000
stack_dump: 0x5040b6a0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dump_tasks: PID GROUP PRI POLICY TYPE NPX STATE EVENT SIGMASK STACKBASE STACKSIZE USED FILLED COMMAND
dump_tasks: ---- --- --- -------- ------- --- ------- ---------- ---------------- 0x50400290 2048 968 47.2% irq
dump_task: 0 0 0 FIFO Kthread - Ready 0000000000000000 0x50407010 3056 904 29.5% Idle_Task
dump_task: 1 1 100 RR Kthread - Waiting Semaphore 0000000000000000 0x5040a050 1968 704 35.7% lpwork 0x50401a90 0x50401ab8
dump_task: 3 3 100 RR Task - Running 0000000000000000 0x80202040 3008 1272 42.2% /system/bin/init
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment