Skip to content

Commit 0950aa4

Browse files
sknseankartben
authored andcommitted
boards: others: add candleLightFD USB to CAN FD adapter board
Add support for the open-hardware candleLight FD USB to CAN FD board. Signed-off-by: Sean Nyekjaer <[email protected]>
1 parent 7857599 commit 0950aa4

11 files changed

+279
-0
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2024 Sean Nyekjaer <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_CANDLELIGHTFD
5+
select SOC_STM32G0B1XX
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2024 Sean Nyekjaer <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board_runner_args(dfu-util "--pid=0483:df11" "--alt=0" "--dfuse")
5+
board_runner_args(jlink "--device=STM32G0B1CB")
6+
7+
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
8+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/others/candlelightfd/board.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
board:
2+
name: candlelightfd
3+
full_name: candleLightFD
4+
vendor: others
5+
socs:
6+
- name: stm32g0b1xx
7+
variants:
8+
- name: 'dual'
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
* Copyright (c) 2024 Sean Nyekjaer <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <st/g0/stm32g0b1Xb.dtsi>
8+
#include <st/g0/stm32g0b1r(b-c-e)tx-pinctrl.dtsi>
9+
10+
/ {
11+
chosen {
12+
zephyr,sram = &sram0;
13+
zephyr,flash = &flash0;
14+
zephyr,code-partition = &slot0_partition;
15+
zephyr,canbus = &fdcan1;
16+
};
17+
18+
aliases {
19+
led0 = &led_rx;
20+
led1 = &led_tx;
21+
};
22+
23+
leds {
24+
compatible = "gpio-leds";
25+
led_rx: led_rx {
26+
gpios = <&gpioa 3 GPIO_ACTIVE_LOW>;
27+
label = "LED RX";
28+
};
29+
led_tx: led_tx {
30+
gpios = <&gpioa 4 GPIO_ACTIVE_LOW>;
31+
label = "LED TX";
32+
};
33+
};
34+
35+
transceiver0: can-phy0 {
36+
compatible = "nxp,tja1051", "can-transceiver-gpio";
37+
enable-gpios = <&gpioa 15 GPIO_ACTIVE_LOW>;
38+
max-bitrate = <5000000>;
39+
#phy-cells = <0>;
40+
};
41+
};
42+
43+
&clk_hse {
44+
status = "okay";
45+
clock-frequency = <DT_FREQ_M(8)>;
46+
};
47+
48+
&clk_hsi48 {
49+
status = "okay";
50+
crs-usb-sof;
51+
};
52+
53+
&pll {
54+
div-m = <1>;
55+
mul-n = <30>;
56+
div-p = <2>;
57+
div-q = <3>;
58+
div-r = <4>;
59+
clocks = <&clk_hse>;
60+
status = "okay";
61+
};
62+
63+
&rcc {
64+
clocks = <&pll>;
65+
clock-frequency = <DT_FREQ_M(60)>;
66+
ahb-prescaler = <1>;
67+
apb1-prescaler = <1>;
68+
};
69+
70+
zephyr_udc0: &usb {
71+
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
72+
pinctrl-names = "default";
73+
status = "okay";
74+
};
75+
76+
&fdcan1 {
77+
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00001000>,
78+
<&rcc STM32_SRC_PLL_Q FDCAN_SEL(1)>;
79+
pinctrl-0 = <&fdcan1_rx_pd0 &fdcan1_tx_pd1>;
80+
pinctrl-names = "default";
81+
phys = <&transceiver0>;
82+
status = "okay";
83+
};
84+
85+
&flash0 {
86+
partitions {
87+
compatible = "fixed-partitions";
88+
#address-cells = <1>;
89+
#size-cells = <1>;
90+
91+
boot_partition: partition@0 {
92+
label = "mcuboot";
93+
reg = <0x00000000 DT_SIZE_K(48)>;
94+
read-only;
95+
};
96+
slot0_partition: partition@c000 {
97+
label = "image-0";
98+
reg = <0x0000c000 DT_SIZE_K(80)>;
99+
};
100+
};
101+
};
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (c) 2024 Sean Nyekjaer <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include "candlelightfd.dtsi"
10+
11+
/ {
12+
model = "candleLight FD";
13+
compatible = "candlelightfd";
14+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: candlelightfd/stm32g0b1xx
2+
name: candleLightFD
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 144
9+
flash: 128
10+
vendor: others
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Enable MPU
2+
CONFIG_ARM_MPU=y
3+
4+
# Enable HW stack protection
5+
CONFIG_HW_STACK_PROTECTION=y
6+
7+
# Enable GPIO
8+
CONFIG_GPIO=y
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (c) 2024 Sean Nyekjaer <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include "candlelightfd.dtsi"
10+
11+
/ {
12+
model = "candleLight FD Dual";
13+
compatible = "candlelightfd";
14+
15+
transceiver1: can-phy1 {
16+
compatible = "nxp,tja1051", "can-transceiver-gpio";
17+
enable-gpios = <&gpiob 2 GPIO_ACTIVE_LOW>;
18+
max-bitrate = <5000000>;
19+
#phy-cells = <0>;
20+
};
21+
};
22+
23+
&fdcan2 {
24+
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00001000>,
25+
<&rcc STM32_SRC_PLL_Q FDCAN_SEL(1)>;
26+
pinctrl-0 = <&fdcan2_rx_pb0 &fdcan2_tx_pb1>;
27+
pinctrl-names = "default";
28+
phys = <&transceiver1>;
29+
status = "okay";
30+
};
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
identifier: candlelightfd/stm32g0b1xx/dual
2+
name: candleLightFD Dual
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 144
9+
flash: 128
10+
vendor: others
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Enable MPU
2+
CONFIG_ARM_MPU=y
3+
4+
# Enable HW stack protection
5+
CONFIG_HW_STACK_PROTECTION=y
6+
7+
# Enable GPIO
8+
CONFIG_GPIO=y

0 commit comments

Comments
 (0)