sergev / LiteBSD

Variant of 4.4BSD Unix for microcontrollers
Other
308 stars 36 forks source link

RISC-V support like CH32V307 MCU #76

Open dfsxn opened 1 year ago

dfsxn commented 1 year ago

Hi,

Last year it was launched to the market the MCU CH32V307, which has the following features:

CH32V307

The CH32V305 and CH32V307 are interconnected microcontrollers, based on 32-bit RISC-V core, with hardware stack area and fast interrupt entry. Compared with standard RISC-V, the interrupt response speed is greatly improved. With single-precision float point instruction sets added and stack area extended, the CH32V305/7 has higher performance, the number of U(S)ART is extended to 8, and the number of motor timer is extended to 4. The CH32V305/7 provides USB2.0 high-speed interface (480Mbps) and has built-in PHY transceiver. Ethernet MAC is upgraded to GbE and integrates 10M PHY module.

http://www.wch-ic.com/products/CH32V307.html

Resources are available on GitHub and GitLab:

Even there's also a WCH Kicad Library on the way:

https://github.com/sad-electronics/wch-kicad-lbr

2 PCBs which are available on the market:

  1. https://www.aliexpress.com/item/1005004329125620.html
  2. https://www.aliexpress.com/item/1005004367173443.html

Could be a good option have a LiteBSD port for it?

Thank you.

Kind regards,

calmsacibis995 commented 1 year ago

I would really want to see LiteBSD being ported to other microcontrollers, as there is also apperantly a GCC toolchain for it.

sergev commented 1 year ago

The CH32V307 is nice microcontroller. Not suitable for LiteBSD though, sorry. For two reasons:

In theory, it could be possible to port RetroBSD, which does not need MMU. But 64 kbytes is not enough even for RetroBSD.

sergev commented 1 year ago

I would really want to see LiteBSD being ported to other microcontrollers, as there is also apperantly a GCC toolchain for it.

Definitely a toolchain is the #1 requirement. Another important tool is a simulator. It should be able to run binaries produced by the toolchain, and emulate a minimal set of peripherals (UART, interrupts, timer, SPI, SD card).