---
title: "Atelier CAN"
date: "02-11-2021"
link: "https://hackmd.io/2HOIHzp7RNW6il3JGaN7CQ"
tags: EVOLUTEK
---
# Atelier CAN
## Etapes
~~* Communication Raspy - Dongle en CAN Brute~~
~~* Communication STM32 - Dongle en CAN Brute~~
~~* Communication Raspy - STM32 en CAN Brute~~
~~* Echo STM32 - Raspy CAN Brute~~
* Test de UAVCAN sur Raspy
* Test de UAVCAN sur STM32
* POC communication
## Dongle USB
Configuration du dongle :
```
sudo apt install can-utils
sudo slcand -o -c -s6 /dev/ttyACMn can0
ip link set can0 up
candump can0
```
## CAN Brute
### Descriptions
UAVCAN is a layered composition of three decoupled parts: the **application layer**, the **presentation layer**, and the **transport layer** (the physical layer is purposefully omitted).
The application layer defines some generic high-level functions and concepts that are expected to be useful in different application domains, like diagnostics, configuration, basic physical quantities, etc.
The presentation layer is modeled by DSDL, meaning data structure description language, which describes data formats and how that data is to be serialized and interpreted.
The transport layer determines how to transfer serialized data structures over the network.
#### Application

#### Presentation
(https://github.com/UAVCAN/public_regulated_data_types)
#### Transport
The following diagram summarizes the key ideas of a UAVCAN-based publish-subscribe system:

### Test sur Raspy
### Test sur STM32
### Test Raspy - STM32
## UAVCAN
### Description
### Test sur Raspy
### Test sur STM32
### POC de communication
## Ressources
### Dongle USB
* https://canine.readthedocs.io/en/latest/canine.html#hardware-configuration
### Raspy
* https://www.hackster.io/youness/how-to-connect-raspberry-pi-to-can-bus-b60235
### STM32
* http://wiki.labaixbidouille.com/index.php/Mise_en_place_d%27un_bus_CAN
* https://controllerstech.com/can-protocol-in-stm32/
* https://github.com/AREA-Amiens/AREA.old-boards-firmware/blob/master/pump-board-v1-firmware/Core/Src/main.c
### UAVCAN
* https://uavcan.org/
* https://pyuavcan.readthedocs.io/en/stable/
* https://forum.uavcan.org/t/the-uavcan-guide/778
* https://cvra.ch/robot-software/howto/add_a_uavcan_message/
* https://github.com/cvra/uavcan