Skip to content

Instantly share code, notes, and snippets.

@pdp7
Last active September 13, 2023 02:02
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save pdp7/0fd86d39e07ad7084f430c85a7a567f4 to your computer and use it in GitHub Desktop.
Save pdp7/0fd86d39e07ad7084f430c85a7a567f4 to your computer and use it in GitHub Desktop.
MAIX Bit Linux

The prebuild linux-5.6.0-rc1 image for Maix Boards https://twitter.com/SipeedIO/status/1228594799675990016

[    0.000000] Linux version 5.6.0-rc1-g9dbcd412b (vowstar@ryzen) (gcc version 9.2.0 (Buildroot 2020.02-git-g2ceb6f4a3f)) #5 SMP Sat Feb 15 13:02:55 CST 2020
[    0.000000] earlycon: sifive0 at MMIO 0x0000000038000000 (options '')
[    0.000000] printk: bootconsole [sifive0] enabled
[    0.000000] initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
[    0.000000] elf_hwcap is 0x112d
[    0.000000] percpu: max_distance=0x18000 too large for vmalloc space 0x0
[    0.000000] percpu: Embedded 12 pages/cpu s18272 r0 d30880 u49152
[    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2020
[    0.000000] Kernel command line: earlycon console=ttySIF0
[    0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.000000] Inode-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 6272K/8192K available (918K kernel code, 106K rwdata, 166K rodata, 385K init, 91K bss, 1920K reserved, 0K cma-reserved)
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
[    0.000000] plic: mapped 65 interrupts with 2 handlers for 4 contexts.
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x3990be68b, max_idle_ns: 881590404272 ns
[    0.000014] sched_clock: 64 bits at 7MHz, resolution 128ns, wraps every 4398046511054ns
[    0.008236] Console: colour dummy device 80x25
[    0.012473] Calibrating delay loop (skipped), value calculated using timer frequency.. 15.60 BogoMIPS (lpj=31200)
[    0.022677] pid_max: default: 4096 minimum: 301
[    0.027294] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.034414] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.044809] rcu: Hierarchical SRCU implementation.
[    0.049611] smp: Bringing up secondary CPUs ...
[    0.054750] smp: Brought up 1 node, 2 CPUs
[    0.059132] devtmpfs: initialized
[    0.065719] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.074738] futex hash table entries: 16 (order: -2, 1024 bytes, linear)
[    0.082747] Kendryte K210 SoC sysctl
[    0.096426] clocksource: Switched to clocksource riscv_clocksource
[    0.189554] workingset: timestamp_bits=62 max_order=11 bucket_order=0
[    0.196900] 38000000.serial: ttySIF0 at MMIO 0x38000000 (irq = 1, base_baud = 0) is a SiFive UART v0
[    0.205372] printk: console [ttySIF0] enabled
[    0.205372] printk: console [ttySIF0] enabled
[    0.213983] printk: bootconsole [sifive0] disabled
[    0.213983] printk: bootconsole [sifive0] disabled
[    0.226523] random: get_random_bytes called from 0x0000000080065128 with crng_init=0
[    0.235115] devtmpfs: mounted
[    0.238516] Freeing unused kernel memory: 384K
[    0.242223] This architecture does not have kernel memory protection.
[    0.248642] Run /sbin/init as init process
[    0.252828] Run /etc/init as init process
[    0.257006] Run /bin/init as init process

----------------[    0.266890] unexpected interrupt cause 0x8000000000000009
[    0.266901] ------------[ cut here ]------------
[    0.276874] kernel BUG at arch/riscv/kernel/irq.c:43!
[    0.281908] Kernel BUG [#1]
[    0.284695] CPU: 1 PID: 1 Comm: sh Not tainted 5.6.0-rc1-g9dbcd412b #5
[    0.291201] epc: 0000000080145f78 ra : 0000000080145f78 sp : 000000008078bec0
[    0.298319]  gp : 000000008018a9b0 tp : 0000000080786000 t0 : 0000000000046000
[    0.305526]  t1 : 5c5c5c5c5c207c2e t2 : 0000000000000008 s0 : 000000008078bee0
[    0.312732]  s1 : 000000008078bee0 a0 : 000000000000002d a1 : 0000000080190dbf
[    0.319937]  a2 : 0000000000000008 a3 : 0000000000000000 a4 : 0000000000000000
[    0.327144]  a5 : 0000000000000000 a6 : 0000000000000004 a7 : 00000000000000d7
[    0.334351]  s2 : 0000000000000000 s3 : 00000001001f9100 s4 : 8000000000000009
[    0.341557]  s5 : 0000000000000000 s6 : 0000000080447298 s7 : ffffffffffffffff
[    0.348763]  s8 : 000000000000000a s9 : 0000000000000000 s10: 0000000000000062
[    0.355970]  s11: 0000000000000010 t3 : ffffffffffffffff t4 : 0000000000000018
[    0.363173]  t5 : 0000000000000028 t6 : 00000000801909bd
[    0.368472] status: 0000000000001800 badaddr: 0000000000000000 cause: 0000000000000003
[    0.376580] ---[ end trace 1606611251fb8ffb ]---
[    0.380989] Kernel panic - not syncing: Fatal exception in interrupt
[    0.387311] SMP: stopping secondary CPUs
[    0.391232] ---[ end Kernel panic - not syncing: Fatal exception in interrupt ]---
@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

pdp7@x1:~/dev/rv/kflash.py$ kflash -B bit -b 3000000 -p /dev/ttyUSB0  /home/pdp7/Downloads/Maix-linux-5.6-rc1_preview0.1.bin
[INFO] COM Port Selected Manually:  /dev/ttyUSB0 
[INFO] Default baudrate is 115200 , later it may be changed to the value you set. 
[INFO] Trying to Enter the ISP Mode... 
.
[INFO] Greeting Message Detected, Start Downloading ISP 
[INFO] CH340 mode 
Downloading ISP: |================================================================================================================================================================================| 100.0% 10kiB/s
[INFO] Booting From 0x80000000 
[INFO] Wait For 0.1 second for ISP to Boot 
[INFO] Boot to Flashmode Successfully 
[INFO] Selected Baudrate:  3000000 
[INFO] Baudrate changed, greeting with ISP again ...  
[INFO] Boot to Flashmode Successfully 
[INFO] Selected Flash:  On-Board 
[INFO] Initialization flash Successfully 
Programming BIN: |================================================================================================================================================================================| 100.0% 72kiB/s
[INFO] Rebooting... 

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

Screenshot from 2020-02-17 18-19-19
Screenshot from 2020-02-17 18-17-50
Screenshot from 2020-02-17 18-17-38

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

UPDATE: I got a shell!

Step 1: flashed maixpy_v0.4.0_20_g06ed455.bin and then I flashed Maix-linux-5.6-rc1_preview0.1.bin.

pdp7@x1:~/dev/rv/kflash.py$ kflash -B bit -b 3000000 -p /dev/ttyUSB0  /home/pdp7/Downloads/maixpy_v0.4.0_20_g06ed455.bin
[INFO] COM Port Selected Manually:  /dev/ttyUSB0 
[INFO] Default baudrate is 115200 , later it may be changed to the value you set. 
[INFO] Trying to Enter the ISP Mode... 
.
[INFO] Greeting Message Detected, Start Downloading ISP 
[INFO] CH340 mode 
Downloading ISP: |================================================================================================================================================================================| 100.0% 10kiB/s
[INFO] Booting From 0x80000000 
[INFO] Wait For 0.1 second for ISP to Boot 
[INFO] Boot to Flashmode Successfully 
[INFO] Selected Baudrate:  3000000 
[INFO] Baudrate changed, greeting with ISP again ...  
[INFO] Boot to Flashmode Successfully 
[INFO] Selected Flash:  On-Board 
[INFO] Initialization flash Successfully 
Programming BIN: |================================================================================================================================================================================| 100.0% 71kiB/s
[INFO] Rebooting... 
pdp7@x1:~/dev/rv/kflash.py$ kflash -B bit -b 3000000 -p /dev/ttyUSB0  /home/pdp7/Downloads/Maix-linux-5.6-rc1_preview0.1.bin
[INFO] COM Port Selected Manually:  /dev/ttyUSB0 
[INFO] Default baudrate is 115200 , later it may be changed to the value you set. 
[INFO] Trying to Enter the ISP Mode... 
.
[INFO] Greeting Message Detected, Start Downloading ISP 
[INFO] CH340 mode 
Downloading ISP: |================================================================================================================================================================================| 100.0% 10kiB/s
[INFO] Booting From 0x80000000 
[INFO] Wait For 0.1 second for ISP to Boot 
[INFO] Boot to Flashmode Successfully 
[INFO] Selected Baudrate:  3000000 
[INFO] Baudrate changed, greeting with ISP again ...  
[INFO] Boot to Flashmode Successfully 
[INFO] Selected Flash:  On-Board 
[INFO] Initialization flash Successfully 
Programming BIN: |================================================================================================================================================================================| 100.0% 72kiB/s
[INFO] Rebooting... 

Step 2: open terminal and got a root shell!

/ # uname -a
Linux (none) 5.6.0-rc1-g9dbcd412b #5 SMP Sat Feb 15 13:02:55 CST 2020 riscv64 GNU/Linux
/ # ps
  PID USER       VSZ STAT COMMAND
    1 0          460 S    /bin/sh
    2 0            0 SW   [kthreadd]
    3 0            0 IW<  [rcu_gp]
    4 0            0 IW<  [rcu_par_gp]
    5 0            0 IW   [kworker/0:0-eve]
    6 0            0 IW<  [kworker/0:0H]
    7 0            0 IW   [kworker/u4:0-ev]
    8 0            0 IW<  [mm_percpu_wq]
    9 0            0 SW   [ksoftirqd/0]
   10 0            0 IW   [rcu_sched]
   11 0            0 SW   [migration/0]
   12 0            0 SW   [cpuhp/0]
   13 0            0 SW   [cpuhp/1]
   14 0            0 SW   [migration/1]
   15 0            0 SW   [ksoftirqd/1]
   16 0            0 IW   [kworker/1:0-eve]
   17 0            0 IW<  [kworker/1:0H]
   18 0            0 SW   [kdevtmpfs]
   19 0            0 IW<  [writeback]
   20 0            0 IW   [kworker/0:1-eve]
   21 0            0 SW   [kswapd0]
   22 0            0 IW   [kworker/1:1-mm_]
   24 0            0 IW   [kworker/u4:1]
   36 0          324 R    ps
/ # cat /proc/cpuinfo 
processor	: 0
hart		: 0
isa		: rv64imafdc

processor	: 1
hart		: 1
isa		: rv64imafdc

/ # uname -a
Linux (none) 5.6.0-rc1-g9dbcd412b #5 SMP Sat Feb 15 13:02:55 CST 2020 riscv64 GNU/Linux
/ # cat /proc/meminfo 
MemTotal:           6656 kB
MemFree:            4300 kB
MemAvailable:       3832 kB
Buffers:               0 kB
Cached:              560 kB
SwapCached:            0 kB
Active:                0 kB
Inactive:              0 kB
Active(anon):          0 kB
Inactive(anon):        0 kB
Active(file):          0 kB
Inactive(file):        0 kB
Unevictable:         540 kB
Mlocked:               0 kB
MmapCopy:            780 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:             0 kB
Mapped:                0 kB
Shmem:                 0 kB
KReclaimable:          0 kB
Slab:                740 kB
SReclaimable:          0 kB
SUnreclaim:          740 kB
KernelStack:         200 kB
PageTables:            0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:        3328 kB
Committed_AS:          0 kB
VmallocTotal:          0 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
Percpu:               96 kB
/ # 

Screenshot from 2020-02-17 19-44-43
Screenshot from 2020-02-17 19-43-25

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

Excellent tutorial to build Linux for RISC-V Kendryte K210 processor on the sipeed MAix boards
https://github.com/vowstar/k210-linux-nommu

pdp7@x1:~/dev/rv/k210-linux-nommu/linux-kernel$ kflash -B dan -b 3
![Screenshot from 2020-02-17 23-40-25](https://user-images.githubusercontent.com/313864/74690791-4fb0e400-51d8-11ea-9833-c0e4eb9445c5.png)
000000 -p /dev/ttyUSB0 arch/riscv/boot/loader.bin
[INFO] COM Port Selected Manually:  /dev/ttyUSB0 
[INFO] Default baudrate is 115200 , later it may be changed to the value you set. 
[INFO] Trying to Enter the ISP Mode... 
.
[INFO] Greeting Message Detected, Start Downloading ISP 
[INFO] CH340 mode 
Downloading ISP: |================================================================================================================================================================================| 100.0% 10kiB/s
[INFO] Booting From 0x80000000 
[INFO] Wait For 0.1 second for ISP to Boot 
[INFO] Boot to Flashmode Successfully 
[INFO] Selected Baudrate:  3000000 
[INFO] Baudrate changed, greeting with ISP again ...  
[INFO] Boot to Flashmode Successfully 
[INFO] Selected Flash:  On-Board 
[INFO] Initialization flash Successfully 
Programming BIN: |================================================================================================================================================================================| 100.0% 72kiB/s
[INFO] Rebooting... 
pdp7@x1:~/dev/rv/k210-linux-nommu/linux-kernel$ ^C
pdp7@x1:~/dev/rv/k210-linux-nommu/linux-kernel$ ^C
pdp7@x1:~/dev/rv/k210-linux-nommu/linux-kernel$ python3 -m serial.tools.miniterm --raw --filter colorize /dev/ttyUSB0 115200
--- Miniterm on /dev/ttyUSB0  115200,8,N,1 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---

/ # 
/ # 
/ # 
/ # 
/ # 
/ # 
/ # 
/ # uname -a
Linux k210 5.6.0-rc1vowstar #1 SMP Mon Feb 17 23:36:34 CET 2020 riscv64 GNU/Linux
/ # 
/ # cat /proc/cpuinfo 
processor	: 0
hart		: 0
isa		: rv64imafdc

processor	: 1
hart		: 1
isa		: rv64imafdc

/ # 
/ # dmesg
<5>[    0.000000] Linux version 5.6.0-rc1vowstar (pdp7@x1) (gcc version 9.2.0 (Buildroot 2020.02-git-g6cb52b1e6)) #1 SMP Mon Feb 17 23:36:34 CET 2020
<6>[    0.000000] earlycon: sifive0 at MMIO 0x0000000038000000 (options '')
<6>[    0.000000] printk: bootconsole [sifive0] enabled
<6>[    0.000000] initrd not found or empty - disabling initrd
<6>[    0.000000] Zone ranges:
<6>[  755.932086] random: fast init done
[    0.000000]   DMA32    [mem 0x0000000080000000-0x00000000807fffff]
<6>[    0.000000]   Normal   empty
<6>[    0.000000] Movable zone start for each node
<6>[    0.000000] Early memory node ranges
<6>[    0.000000]   node   0: [mem 0x0000000080000000-0x00000000807fffff]
<6>[    0.000000] Initmem setup node 0 [mem 0x0000000080000000-0x00000000807fffff]
<7>[    0.000000] On node 0 totalpages: 2048
<7>[    0.000000]   DMA32 zone: 28 pages used for memmap
<7>[    0.000000]   DMA32 zone: 0 pages reserved
<7>[    0.000000]   DMA32 zone: 2048 pages, LIFO batch:0
<6>[    0.000000] elf_hwcap is 0x112d
<4>[    0.000000] percpu: max_distance=0x18000 too large for vmalloc space 0x0
<6>[    0.000000] percpu: Embedded 12 pages/cpu s18272 r0 d30880 u49152
<7>[    0.000000] pcpu-alloc: s18272 r0 d30880 u49152 alloc=12*4096
<7>[    0.000000] pcpu-alloc: [0] 0 [0] 1 
<6>[    0.000000] Built 1 zonelists, mobility grouping off.  Total pages: 2020
<5>[    0.000000] Kernel command line: earlycon console=ttySIF0
<6>[    0.000000] Dentry cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
<6>[    0.000000] Inode-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
<5>[    0.000000] Sorting __ex_table...
<6>[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
<6>[    0.000000] Memory: 4944K/8192K available (918K kernel code, 106K rwdata, 166K rodata, 1713K init, 91K bss, 3248K reserved, 0K cma-reserved)
<6>[    0.000000] rcu: Hierarchical RCU implementation.
<6>[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
<6>[    0.000000] NR_IRQS: 0, nr_irqs: 0, preallocated irqs: 0
<6>[    0.000000] plic: mapped 65 interrupts with 2 handlers for 4 contexts.
<6>[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
<6>[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x3990be68b, max_idle_ns: 881590404272 ns
<6>[    0.000014] sched_clock: 64 bits at 7MHz, resolution 128ns, wraps every 4398046511054ns
<6>[    0.008238] Console: colour dummy device 80x25
<6>[    0.012474] Calibrating delay loop (skipped), value calculated using timer frequency.. 15.60 BogoMIPS (lpj=31200)
<6>[    0.022677] pid_max: default: 4096 minimum: 301
<6>[    0.027292] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
<6>[    0.034414] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
<6>[    0.044829] rcu: Hierarchical SRCU implementation.
<6>[    0.049624] smp: Bringing up secondary CPUs ...
<6>[    0.054774] smp: Brought up 1 node, 2 CPUs
<6>[    0.059151] devtmpfs: initialized
<6>[    0.065741] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
<6>[    0.074759] futex hash table entries: 16 (order: -2, 1024 bytes, linear)
<6>[    0.082763] Kendryte K210 SoC sysctl
<6>[    0.096475] clocksource: Switched to clocksource riscv_clocksource
<6>[    0.213729] workingset: timestamp_bits=62 max_order=11 bucket_order=0
<6>[    0.221147] 38000000.serial: ttySIF0 at MMIO 0x38000000 (irq = 1, base_baud = 0) is a SiFive UART v0
<6>[    0.229634] printk: console [ttySIF0] enabled
<6>[    0.238229] printk: bootconsole [sifive0] disabled
<5>[    0.250474] random: get_random_bytes called from 0x00000000801b1128 with crng_init=0
<6>[    0.259274] devtmpfs: mounted
<6>[    0.265901] Freeing unused kernel memory: 1712K
<4>[    0.269695] This architecture does not have kernel memory protection.
<6>[    0.276104] Run /sbin/init as init process
<7>[    0.280181]   with arguments:
<7>[    0.280189]     /sbin/init
<7>[    0.280196]   with environment:
<7>[    0.280204]     HOME=/
<7>[    0.280212]     TERM=linux
<6>[    0.280307] Run /etc/init as init process
<7>[    0.284198]   with arguments:
<7>[    0.284207]     /etc/init
<7>[    0.284215]   with environment:
<7>[    0.284222]     HOME=/
<7>[    0.284230]     TERM=linux
<6>[    0.284303] Run /bin/init as init process
<7>[    0.288207]   with arguments:
<7>[    0.288217]     /bin/init
<7>[    0.288224]   with environment:
<7>[    0.288231]     HOME=/
<7>[    0.288239]     TERM=linux
/ # 
/ #  ps 
  PID USER       VSZ STAT COMMAND
    1 0          436 S    /bin/sh
    2 0            0 SW   [kthreadd]
    3 0            0 IW<  [rcu_gp]
    4 0            0 IW<  [rcu_par_gp]
    5 0            0 IW   [kworker/0:0-eve]
    6 0            0 IW<  [kworker/0:0H]
    7 0            0 IW   [kworker/u4:0-ev]
    8 0            0 IW<  [mm_percpu_wq]
    9 0            0 SW   [ksoftirqd/0]
   10 0            0 IW   [rcu_sched]
   11 0            0 SW   [migration/0]
   12 0            0 SW   [cpuhp/0]
   13 0            0 SW   [cpuhp/1]
   14 0            0 SW   [migration/1]
   15 0            0 SW   [ksoftirqd/1]
   16 0            0 IW   [kworker/1:0-eve]
   17 0            0 IW<  [kworker/1:0H]
   18 0            0 SW   [kdevtmpfs]
   19 0            0 IW<  [writeback]
   20 0            0 IW   [kworker/0:1-eve]
   21 0            0 SW   [kswapd0]
   22 0            0 IW   [kworker/1:1-mm_]
   24 0            0 IW   [kworker/u4:1]
   28 0          324 R    ps
/ # 
/ # ls
bin   dev   etc   proc  root  sbin  sys   tmp   usr

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

note: my BiT has this USB chip:

[951458.709923] usb 1-4: ch341-uart converter now attached to ttyUSB0

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

ERA3gx7XsAEQLX7
ERA3gY4W4AYM0b9
ERA3fkbWsAAHYtk
ERA3eygWsAAMFNX

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

I am not sure why there is a wire mod. It was there when I got the board from friend in September 2019.

@pdp7
Copy link
Author

pdp7 commented Feb 17, 2020

/ # cat /proc/meminfo 
MemTotal:           6656 kB
MemFree:            1776 kB
MemAvailable:       1360 kB
Buffers:               0 kB
Cached:             1912 kB
SwapCached:            0 kB
Active:                0 kB
Inactive:              0 kB
Active(anon):          0 kB
Inactive(anon):        0 kB
Active(file):          0 kB
Inactive(file):        0 kB
Unevictable:        1860 kB
Mlocked:               0 kB
MmapCopy:            764 kB
SwapTotal:             0 kB
SwapFree:              0 kB
Dirty:                 0 kB
Writeback:             0 kB
AnonPages:             0 kB
Mapped:                0 kB
Shmem:                 0 kB
KReclaimable:          0 kB
Slab:               1924 kB
SReclaimable:          0 kB
SUnreclaim:         1924 kB
KernelStack:         200 kB
PageTables:            0 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:        3328 kB
Committed_AS:          0 kB
VmallocTotal:          0 kB
VmallocUsed:           0 kB
VmallocChunk:          0 kB
Percpu:               96 kB
/ # 
/ # cat /proc/cpuinfo 
processor	: 0
hart		: 0
isa		: rv64imafdc

processor	: 1
hart		: 1
isa		: rv64imafdc

/ # 
/ # uname -a
Linux k210 5.6.0-rc1vowstar #1 SMP Mon Feb 17 23:36:34 CET 2020 riscv64 GNU/Linux
/ # 
/ # dmesg |head 
<5>[    0.000000] Linux version 5.6.0-rc1vowstar (pdp7@x1) (gcc version 9.2.0 (Buildroot 2020.02-git-g6cb52b1e6)) #1 SMP Mon Feb 17 23:36:34 CET 2020

@hseuschek
Copy link

UPDATE: I got a shell!

Step 1: flashed maixpy_v0.4.0_20_g06ed455.bin and then I flashed Maix-linux-5.6-rc1_preview0.1.bin.

Step 2: open terminal and got a root shell!

Hi @pdp7,
thank you for sharing your experience! I ran into the same kernel panic issue as you did. But unfortunately, even after following your solution (flashing a particular version of maixpy before the Linux image), I still get the same kernel panic. Do you have any explanations why flashing of maixpy can help to solve the kernel panic issue? Is there something addional you did which made the kernel to sucessfully boot?
BTW: I have a newer version of the MAiX BiT which uses the CH552 chip for the USB interface.

TNX,
Hermann

@govindsi
Copy link

Hi @pdp7,

I tried my compiled binary and as well pre-compiled binaries from http://dl.sipeed.com/shareURL/MAIX/K210_Linux/Firmware.
After flashing via kflash, I haven't been able to get a serial console on my sipeed max go(mic) board.
I can not find maixpy_v0.4.0_20_g06ed455.bin anymore in http://dl.sipeed.com/shareURL/MAIX/K210_Linux/Firmware.
Any help would be greatly appreciated.

.\kflash_py.exe -B bit_mic -b 3000000 -p COM4 Maix-linux-5.6-rc1_tcc.bin
←[32m←[1m[INFO]←[0m COM Port Selected Manually: COM4 ←[0m
←[32m←[1m[INFO]←[0m Default baudrate is 115200 , later it may be changed to the value you set. ←[0m
←[32m←[1m[INFO]←[0m Trying to Enter the ISP Mode... ←[0m
*
←[32m←[1m[INFO]←[0m Greeting Message Detected, Start Downloading ISP ←[0m
←[32m←[1m[INFO]←[0m Selected Stage0 Baudrate: 1500000 ←[0m
←[32m←[1m[INFO]←[0m FT2232 mode ←[0m
Downloading ISP: |=====================================================================================| 100.0% 58kiB/s
←[32m←[1m[INFO]←[0m Booting From 0x80000000 ←[0m
←[32m←[1m[INFO]←[0m Wait For 0.1 second for ISP to Boot ←[0m
←[32m←[1m[INFO]←[0m Boot to Flashmode Successfully ←[0m
←[32m←[1m[INFO]←[0m Selected Baudrate: 3000000 ←[0m
←[32m←[1m[INFO]←[0m Baudrate changed, greeting with ISP again ... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
'MAIXLoader' object has no attribute 'raise_exception'

.\kflash_py.exe -B bit_mic -b 3000000 -p COM4 Maix-linux-5.6-rc1_preview0.1.bin
←[32m←[1m[INFO]←[0m COM Port Selected Manually: COM4 ←[0m
←[32m←[1m[INFO]←[0m Default baudrate is 115200 , later it may be changed to the value you set. ←[0m
←[32m←[1m[INFO]←[0m Trying to Enter the ISP Mode... ←[0m
*
←[32m←[1m[INFO]←[0m Greeting Message Detected, Start Downloading ISP ←[0m
←[32m←[1m[INFO]←[0m Selected Stage0 Baudrate: 1500000 ←[0m
←[32m←[1m[INFO]←[0m FT2232 mode ←[0m
Downloading ISP: |=====================================================================================| 100.0% 59kiB/s
←[32m←[1m[INFO]←[0m Booting From 0x80000000 ←[0m
←[32m←[1m[INFO]←[0m Wait For 0.1 second for ISP to Boot ←[0m
←[32m←[1m[INFO]←[0m Boot to Flashmode Successfully ←[0m
←[32m←[1m[INFO]←[0m Selected Baudrate: 3000000 ←[0m
←[32m←[1m[INFO]←[0m Baudrate changed, greeting with ISP again ... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m
←[33m←[1m[WARN]←[0m Timeout Error, retrying... ←[0m

Thanks,
Govind

@pdp7
Copy link
Author

pdp7 commented May 12, 2021

hello, i have not used this board in over a year. I suspect some things may have improved since then. Sipeed has a very active Telegram chat group https://t.me/sipeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment