<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[M5 Dial V1.1 CAN bus]]></title><description><![CDATA[<p dir="auto">I am trying to use a Dial with an Isolated CAN bus unit connected to port a, to read CAN Messages.</p>
<p dir="auto">I'm using Arduino IDE 2.3.5 but I'm getting these compile errors.</p>
<p dir="auto">In file included from C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_reg.h:20,<br />
from c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:38:<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c: In function 'CAN_init':<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:173:33: error: 'DPORT_PERIP_CLK_EN_REG' undeclared (first use in this function); did you mean 'SYSTEM_PERIP_CLK_EN1_REG'?<br />
173 |         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);<br />
|                                 ^~~~~~~~~~~~~~~~~~~~~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:67: note: in definition of macro '_DPORT_WRITE_PERI_REG'<br />
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (*((volatile uint32_t <em>)(addr))) = (uint32_t)(val)<br />
|                                                                   ^~~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:90:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'<br />
90 | #define DPORT_SET_PERI_REG_MASK(reg, mask)   DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))<br />
|                                              ^~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:173:9: note: in expansion of macro 'DPORT_SET_PERI_REG_MASK'<br />
173 |         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);<br />
|         ^~~~~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:173:33: note: each undeclared identifier is reported only once for each function it appears in<br />
173 |         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);<br />
|                                 ^~~~~~~~~~~~~~~~~~~~~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:67: note: in definition of macro '_DPORT_WRITE_PERI_REG'<br />
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (</em>((volatile uint32_t <em>)(addr))) = (uint32_t)(val)<br />
|                                                                   ^~~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:90:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'<br />
90 | #define DPORT_SET_PERI_REG_MASK(reg, mask)   DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))<br />
|                                              ^~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:173:9: note: in expansion of macro 'DPORT_SET_PERI_REG_MASK'<br />
173 |         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);<br />
|         ^~~~~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:173:57: error: 'DPORT_CAN_CLK_EN' undeclared (first use in this function)<br />
173 |         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);<br />
|                                                         ^~~~~~~~~~~~~~~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'<br />
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (</em>((volatile uint32_t <em>)(addr))) = (uint32_t)(val)<br />
|                                                                                        ^~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:90:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'<br />
90 | #define DPORT_SET_PERI_REG_MASK(reg, mask)   DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)|(mask)))<br />
|                                              ^~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:173:9: note: in expansion of macro 'DPORT_SET_PERI_REG_MASK'<br />
173 |         DPORT_SET_PERI_REG_MASK(DPORT_PERIP_CLK_EN_REG, DPORT_CAN_CLK_EN);<br />
|         ^~~~~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:174:35: error: 'DPORT_PERIP_RST_EN_REG' undeclared (first use in this function); did you mean 'SYSTEM_PERIP_RST_EN0_REG'?<br />
174 |         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);<br />
|                                   ^~~~~~~~~~~~~~~~~~~~~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:67: note: in definition of macro '_DPORT_WRITE_PERI_REG'<br />
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (</em>((volatile uint32_t <em>)(addr))) = (uint32_t)(val)<br />
|                                                                   ^~~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:87:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'<br />
87 | #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&amp;(~(mask))))<br />
|                                              ^~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:174:9: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'<br />
174 |         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);<br />
|         ^~~~~~~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:174:59: error: 'DPORT_CAN_RST' undeclared (first use in this function)<br />
174 |         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);<br />
|                                                           ^~~~~~~~~~~~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:77:88: note: in definition of macro '_DPORT_WRITE_PERI_REG'<br />
77 | #define _DPORT_WRITE_PERI_REG(addr, val) (</em>((volatile uint32_t *)(addr))) = (uint32_t)(val)<br />
|                                                                                        ^~~<br />
C:\Users\DavidYoder\AppData\Local\Arduino15\packages\m5stack\tools\esp32-arduino-libs\idf-release_v5.4-2f7dcd86-v1\esp32s3/include/soc/esp32s3/include/soc/dport_access.h:87:46: note: in expansion of macro 'DPORT_WRITE_PERI_REG'<br />
87 | #define DPORT_CLEAR_PERI_REG_MASK(reg, mask) DPORT_WRITE_PERI_REG((reg), (DPORT_READ_PERI_REG(reg)&amp;(~(mask))))<br />
|                                              ^~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:174:9: note: in expansion of macro 'DPORT_CLEAR_PERI_REG_MASK'<br />
174 |         DPORT_CLEAR_PERI_REG_MASK(DPORT_PERIP_RST_EN_REG, DPORT_CAN_RST);<br />
|         ^~~~~~~~~~~~~~~~~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:179:44: error: 'CAN_TX_IDX' undeclared (first use in this function)<br />
179 |         gpio_matrix_out(CAN_cfg.tx_pin_id, CAN_TX_IDX, 0, 0);<br />
|                                            ^~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:184:43: error: 'CAN_RX_IDX' undeclared (first use in this function)<br />
184 |         gpio_matrix_in(CAN_cfg.rx_pin_id, CAN_RX_IDX, 0);<br />
|                                           ^~~~~~~~~~<br />
c:\Users\DavidYoder\Documents\Arduino\Sketchbook\libraries\ESP32CAN\src\CAN.c:254:24: error: 'ETS_CAN_INTR_SOURCE' undeclared (first use in this function)<br />
254 |         esp_intr_alloc(ETS_CAN_INTR_SOURCE, 0, CAN_isr, NULL, NULL);<br />
|                        ^~~~~~~~~~~~~~~~~~~<br />
exit status 1</p>
<p dir="auto">Compilation error: exit status 1</p>
]]></description><link>https://community.m5stack.com/topic/7624/m5-dial-v1-1-can-bus</link><generator>RSS for Node</generator><lastBuildDate>Mon, 18 May 2026 01:16:51 GMT</lastBuildDate><atom:link href="https://community.m5stack.com/topic/7624.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 18 Jun 2025 16:16:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to M5 Dial V1.1 CAN bus on Thu, 19 Jun 2025 01:23:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/davidrubixbattery" aria-label="Profile: davidrubixbattery">@<bdi>davidrubixbattery</bdi></a><br />
The compilation errors you're encountering are related to the ESP32CAN library in the Arduino IDE. Specifically, the errors indicate that certain registers and definitions (DPORT_PERIP_CLK_EN_REG, CAN_TX_IDX, CAN_RX_IDX, and ETS_CAN_INTR_SOURCE) are not declared in the current version of the ESP32 Arduino core library you're using.<br />
Steps to Resolve the Issue:</p>
<p dir="auto">Update the ESP32 Arduino Core:</p>
<p dir="auto">Ensure you are using the latest version of the ESP32 Arduino core. Open the Arduino IDE, go to Tools &gt; Board &gt; Boards Manager, search for "esp32", and update to the latest version.</p>
<p dir="auto">Check the ESP32CAN Library:</p>
<p dir="auto">The ESP32CAN library might not be compatible with the latest ESP32 Arduino core. Try using the M5Stack CAN library instead, as it is tailored for M5Stack products.</p>
<p dir="auto">Alternative Library:</p>
<p dir="auto">If the issue persists, consider using the ESP32 TWAI (CAN) API directly in your Arduino sketch. The TWAI API is the newer and recommended way to handle CAN communication on ESP32.</p>
<p dir="auto">Verify Hardware Connections:</p>
<p dir="auto">Ensure the Dial and Isolated CAN bus unit are correctly connected to the specified port (Port A) and that the pins are properly configured in your code.</p>
<p dir="auto">Example Code for M5Stack CAN:<br />
Here’s a basic example for initializing CAN on an M5Stack device:<br />
#include &lt;M5Stack.h&gt;<br />
#include "esp32_can.h"</p>
<p dir="auto">void setup() {<br />
M5.begin();<br />
CAN_init(0, GPIO_NUM_5, GPIO_NUM_4); // Example pins for CAN TX and RX<br />
}</p>
<p dir="auto">void loop() {<br />
// Your CAN communication logic here<br />
}</p>
<p dir="auto">Additional Resources:</p>
<p dir="auto">M5Stack CAN Unit Documentation<br />
ESP32 TWAI API Reference</p>
<p dir="auto"><a href="https://chat.m5stack.com/" target="_blank" rel="noopener noreferrer nofollow ugc">https://chat.m5stack.com/</a></p>
]]></description><link>https://community.m5stack.com/post/29274</link><guid isPermaLink="true">https://community.m5stack.com/post/29274</guid><dc:creator><![CDATA[yuyun2000]]></dc:creator><pubDate>Thu, 19 Jun 2025 01:23:31 GMT</pubDate></item></channel></rss>