how to dynamically choose a driver for a given peripheral

This forum is dedicated to feedback, discussions about ongoing or future developments, ideas and suggestions regarding the ChibiOS projects are welcome. This forum is NOT for support.
Post Reply
User avatar
alex31
Posts: 445
Joined: Fri May 25, 2012 10:23 am
Has thanked: 57 times
Been thanked: 88 times

how to dynamically choose a driver for a given peripheral

Post by alex31 »

Hello,

I'm developing firmware for a UAVCAN proxy card that can fulfill multiple roles, which are selected via configuration parameters stored in an external EEPROM.

Many of these roles rely on libraries written years ago. I'm facing a conflict where one role uses USART2 with the SD driver, while another uses USART2 with the UART driver. Each driver is well-suited to its specific role.

I’ve already implemented a dynamic resource manager that guarantees no two roles using the same hardware resource can be selected at the same time. Because of that, I don’t need the static resource conflict checks enforced by ChibiOS.

Is there any way to bypass those checks — a sort of “trust me, I’m an engineer” mode? ;)

If not, I guess I’ll need to migrate the legacy SD-based code to use UARTD... but I have better plans for this summer !

No "ask chatgpt to migrate the code" will be accepted :D
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: how to dynamically choose a driver for a given peripheral

Post by Giovanni »

Hi,

There would be conflicts because statically defined ISRs, it is not possible without significant changes.

You could use the new SIO driver, it can replace both SD and UART, not available yet for USARTv1 however.

Giovanni
Post Reply