Porting new hardware/CPU

Hi, I am trying to port a Risc-V based development board. Apparently there is no support for CPU. Thus I want to port the CPU/SOC in RIOT but I have no idea where to start from. I am also not able to find any guide on how to do it. It will be very helpful if someone from community can provide a basic guide.

Hey, thank you for the question. The good news is that we already have some RISC-V CPUs which will most likely make it a bit easier unless the CPU you are referring to is extremely unique.

Generally there is no proper guide to porting CPUs (yet) but the easiest way to get into it is to simply copy it from another supported CPU that is using riscv_common such as the fe310.

There are also several tutorials that somewhat guide you through the process such as this HackMD and both the Blog Post and Doc Guide by Miri.

Might also help to simply reach out on Matrix for any spontaneous questions.

I wasnt allowed to post 4 links within one message so here are links to the Doc Guide and the Matrix Chat

Hi, Thanks for reply. I understood how to port board and drivers from guide. I need help in porting CPU which is currently not supported in RIOT. So I want to know how to create new CPU. And how to create cpu.c and clock.c files as i saw all supported cpu follows different coding style.

Please share which CPU and board. 80% chance someone is already working on the same, but hasn’t told anyone. @gschorcht just updated the IDF SDK, you probably need that update.

Hi, Here is the link for CPU CPU and here is a link for development board i am using Development Board.

1 Like

Dhiman via RIOT notifications@riot-os.org wrote: > Hi, Here is the link for CPU > CPU > and here is a link for development board i am using Development > Board.

Is that really an ESP32, or just another RISC-V SOC chip? It sure looks VERY similiar, but I don’t see ESP32 mentioned on the page. Maybe they licensed the IP from Xtensa? The first link says it’s unreleased, so are you actually internal to HISILICON? {fantastic either way!}