More information
Hi @koendv, thank you for your notes. This repository help me a lot.
I'm porting Zephyr RTOS to Hi3861. I would like to share some more information I got.
Boot
The boot process of Hi3861 consists with three parts: romboot, flashboot and kernel (user code, or the OS itself).
- The fixed romcode verifies the flashboot at
FLASH_BASE, copies it to0x10A000(which is actuallyCPU_RAM_BASE + 200KB) and executes. Since the first 64 bytes in the bootable image is the signature header, the actal entry is0x10A040 - The flashboot then verifies and boot the kernel at
FLASH_BASE + 0xD3C0
Build
A total build on LiteOS generates several images. Finaly a Hi3861_demo_allinone.bin can be import to the HiBurn tool to flash. Here is a flow chart of the build progress:

Though not documented, the signature header is simple. I've implemented one in Python: sign_bin.py
Flash
The tool OpenHisiIpCam/hiburn mentioned in your notes is not the same thing with that HiBurn.exe we used for flashing Hi3861. Though they're sharing the same name.
In fact, the protocol to flash Hi3861 is a combination of a private command procotol and Ymodem. Though the client side (HiBurn) is not open source, we can make a glance on it from the server side: loaderboot from the LiteOS/OpenHarmony SDK.
I've implemented an open source alternative too. Currently it's part of the Zephyr project. I'll rewrite a standalone script in the future.
Just like the flashboot, the entry of the loaderboot is at 0x10A040.
Toolchain
The riscv32-unknown-elf works good. The riscv64-zephyr-elf from Zephyr SDK works good too (I prefer it since it runs on my MacBook Pro :p ).
The Hi3861's CPU is actually a RISC-V Privilege CPU with instruction set extension-M plus extension-C and Zicsr. While compiling with the Zephyr GCC, -march=rv32imc should be changed to -march=rv32imc_zicsr.
Hope these informations could help.
This is interesting information, thank you. I have added your notes to the README, sometimes editing slightly. Please comment if there are errors, or omissions. Your comments represent a lot of work. I hope your Zephyr port is successful.
best, koen