ESP32-S3

DemianESP032
Posts: 2
Joined: Tue Feb 06, 2024 4:28 pm

ESP32-S3

Postby DemianESP032 » Wed Feb 07, 2024 12:13 pm

Hi. I’m trying to implement the CAN communication protocol with the ESP32-S3 to read and write the data on the 29-bit extended CAN network. I saw this module called ESP32-S3-CAN from UltraMax on Amazon. Here is the link: https://www.amazon.co.uk/ULTRAMAX-BOAES ... C67&sr=8-3 That has an on-board SN65HVD232 CAN transceiver. For the software, I’m using Sandeep Mistry’s Arduino CAN library in the Arduino IDE. The code is here

Code: Select all

#include <CAN.h>

#define TX_GPIO_NUM 36
#define RX_GPIO_NUM 35

void setup() {
  Serial.begin(115200);
  while (!Serial)
    ;
  delay(1000);

  CAN.setPins(RX_GPIO_NUM, TX_GPIO_NUM);

  if (!CAN.begin(500E3)) {
    Serial.println("CAN failed!");
    while (1)
      ;
  } else {
    Serial.println("CAN Initialized");
  }
}
void loop() {

  // Send test data on CAN ID 0xEDDF wih Extended 29 bit
  CAN.beginExtendedPacket(0xEDDF);
  CAN.write(0x90);
  CAN.write(0x87);
  CAN.write(0x00);
  CAN.write(0x00);
  CAN.write(0x00);
  CAN.endPacket();

  Serial.println("done");

  delay(1000);  //Sending in every 1 sec
}


But the problem is, it is not compiling for the ESP32-S3, and tonnes of errors just popped up when I tried to compile this code. I checked their datasheet, and there is the installation programme for TWAI installation in C. But that is for the ESP-IDF platform and I have not enough knowledge to use ESP32 with ESP-IDF. So, is there any library available for the CAN bus in the Arduino IDE that is the same as Sandeep Mistry’s Arduino CAN for the ESP32-S3? Thanks.
Attachments
Picture1.png
Picture1.png (117.49 KiB) Viewed 698 times

liaifat85
Posts: 200
Joined: Wed Dec 06, 2023 2:46 pm

Re: ESP32-S3

Postby liaifat85 » Thu Feb 08, 2024 10:32 am

Here is a thread on compilation error in ESP32-S3. You can check if it helps:https://forum.arduino.cc/t/esp32-s3-sud ... or/1177237

DrMickeyLauer
Posts: 160
Joined: Sun May 22, 2022 2:42 pm

Re: ESP32-S3

Postby DrMickeyLauer » Thu Feb 08, 2024 12:48 pm

As much as I appreciate the Arduino folks for their effort, I think going "native" w/ ESP-IDF is worth a try. CAN access using the TWAI driver is really simple and well documented.

DemianESP032
Posts: 2
Joined: Tue Feb 06, 2024 4:28 pm

Re: ESP32-S3

Postby DemianESP032 » Mon Feb 12, 2024 2:01 pm

~Thanks. Will have a look

Who is online

Users browsing this forum: No registered users and 175 guests