Skip to content

Commit

Permalink
Add CANFD roles
Browse files Browse the repository at this point in the history
  • Loading branch information
f0reachARR committed Oct 30, 2024
1 parent cb31b2c commit 8adbbce
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 0 deletions.
Empty file.
28 changes: 28 additions & 0 deletions ansible/roles/canfd/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
- name: Add systemd managed CAN interface
ansible.builtin.blockinfile:
path: /etc/systemd/network/80-can.network
create: true
mode: "0644"
block: |
[Match]
Name=can*
[CAN]
BitRate=500000
FDMode=yes
SamplePoint=75%
DataBitRate=4000000
DataSamplePoint=80%
RestartSec=0.5s
become: true
- name: Add CAN utils
ansible.builtin.apt:
name: can-utils
become: true
- name: Disable network wait on boot
ansible.builtin.systemd:
unit: systemd-networkd-wait-online.service
enabled: false
state: stopped
masked: true
become: true
2 changes: 2 additions & 0 deletions ansible/roles/canfd_pi/meta/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- role: autoware.dev_env.canfd
20 changes: 20 additions & 0 deletions ansible/roles/canfd_pi/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
- name: Disable serial console
ansible.builtin.replace:
path: /boot/firmware/cmdline.txt
# backup: yes
regexp: console=serial0,[0-9]+
replace: ""
become: true
- name: Enable CAN FD driver
ansible.builtin.blockinfile:
block: |
dtparam=spi=on
# Disable internal bluetooth
dtoverlay=disable-bt
dtoverlay=spi0-2cs,cs0_pin=8,cs1_pin=7
dtoverlay=mcp251xfd,spi0-0,interrupt=25,oscillator=20000000
# backup: yes
path: /boot/firmware/config.txt
become: true

0 comments on commit 8adbbce

Please sign in to comment.