# Libcanard for UAVCAN/CAN v1 is released

**URL:** <https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774>\
**Category:** Libcanard\
**Created:** [March 8, 2020, 4:07am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774 "2020-03-08T04:07:49Z")\
**Posts on this page:** 20\
**Page:** 1

<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:** [March 8, 2020, 4:07am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/1 "2020-03-08T04:07:49Z")

</div>

Libcanard v0.100, implementing UAVCAN/CAN v1, is now available:

> **[GitHub - OpenCyphal/libcanard: A compact implementation of the UAVCAN/CAN...](https://github.com/OpenCyphal/libcanard)**
>
> A compact implementation of the UAVCAN/CAN protocol in C for high-integrity real-time embedded systems - GitHub - OpenCyphal/libcanard: A compact implementation of the UAVCAN/CAN protocol in C for ...

Key features:

- Full test coverage and static analysis.
- Partial compliance with automatically enforceable MISRA C rules (compliance report not available).
- Detailed time complexity and memory requirement models for the benefit of real-time high-integrity applications.
- Purely reactive API without the need for background servicing.
- Support for CAN FD.
- Support for redundant transports.
- Compatibility with 8/16/32/64-bit platforms.
- The API operates on contiguous memory buffers [instead of scattered linked blocks](https://forum.opencyphal.org/t/canardrxtransfer-payload-reading/600).
- Compatibility with extremely resource-constrained baremetal environments starting from ca. 32K ROM, 4…8K RAM.
- Implemented in less than 1500 logical lines of code.

API stabilization is expected by 2020Q4 or earlier. Starting now, it is expected to be safe to commence a new project reliant on UAVCAN v1.0 based on Libcanard and/or PyUAVCAN. Libuavcan v1 (a major C++11 implementation) and Yukon (the new GUI tool) are expected to become available before the end of 2020.

---

<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:** [March 8, 2020, 4:08am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/2 "2020-03-08T04:08:58Z")

</div>



---

<div class="post-metadata">

**Author:** ![rreignier](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/r/ec9cab/32.png) [@rreignier](https://forum.opencyphal.org/u/rreignier)\
**Post date:** [March 8, 2020, 7:25pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/3 "2020-03-08T19:25:29Z")

</div>

That’s great news! Congratulations for the awesome work.

I have noticed that the drivers have disappeared, do you plan to move them to a separate repo?

---

<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:** [March 9, 2020, 4:45pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/4 "2020-03-09T16:45:21Z")

</div>

> [@rreignier](#):
>
> That’s great news! Congratulations for the awesome work.

Thanks!

> [@rreignier](#):
>
> I have noticed that the drivers have disappeared, do you plan to move them to a separate repo?

Yeah. I just updated the README to make it clearer. The new place is here:

> **[GitHub - OpenCyphal-Garage/platform\_specific\_components: Low-level components and hardware drivers for...](https://github.com/OpenCyphal-Garage/platform_specific_components)**
>
> Low-level components and hardware drivers for various Cyphal-related projects

As of right now, it is quite empty, so please navigate to the branch `legacy-v0` – the code there is intended for the old version of the library but the changes necessary for its adaptation for the new Libcanard are quite minimal. I am going to migrate the driver for STM32 and SocketCAN in the short order. Speaking of SocketCAN, it’s going to be available for NuttX soon as well: [SocketCAN API on a RTOS](https://forum.opencyphal.org/t/socketcan-api-on-a-rtos/750).

---

<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:** [September 5, 2020, 9:09pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/5 "2020-09-05T21:09:24Z")

</div>

11 posts were split to a new topic: [Libcanard usage questions](https://forum.opencyphal.org/t/libcanard-usage-questions/933)

---

<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:** [April 21, 2020, 10:42am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/8 "2020-04-21T10:42:36Z")

</div>



---

<div class="post-metadata">

**Author:** ![PetervdPerk](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/p/bbe5ce/32.png) [@PetervdPerk](https://forum.opencyphal.org/u/PetervdPerk)\
**Post date:** [April 21, 2020, 12:44pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/10 "2020-04-21T12:44:36Z")

</div>

Is there a particular reason why canardRxAccept and rxSessionUpdate does not return the error codes which are the cause of the problem while in the code the cause is clear?

For example:

```auto
canardRxAccept 
canard.c:1054 out = 0; // No matching subscription.
canard.c:1059 out = 0; // Mis-addressed frame (normally it should be filtered out by the hardware).
canard.c:1064 out = 0; // A non-UAVCAN/CAN input frame.

```

```auto
rxSessionUpdate 
canard.c:835 if (correct_transport && correct_toggle && correct_tid)

```

---

<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:** [April 21, 2020, 1:44pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/11 "2020-04-21T13:44:14Z")

</div>

> [@PetervdPerk](#):
>
> Is there a particular reason why canardRxAccept and rxSessionUpdate does not return the error codes which are the cause of the problem while in the code the cause is clear?

Because the states you mentioned are not errors.

> [@Libcanard usage questions](https://forum.opencyphal.org/t/libcanard-usage-questions/933/3):
>
> okay, since i developed version1 canard for mpc micro-controller do i need any zubax babel (as recommended for version 0)for testing purpose or i can test as explained in README.

You can use any CAN hardware. Our libraries are platform-agnostic.

---

<div class="post-metadata">

**Author:** ![hugo](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/h/b38774/32.png) [@hugo](https://forum.opencyphal.org/u/hugo)\
**Post date:** [August 30, 2020, 7:07pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/20 "2020-08-30T19:07:35Z")

</div>

There used to be a demo that with some effort could be compiled and executed. Is an akin demo that will work with v1? Will it be included as part of the socketcan tests?

---

<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:** [August 31, 2020, 11:47am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/21 "2020-08-31T11:47:51Z")

</div>

Hi Hugo! There is no such thing at the moment, but we would welcome it emphatically if one created it independently (in a separate repo). At the moment all we have to offer in this sense is:

- The demo given in the Libcanard README (it’s not a complete example but it’s better than nothing).
- This demo for GNU/Linux SocketCAN (download the file): [Automatic configuration of port identifiers](https://forum.opencyphal.org/t/automatic-configuration-of-port-identifiers/840/3)

---

<div class="post-metadata">

**Author:** ![hugo](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/h/b38774/32.png) [@hugo](https://forum.opencyphal.org/u/hugo)\
**Post date:** [September 4, 2020, 2:34pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/22 "2020-09-04T14:34:00Z")

</div>

hey… I have created two example node repos (url upon request since the url might change). One node just listens to the heartbeat while another only produces a heatbeat. Next step for me is to create a template repo of a basic node project for vscode with the idea of slowly adding code to implement different sections of Chapter 5 of the UAVCAN Specification. I would like to petition that the code be part of the UAVCAN repo? If not I will be happy to host it at github. Please advise.

---

<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:** [September 4, 2020, 5:33pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/23 "2020-09-04T17:33:16Z")

</div>

Great stuff, Hugo. I’ve looked at [GitHub - hugo-a-garcia/uavcan-c-example · GitHub](https://github.com/hugo-a-garcia/uavcan-c-example) and [GitHub - hugo-a-garcia/uavcan-c-node · GitHub](https://github.com/hugo-a-garcia/uavcan-c-node) and it seems promising.

 ![image](https://forum.opencyphal.org/uploads/default/original/1X/cd4a4bdac745258d4fa94cbb52e0ae74311b1eae.jpeg)

Our general unspoken policy was to keep only the core software components under the UAVCAN repo: implementation libraries, DSDL, the spec, core tools, the website, and such. We cut down even on the [platform-specific drivers](https://forum.opencyphal.org/t/platform-specific-components/768/5), removing the multiple repos and dumping everything into one place to keep the organization well-focused on the things of primary importance instead of some hardware-specific nuance. The story of examples is identical to that: we have separate v0 demos maintained by third parties (if you search the Web you will find many) but none by the dev team. I am inclined to keep it this way.

However, this is suboptimal in the sense of discoverability: unless you advertise your examples feverishly, people may fail to find them, and nobody would benefit. So I suggest that we set up a sticked wiki-post on this forum (in this very category because your demos are libcanard-based) that any regular visitor could edit to keep it up-to-date with links to existing demos, unofficial tutorials, and similar useful things out there. If you are okay with that, please go ahead and kickstart that wiki post here.

I think @aentinger and @TSC21 should be aware of this discussion.

---

<div class="post-metadata">

**Author:** ![aentinger](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/aentinger/32/1428_2.png) [@aentinger](https://forum.opencyphal.org/u/aentinger)\
**Post date:** [September 7, 2020, 6:44am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/24 "2020-09-07T06:44:01Z")

</div>

Good morning 👋 ☕

Great work 🚀 Easy compilable and executable examples will make it easier for any novice to tip their toes into UAVCAN development. Therefore I heartily endorse Pavel’s suggestion of setting up a sticky post gathering relevant code examples.

I believe [107-Arduino-UAVCAN](https://github.com/107-systems/107-Arduino-UAVCAN), an Arduino library providing an abstract and simple to use UAVCAN interface, might also be a relevant entry to that example page. I’m not sure if you got to open such a page yet, since @pavel.kirienko is most familiar with this forum and it’s configuration I’d ask him to setup the page which then we can fill with content.

Cheers, Alex

---

<div class="post-metadata">

**Author:** ![hugo](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/h/b38774/32.png) [@hugo](https://forum.opencyphal.org/u/hugo)\
**Post date:** [September 7, 2020, 7:35am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/25 "2020-09-07T07:35:01Z")

</div>

Done…

Here is the new topic to help us learn and teach:

> [@Libcanard: Examples, Starters, Tutorials](https://forum.opencyphal.org/t/examples-starters-tutorials-and-open-source-libraries/935):
>
> Good day slight_smile This topic is dedicated to collect and provide links supplied by the community. What you will find here are: Examples: Gists, posts links to other forum like Stack Overflow which present a whole solution or partial solution. Starters: for example a Github template project to get you started. Tutorials: Full explanations like those found in Instructables or Medium and/or videos in YouTube. Open Source Libraries: what better examples than a whole open source library or i…

---

<div class="post-metadata">

**Author:** ![aentinger](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/aentinger/32/1428_2.png) [@aentinger](https://forum.opencyphal.org/u/aentinger)\
**Post date:** [September 7, 2020, 10:14am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/26 "2020-09-07T10:14:59Z")

</div>

Thank you 😉 I shall proceed to add a suitable post immediately.

---

<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:** [September 7, 2020, 3:11pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/27 "2020-09-07T15:11:15Z")

</div>

Thanks Hugo. I took the liberty to rename the topic into “Libcanard: Examples, Starters, Tutorials”, otherwise it looks ambiguous on the front page.

Are you going to add your examples there soon?

---

<div class="post-metadata">

**Author:** ![hugo](https://forum.opencyphal.org/letter_avatar_proxy/v4/letter/h/b38774/32.png) [@hugo](https://forum.opencyphal.org/u/hugo)\
**Post date:** [September 7, 2020, 8:06pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/28 "2020-09-07T20:06:13Z")

</div>

I will add them by the end of the week. Currently working on the platform-specific component(PSC) for Arduino AVR. I already have an .ino sending a heartbeat (turning on the LED too) using a timer interrupt on an Arduino Mega. . Going to use the " MCP\_CAN Library for Arduino" by Corey Fowler (unless someone has a better suggestion?) in combination with code from the libcanard/socketcan PSC to produce a basic libcanard/avrcan PSC. I will also look at the avr driver from v0.

Thus having a C template project for Linux and a C template project for Arduino AVR.

---

<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 12, 2020, 10:03pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/29 "2020-10-12T22:03:03Z")

</div>

**Libcanard v1.0.0** is now (finally) available. The road from the first commit to the first stable release took about five years, so this is a major milestone for us.

> **[Release v1.0 · OpenCyphal/libcanard](https://github.com/OpenCyphal/libcanard/releases/tag/1.0.0)**
>
> The first stable release of Libcanard supporting UAVCAN/CAN v1.0.

You can see the diffs from the previous release (announced in the OP post half a year ago) here: [Comparing 0.100...1.0.0 · OpenCyphal/libcanard · GitHub](https://github.com/UAVCAN/libcanard/compare/0.100...1.0.0)

---

<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 20, 2020, 5:59pm UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/30 "2020-10-20T17:59:23Z")

</div>

Here is the **migration guide** from Libcanard v0.100 to the stable v1.0.0. It is super short:

1. Update your subject-ID idenfiers by clearing the two most significant bits. The maximum subject-ID was 32767 (15 bits), it was contracted down to **8191** (13 bits) in the Specification v1.0-beta. For example, the subject-ID of 32085 (0x7d55) would become 7509 (0x1d55). Notice that in many cases, this change does not really affect wire compatiblity between v0.100 and v1.0.0 (unless low subject-ID values are used) because the two removed bits are set to 1 when transmitting and ignored when receiving. This is now stabilized in Specification.

2. When creating new subscriptions, the parameter `extent` should contain the extent of the data type, not just the maximum size of the object. Here is the explanation from the docs:

---

<div class="post-metadata">

**Author:** ![Cherish-forever](https://forum.opencyphal.org/user_avatar/forum.opencyphal.org/cherish-forever/32/802_2.png) [@Cherish-forever](https://forum.opencyphal.org/u/Cherish-forever)\
**Post date:** [November 11, 2020, 4:11am UTC](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774/31 "2020-11-11T04:11:19Z")

</div>

That great!  
but libuavcan v1.0 has not been released.

[Next page](https://forum.opencyphal.org/t/libcanard-for-uavcan-can-v1-is-released/774.md?page=2)
