# Libcanard on chibios

**URL:** <https://forum.opencyphal.org/t/libcanard-on-chibios/199>\
**Category:** Libcanard\
**Created:** [October 17, 2018, 7:24am UTC](https://forum.opencyphal.org/t/libcanard-on-chibios/199 "2018-10-17T07:24:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![skyyuzhang](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/skyyuzhang/32/65_2.png) [@skyyuzhang](https://forum.opencyphal.org/u/skyyuzhang)\
**Post date:** [October 17, 2018, 7:24am UTC](https://forum.opencyphal.org/t/libcanard-on-chibios/199/1 "2018-10-17T07:24:12Z")

</div>

if I want to using libcanard on chibios with stm32f103 how do I initialize canbus hardware

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 17, 2018, 3:52pm UTC](https://forum.opencyphal.org/t/libcanard-on-chibios/199/2 "2018-10-17T15:52:55Z")

</div>

> <https://github.com/UAVCAN/libcanard/blob/9d2e2904d25c0df10dc78a17ba915cdb13d54292/drivers/stm32/canard_stm32.h#L111-L132>

---

<div class="post-metadata">

**Author:** ![skyyuzhang](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/skyyuzhang/32/65_2.png) [@skyyuzhang](https://forum.opencyphal.org/u/skyyuzhang)\
**Post date:** [October 18, 2018, 11:38am UTC](https://forum.opencyphal.org/t/libcanard-on-chibios/199/3 "2018-10-18T11:38:11Z")

</div>

should I do some specific driver on chibios ? I mean when using libcanard on no rtos we should do hwInit(); which include RCC\_APB1PeriphClockCmd() and GPIO\_PinAFConfig. so on chibios what should we do like RCC\_APB1PeriphClockCmd() or nothing to do

---

<div class="post-metadata">

**Author:** ![pavel.kirienko](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/pavel.kirienko/32/9_2.png) [@pavel.kirienko](https://forum.opencyphal.org/u/pavel.kirienko)\
**Post date:** [October 18, 2018, 1:05pm UTC](https://forum.opencyphal.org/t/libcanard-on-chibios/199/4 "2018-10-18T13:05:51Z")

</div>

With ChibiOS you only need to enable the clock signal to the CAN controller, that’s it. Here are relevant examples:

> <https://github.com/Zubax/zubax_gnss/blob/81d55f2c83cbc95e71cfc86b2c86173ebbaec480/bootloader/src/board/board.cpp#L262-L274>

> <https://github.com/Zubax/zubax_gnss/blob/master/bootloader/src/board/can.hpp>
