I can compile Release Duo-V1.0.9 · milkv-duo/duo-buildroot-sdk · GitHub to generate milkv-duo-v1.0.9-2024-0226.img but not arduino-milkv-duo-v1.0.9-2024-0228.img. No documentation on the release page about how the arduino capable image was generated.
I manage to swap out arduino.elf live
The Arduino code is compiled and then click sketch > export compiled library which then generates an elf file in the code directory. Use scp to transfer different elf versions to the root directory.of the duo.
Check if something is running on the small core: cat /sys/class/remoteproc/remoteproc0/state
If something is running stop it with: echo stop > /sys/class/remoteproc/aremoteproc0/state
Check again if the second core has gone offline.
Then copy your_arduino.elf to /lib/firmware/
Then run sync to ensure file is written to TFCard
Then tell the second core which elf file to run: echo your_arduino.elf > /sys/class/remoteproc/remoteproc0/firmware
Then tell the second core to start: echo start > /sys/class/remoteproc/remoteproc0/state
Check it is running with cat /sys/class/remoteproc/remoteproc0/state
Although that all works, if the board is rebooted, the elf filename mentioned in /sys/class/remoteproc/remoteproc0/firmware defaults to arduino.elf. So you could overwrite /lib/firmware/arduino.elf with your firmware and it will run correctly on reboot as well.
Very curious how arduino-milkv-duo-v1.0.9-2024-0228.img was compiled to change behaviour.
Hi,
You either execute git checkout arduino
(select that arduino
branch via Git CLI or Git GUI of your choice), or you can start your own branch and cherry-pick commits from this branch; or you can select that branch in the web UI on GitHub, hit Code and then Download ZIP — whichever way you prefer.
Bon voyage.
1 Like
- Commit
7221d23254b821b1bd418fad75c303f84739b857
of that branch adds support for remote control.
- Commit
5c0bf3e4d1288cce75eaac8e4ae951087ce40f42
makes the first core’s OS script load /lib/firmware/arduino.elf
if it exists on the filesystem.
Therefore, you know which file you need to replace to make your changes persistent.
2 Likes
Thank you hannahKoban.
I did git clone GitHub - milkv-duo/duo-buildroot-sdk: Milk-V Duo Official buildroot SDK
cd duo-buildroot-sdk
git branch
git checkout arduino
Then I compiled it, but the image did not have USB ACM device driver enabled to allow Arduino IDE to program it via USB.
Then I did git checkout 5c0bf3e4d1288cce75eaac8e4ae951087ce40f42
and recompiled. That had the ACM driver enabled so I go with that version for now to figure out the rest.
By chance, would you know reason why the USB ACM driver is disabled in most current release of arduino branch? Seems illogical to disable it like that.
1 Like
Do you think they disabled it for some reason?
You can run git diff 5c0bf3e4d1288cce75eaac8e4ae951087ce40f42 origin/arduino
to see what’s changed for yourself, and I don’t see them disabling it.
I’ll be back after building the current arduino
branch and trying it on my board.
Am I getting it right, and you’re experimenting with Duo 64M (CV1800B SoC)?
I thought I best ask if anyone knows in case the reason was intentional and cannot be resolved right now. But if it should be working, I try checking git log and compile again for the Duo 64M.
Update: I checked now - seems most up to date branch of arduino is OK. I must have made some mistake with previously compiled images. Thank you.
1 Like