Skip to content

Commit 110c81f

Browse files
henrikbrixandersennashif
authored andcommitted
boards: others: add candleLight USB to CAN 2.0B adapter board
Add support for the open-hardware candleLight USB to CAN 2.0B board. Signed-off-by: Henrik Brix Andersen <[email protected]>
1 parent 8e017eb commit 110c81f

File tree

8 files changed

+196
-0
lines changed

8 files changed

+196
-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 Henrik Brix Andersen <[email protected]>
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_CANDLELIGHT
5+
select SOC_STM32F072XB
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2024 Henrik Brix Andersen <[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=STM32F072CB")
6+
7+
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
8+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: candlelight
3+
full_name: candleLight
4+
vendor: others
5+
socs:
6+
- name: stm32f072xb
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
/*
2+
* Copyright (c) 2024 Henrik Brix Andersen <[email protected]>
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <st/f0/stm32f072Xb.dtsi>
10+
#include <st/f0/stm32f072c(8-b)tx-pinctrl.dtsi>
11+
12+
/ {
13+
model = "candleLight";
14+
compatible = "candlelight";
15+
16+
chosen {
17+
zephyr,sram = &sram0;
18+
zephyr,flash = &flash0;
19+
zephyr,code-partition = &slot0_partition;
20+
zephyr,canbus = &can1;
21+
};
22+
23+
aliases {
24+
led0 = &led_rx;
25+
led1 = &led_tx;
26+
};
27+
28+
leds {
29+
compatible = "gpio-leds";
30+
led_rx: led_rx {
31+
gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
32+
label = "LED RX";
33+
};
34+
led_tx: led_tx {
35+
gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;
36+
label = "LED TX";
37+
};
38+
};
39+
40+
transceiver0: can-phy0 {
41+
compatible = "nxp,tja1051", "can-transceiver-gpio";
42+
enable-gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
43+
max-bitrate = <1000000>;
44+
#phy-cells = <0>;
45+
};
46+
};
47+
48+
&clk_hsi {
49+
status = "okay";
50+
clock-frequency = <DT_FREQ_M(8)>;
51+
};
52+
53+
&pll {
54+
prediv = <1>;
55+
mul = <6>;
56+
clocks = <&clk_hsi>;
57+
status = "okay";
58+
};
59+
60+
&rcc {
61+
clocks = <&pll>;
62+
clock-frequency = <DT_FREQ_M(48)>;
63+
ahb-prescaler = <1>;
64+
apb1-prescaler = <1>;
65+
};
66+
67+
zephyr_udc0: &usb {
68+
pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
69+
pinctrl-names = "default";
70+
status = "okay";
71+
};
72+
73+
&can1 {
74+
pinctrl-0 = <&can_rx_pb8 &can_tx_pb9>;
75+
pinctrl-names = "default";
76+
phys = <&transceiver0>;
77+
status = "okay";
78+
};
79+
80+
&flash0 {
81+
partitions {
82+
compatible = "fixed-partitions";
83+
#address-cells = <1>;
84+
#size-cells = <1>;
85+
86+
boot_partition: partition@0 {
87+
label = "mcuboot";
88+
reg = <0x00000000 DT_SIZE_K(48)>;
89+
read-only;
90+
};
91+
slot0_partition: partition@c000 {
92+
label = "image-0";
93+
reg = <0x0000c000 DT_SIZE_K(80)>;
94+
};
95+
};
96+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
identifier: candlelight
2+
name: candleLight
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
- gnuarmemb
8+
ram: 16
9+
flash: 128
10+
supported:
11+
- can
12+
- gpio
13+
- usb_device
14+
- usbd
15+
vendor: others
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_GPIO=y
35.4 KB
Loading
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
.. zephyr:board:: candlelight
2+
3+
Overview
4+
********
5+
6+
The candleLight is an open-hardware USB to CAN 2.0B adapter board available from a number of
7+
sources.
8+
9+
Hardware
10+
********
11+
12+
The candleLight board is equipped with a STM32F072CB microcontroller and features an USB connector,
13+
a DB-9M connector for the CAN bus, and two user LEDs. Schematics and component placement drawings
14+
are available in the `candleLight GitHub repository`_.
15+
16+
Supported Features
17+
==================
18+
19+
The ``candlelight`` board configuration supports the following hardware features:
20+
21+
+-----------+------------+-------------------------------------+
22+
| Interface | Controller | Driver/Component |
23+
+===========+============+=====================================+
24+
| NVIC | on-chip | nested vector interrupt controller |
25+
+-----------+------------+-------------------------------------+
26+
| PINMUX | on-chip | pinmux |
27+
+-----------+------------+-------------------------------------+
28+
| FLASH | on-chip | flash memory |
29+
+-----------+------------+-------------------------------------+
30+
| GPIO | on-chip | gpio |
31+
+-----------+------------+-------------------------------------+
32+
| USB | on-chip | USB |
33+
+-----------+------------+-------------------------------------+
34+
| CAN1 | on-chip | CAN controller |
35+
+-----------+------------+-------------------------------------+
36+
37+
The default configuration can be found in the defconfig file:
38+
:zephyr_file:`boards/others/candlelight/candlelight_defconfig`.
39+
40+
Other hardware features are not currently supported by the port.
41+
42+
System Clock
43+
============
44+
45+
The STM32F072CB PLL is driven by the internal RC oscillator (HSI) running at 8 MHz and
46+
configured to provide a system clock of 48 MHz.
47+
48+
Programming and Debugging
49+
*************************
50+
51+
Build and flash applications as usual (see :ref:`build_an_application` and
52+
:ref:`application_run` for more details).
53+
54+
If flashing via USB DFU, short resistor ``R203`` when applying power to the candleLight in order to
55+
enter the built-in DFU mode.
56+
57+
Here is an example for the :zephyr:code-sample:`blinky` application.
58+
59+
.. zephyr-app-commands::
60+
:zephyr-app: samples/basic/blinky
61+
:board: candlelight
62+
:goals: flash
63+
64+
.. _candleLight GitHub repository:
65+
https://github.com/HubertD/candleLight

0 commit comments

Comments
 (0)