Port Layer and Hal - Porting to a new architecture

Discussions and support about ChibiOS/RT, the free embedded RTOS.
eshton
Posts: 5
Joined: Fri Oct 27, 2017 10:50 am
Has thanked: 2 times

Port Layer and Hal - Porting to a new architecture

Postby eshton » Mon Oct 30, 2017 10:00 am

Hello,

I've been reading the docs and tutorials for getting started wtih chibios and the rt kernel and they all mention a port layer in the kernel that needs to
be written in order to complete a port, So much so that Hal itself depends on it. However in the latest stable code there are no templates or port directroy and no recent documentation is available with some basic explanation of what a new port entails. So I'd like know if the port layer is still something necessary for new arch or is that all rolled into Hal?

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Port Layer and Hal - Porting to a new architecture

Postby Giovanni » Mon Oct 30, 2017 10:22 am

Hi,

RT and HAL are separate entities, if you need to port HAL then there are templates of LLD drivers to be implemented, an existing HAL port can be used as example.

Porting RT is a different matter, you don-t need to do this unless your micro does not use one of the supported architectures.

Giovanni

eshton
Posts: 5
Joined: Fri Oct 27, 2017 10:50 am
Has thanked: 2 times

Re: Port Layer and Hal - Porting to a new architecture

Postby eshton » Mon Oct 30, 2017 10:37 am

I'm porting an in-house risc v core which I believe is not supported so that would mean I need to develop a port layer. That said, writing a port layer still is rather mysterious since I haven't found any recent documentation. The latest porting guide I found is from version 2.x which is rather old imo.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Port Layer and Hal - Porting to a new architecture

Postby Giovanni » Mon Oct 30, 2017 11:27 am

Hi,

Ports didn't change much, I recommend you start from the one closest to your architecture, probably e200 or ARM. Does the architecture support a separate stack for IRQs? this is a bit harder to support correctly.

Giovanni

eshton
Posts: 5
Joined: Fri Oct 27, 2017 10:50 am
Has thanked: 2 times

Re: Port Layer and Hal - Porting to a new architecture

Postby eshton » Tue Oct 31, 2017 9:33 am

Hi,

The architecture doesn't have a separate IRQ stack to work with. I'll have a look at the e200 port and work from that.
Thanks.

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Port Layer and Hal - Porting to a new architecture

Postby Giovanni » Tue Oct 31, 2017 9:36 am

The e200 port should be very close to what you need, almost 1:1.

Just take care to define the intctx and extctx structures correctly (function-trashed registers and IRQ context).

Giovanni


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 2 guests