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.
User avatar
alex31
Posts: 418
Joined: Fri May 25, 2012 10:23 am
Location: toulouse, france
Has thanked: 53 times
Been thanked: 81 times

how to dynamically choose a driver for a given peripheral

Postby alex31 » Tue Jun 24, 2025 3:38 pm

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: 14704
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1146 times
Been thanked: 960 times

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

Postby Giovanni » Tue Jun 24, 2025 4:11 pm

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


Return to “Development and Feedback”

Who is online

Users browsing this forum: No registered users and 27 guests