The main reason of this was to read/write the flash for backup/restore purposes.
But what gives booting a system with just a console? You either want:
- Enable the console in the original system
- Enable flash access in the ram boot system.
I dropped this due few reasons.
My intention was to provide direct access to the host, so it would see it as a storage device, allowing simple access with dd, fdisk and such tools.
After adding spi-nand partitions in the kernel DTS, it recogniced it. But that was the easy part.
The usb storage gadget can't directly access storage devices, you can only bind files to it. So it's a shame.
MTP can't access system devices either.
Also I found that it doesn't allow multiple gadgets at once.
So you can run MTP, mass storage, ECM, ACM... but not two at the same time.
However you can make multiple instances for the same type, ex. 2x serial ports, or 2 mass storage devices.
The linux theory says it's possible, the ***** Allwinner kernel support seems to say the opposite.
The only workaround coming to my mind is using a daemon-based method and MTP.
So you write anything to /tmp, ex. "boot.bin", and after that a "run.sh" file with the commands to be remotely executed by the daemon.
But got more more issues. dd was extremely slow and didn't write correctly.
mtd was much faster, but also gave some problems which I don't remember. Furthermore, it can't write applyong an offset, so you can't write to big partitions in multiple chunks..
A workaround would be to split the nand in 16MB partitions (in DTS config), so you'll have 8 partitions, and no problem to that size in the ram.
You don't really care about the partitions (They will not be mounted), it's just a cheap method to split the nand in more manageable sizes.
But I lost my patience some weeks ago. Maybe I'll give another try some day...
I've also used Z-modem extensively with this system, to transfer small files when compiling or testing patches, much faster than removing the drive/plug into the host, copy the file, plug back...
The serial port works nicely up to 3Mbit. But my ESP8266 serial-wifi bridge loses packets at that speed when you flood it with data.
When stopping the phoenix process, it works nice up to 2Mbits, which is actually pretty fast (10MB takes 1minute), but when it's running, the hantek can't keep up with the incoming data, in that case only 460.800bps works reliably.
The screen is another crap from hell thing!
So good luck!