Any Support for booting from Spi Flash?

Is there any support for booting from Spi flash rather than sd card?

There literally is support for booting from SPI NAND or NOR flash for Duo / Duo 256M. And from eMMC for Duo S.

I have only seen sd card images and instructions to compile and build sd card images though? so where is instructions for that?

Last time I checked, it was mentioned and documented to some extent here.

Yes, using the available documentation I created SPI NOR and NAND images one year ago and still use them alongside PXE. Working builds are in the official develop branch now. I found the simplest deployment was to unzip the upgrade.zip file onto the root of the SD card and boot from that. It will write the flash for you. For example, the Duo 64 MB SPI NOR image is created here:

install/soc_cv1800b_milkv_duo_spinor/upgrade.zip

I never got the USB flashing to succeed.

1 Like

Having trouble building the image on windows even after following the instructions and editing the required files.

i have the Duo 64 MB. And i have lots of spi flash. The sd card method works but the burning of image on the sd card can damage it and it did infact brick one of my sd cards. So now althought I can use another sd card i rather use the spi flash

Yes, that is why I use PXE boot from SPI flash. It allows faster turnaround without that issue. SBCs eat SD cards.

Feel free to try my fork which does work for both NOR and NAND on Duo and Duo 256. I cannot comment on your build system or Duo S though.

That’s really interesting to hear. How is that possible, and how does it ever differ from writing any data onto a microSD card?

microsd degrades over writes just like any other flash. But when youre developing you have to write to the flash over and over and sometimes things go wrong and it corrupts the card making it unreadable or report as have some bogus storage size like 32 MB or 64mb in some cases. The software that writes raw images warns you of this occuring.

the quality and build of the sd card plays a role also as well as insertion and reinsertion. I dont think microsd cards have any form of protection against unexpected voltages or weird behavior like shorting of pins on insertion.

Another thing is i was using a Usb to serial adapter and it only had gnd, rx and tx connected correctly to the Milk v duo. The Milk v duo somehow got power from tx line??? And the USB serial adapter has no malfunction.

It may seem surprising when devices get powered off of UART lines, it happened before and will happen in the future. Can occur because of protection diodes.

To keep it short, if you prefer SPI flash and/or have more SPI flash chips, I totally do not mind you using them. I only don’t find it appropriate to say you prefer them over other flash memory because flash memory degrades over time because of you using it — this way you make this point look ridiculous.

Bruh nothing is inappropriate. the flash chips fail at a lesser rate than microsd cards. I had to replace lots of microsd before. Plus I do repairs on electronics and I have come across many times where the sdcards just die from light use.??

The flash chips are rated for high temps and have other protections. But something like a sdcard can die even from the temperature of a mobile phones soc

While both use “Flash Storage” they use different types of flash storage

I also said that THE QUALITY can affect the failure rate of the sd card

Also ONLY on Milk v does the TX pin power the mcu. So i dont know what youre talking about that it always happens

I don’t mind if someone misunderstands me. Yet, if you do want to quote me, please just quote me. It is as easy as I just did, right?

The fact that you noticed this behaviour only with this chip doesn’t mean it is a unique thing or can’t be happening. And I told you this can happen because of how it is often designed in MCUs and maybe some other ICs.

Also, the Rx line is actually idle high, if you check it on your USB-to-TTL converter.
I totally understand that it amazes you, it is completely normal to be surprised.

Can actually build you some fresh images if you want.
I only need to know whether you want RAM in its default configuration (with some megabytes of it reserved for ION) or not.

I myself don’t have an SPI flash chip in a package slim enough to fit under the TF card, or big enough, and I’ve been fine with trying firmware images on a microSD card. Therefore, didn’t build it nor can try it myself.

So, I can build you an image with/without RAM reserved for ION, and with/without patches made for Arduino (basically, enables replacing the second core’s firmware and restarting it without the need to restart the whole board). For SPI NAND and SPI NOR flash.

like i said the uart lines powering the mcu only happens with milkv. I have esp32 , esp32 s2, esp32 s3, stm32 and even raspberry. Doesnt happen with them.

things like that dont amaze me after all i studied electronics engineering. But my question is about the software

just trying to build it for arduino with ram support. I only have nor chips.

tried to build but fails with this error:

Done in 22min 17s (error code: 2)
make: *** [Makefile:597: br-rootfs-pack] Error 2
Error: Build board milkv-duo-spinor failed!

You mean with the default RAM config and like half the RAM reserved for ION?
I think «Arduino support» is a useful thing anyway, although I’m not planning to use this board with Arduino ever.

If I get you right, default RAM + Arduino support + NOR.

Yeh . i mean i mostly bought it for use with arduino. if Baremetal was well documented and fully supported like how STMicroelectronics does it. Id have gone that route

I don’t think I will be able to reproduce and debug this error. Sometimes only starting the whole process from scratch can fix problems that appeared after a while. Happened to me a couple of times.

As I said before, I’m trying to build it for you, since it seems to me this can help you for now. And this should be the true purpose of this tiny community anyway, as I see it.

Decided to build both NAND and NOR versions (with ION disabled) before you replied. Usually takes something around 30 to 50 minutes to build the firmware.

So do you have a flash chip so slim that it can fit under the microSD card on the board? Because it says you have to format your microSD card in FAT32, copy those files there, so that the U-Boot formats and writes it to the flash chip. Although, I think you will be able to program it via USB, since there’s some tool for it.

…still building. Will be back a bit later.

Here are two SPINOR versions.

For some reason, SPINAND image contains one more partition file.

1 Like