Any Support for booting from Spi Flash?

For some reason, it doesn’t work, and Windows 7 tells me it doesn’t have the drivers for CDC NCM and CDC Serial devices. I must’ve called it wrong earlier.

Of course I ran the driver installer package as mentioned in the guide. But unless I find the correct driver for it, the USB download tool won’t detect the board.

Wait, why do I have to install Python, or PIP, or pyserial? I don’t get it.

well i had to install it to get serial output in ardruino. And theres another tool in buildroot sdk that uses pyserial

i’ll just give you the chinese forum link

btw did you get a partition layout xml when building the images? because this tool is asking for it?

The workstation-side tool is written in python, in ./build/tools/cv181x/usb_dl/rom_usb_dl/cv181x_uboot_usb_download.py I believe, but not 100% sure.

I don’t think this is the right tool, because it was likely made to be used for Duo S and its images. No, you can see the directory tree differs significantly, and we don’t have any additional files: seems that it wasn’t needed, the U-Boot flasher does its job somehow.

I was hoping to try that USB downloader, but now I don’t think I even need it.

@KeiKai have you tried connecting your flash chip the way @ewp mentioned it?

I was asking where I can find divers for CDC NCM and CDC Serial devices for Windows 7. I know this can go deep and bizarre ways, but I doubt that many (if any) drivers would need Python and PySerial installed on a user’s device.

It probably doesn’t work with anything earlier than Windows 10. Doesn’t change anything.

i told him that i cant use those pins since the Chip outputs logs on uart0 which the first spi controller shares pins with. SO i used the second set of spi pins but i will try it tho

I found it at last, it’s here: middleware/v2/sample/cvg/pctool/cv_usb_util. In any case I have been unable to get the Duo to enumerate, hence I used the TF card method. I do not use Windows so cannot advise on those specifics.

1 Like

There’s no UART pins on the Vcc side of the board (pins 21 thru 27). UART0 is GP12, GP13 (pins 16 and 17) on the other side of the board.

Neither do I. I only wanted to try and help KeiKai, and find out which way even works. In any case, anything we will be able to find out, will probably be somewhat useful to someone else in the end after us, lol.

I wonder why is it enough to have such a small flash memory chip to run this board with two RISC-V cores and one 8051 MCU core. Will the networking drivers even work? This thing has an Ethernet phy, but does this thing start it in this minimal SPI flash mode?

Looks like a self-contained thing: has some libusb file, some pyserial file, and calls /usr/local/python or something, which is likely a local binary built into the firmware. Or I don’t know. ;D Anyway, no idea how one would use it and why.

Ethernet absolutely works. I (and others) run full Debian by disabling ION and enabling ZRAM.

The readme file in the pctool directory has some good documentation. But yes, I think it for some other purpose in user-space. So probably not relevant here.

connecting the chip like he said still doesnt make much of difference.

Now tell me please how do you fit Debian into 8 megabytes. Please.

also on this 3. 使用 USB 烧录 — CvitekBareandNon-BareProcessorBurningUpgradeOperationGuide master 文档

it shows there is a xml file for it.

partition_emmc.xml, right?

Fun fact, there’s install/soc_cv1800b_milkv_duo_spinor/partition_spinor.xml:

<physical_partition type="spinor">
    <partition label="fip" size_in_kb="640" readonly="false" file="fip.bin"/>
    <partition label="BOOT" size_in_kb="4096" readonly="false" file="boot.spinor"/>
    <partition label="ENV" size_in_kb="64" file="" />
    <partition label="ROOTFS" size_in_kb="27968" readonly="true" file="rootfs.spinor" />
</physical_partition>

There you go.
But you will need a TF card anyway.

Finally some progress. It appears that it was truely the partition_spinor.xml that was missing.

using the same tool from here : https://github.com/milkv-duo/duo-buildroot-sdk/releases/download/Duo-V1.1.0/CviBurn_v2.0_cli_windows.zip

in terminal did this

.\usb_dl.exe -s linux -c cv180x -i .\rom

[INFO] Waiting for USB device connection: /
[INFO] found usb device vid=0x3346 pid=0x1000
[INFO] xml file is partition_spinor.xml
[INFO] xml storage type: spinor
[INFO] update total size: 21684440 byte
[INFO] downloading file: .\rom\fip.bin
[INFO] send fip.bin finish
[INFO] break

[INFO] Waiting for USB device connection:
[INFO] found usb device vid=0x3346 pid=0x1000
[INFO] downloading file: .\rom\boot.spinor
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 3579864/21684440(16%)
[INFO] downloading file: .\rom\rootfs.spinor
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 20357144/21684440(93%)
[INFO] CVI_USB_PROGRAM
[INFO] updated size: 21684312/21684440(99%)
[INFO] USB download complete

On the MCU side:

INFO: bulkBufAlloc: 0000000081bd7900
INFO: cmdBufAlloc: 0000000081bd7b40
INFO: ep0BuffAlloc: 0000000081bd7d80
INFO: setup_buf: 0000000081bd7e00
INFO: handler: 0000000081bd7e80
INFO: cb0_buf: 0000000081bd8290
INFO: cb1_buf: 0000000081bd8320
INFO: cb2_buf: 0000000081bd83b0
INFO: rsp_buf: 0000000081bd8440
INFO: acm_buf: 0000000081bd8490
NOTICE: Overwrite fip_src to FIP_SRC_USB
NOTICE: fip_src 6
NOTICE: bind()
NOTICE: Patch VID 3346
NOTICE: Patch VID 3346
NOTICE: USB enumeration done
NOTICE: connection speed: 3
No SPI flash selected. Please run sf probe' No SPI flash selected. Please run sf probe’
NOTICE: CVI_USB_PROGRAM done
No SPI flash selected. Please run sf probe' No SPI flash selected. Please run sf probe’
NOTICE: CVI_USB_PROGRAM done
No SPI flash selected. Please run sf probe' No SPI flash selected. Please run sf probe’
NOTICE: CVI_USB_PROGRAM done
NOTICE: CVI_USB_REBOOT

Now the only problem is the flash not being detected by mcu.

Well, in which connection — on the pads under the TF card, or pins 21…27, or elsewhere?