CV1800B, Baremetal

Impressive! I’ve been focused on some other projects for a while and hadn’t kept up with Milk-V stuff so it’s great to see this. I’ll be trying this out on my little CV1800B audio board - it’ll be amusing to see if I can access all the peripherals that I need (SPI, I2C, I2S, ADC, GPIO) to get the full functionality. My comparisons have shown that running my audio DSP on the CV1800B under Linux wasn’t as performant as the same code running on Arm Cortex M7 at roughly 1/2 the clock speed, so it’ll be interesting to see if CV1800B bare metal runs more efficiently.

So I’ve tried out Chalandi’s bare metal repo and it works. Had some thrashing around as I learned some of the low-level coding things like memory barriers that are required on this kind of silicon, but I’ve been able to get hardware UARTs working. Interesting note - when JTAG is enabled (in the boot64.S file) that prevents UART0 from working, even when I later set the pinmuxes correctly. Not a huge deal as I can use the other UARTs, but UART0 is special in that the FSBL uses it and it’s nice to see what it spews before my code runs.

Here’s my current code.

maybe it will be helpful for others.

[edit] Having some success with adding I/O drivers. I’ve got SPI and I2C (PIO, blocking) working and will continue with I2S, onboard codec and ADC. For I2S to work properly I’ll have to figure out DMA and IRQs too so that will show up eventually. Sources all at the repo above for anyone curious.

1 Like