kendryte / k230_sdk

Kendryte K230 SDK
BSD 2-Clause "Simplified" License
165 stars 35 forks source link

[help]: how to boot opensbi with test payload on CanMV-k230 board #49

Closed yf13 closed 8 months ago

yf13 commented 8 months ago

Help

how can we boot opensbi with its test payload on CanMV-k230 device?

Here I can build out fw_payload.elf following little core opensbi make methods, but I don't know how to run it from within K230 u-boot console, can you please teach?

LearnigF commented 8 months ago

I think the jtag debugger would be a good solution to your problem

wangjianxin-canaan commented 8 months ago

你在uboot下 试下 boot_baremetal 命令 可以先把fw_payload.elf文件下载到内容,然后执行下类似下面命令 boot_baremetal 0 0x$fileaddr 0x$filesize;boot_baremetal 命令的详细使用方法如下

boot_baremetal boot_baremetal cpu addr size

yf13 commented 8 months ago

@wangjianxin-canaan thanks a lot. @LearnigF CanMV device doesn't support JTAG debugger. :(

wangjianxin-canaan commented 8 months ago

canMV device doesn't support JTAG debugger.

canmv default disable jtag by u-boot, you can enable jtag debuger ,and enable jtag debugger way is modify src/little/uboot/arch/riscv/dts/k230_canmv.dts file :

0001-enable-jtag.patch

yf13 commented 8 months ago

@wangjianxin-canaan which pins on CanMV230 can be used for jtag?

wangjianxin-canaan commented 8 months ago

@wangjianxin-canaan which pins on CanMV230 can be used for jtag?

uboot default disable cklink jtag,you can enable cklink jtag by modify follow code:

    #src/little/uboot/arch/riscv/dts/k230_canmv.dts gpio5 and gipi6 modify
    (IO5 ) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 0<<OE | 0<<PU | 0<<PD | 4<<DS | 0<<ST )
    (IO6 ) ( 1<<SEL | 0<<SL | BANK_VOLTAGE_IO2_IO13 <<MSC | 1<<IE | 0<<OE | 1<<PU | 0<<PD | 4<<DS | 0<<ST )
LearnigF commented 8 months ago

In fact I wonder why you don't want to use the uboot command to start opensbi。Without uboot, it means that ddr training can't be done and your code can only run on sram

yf13 commented 7 months ago

@wangjianxin-canaan thank you!

I understand that with the patched u-boot, we can connect CKLINK to pins IO5 and IO6 on CanMV-K230 for JTAG debugging.