Can anyone successfully build this samples/drivers/can/babbling for any espressif board?

Been working on a CAN network with an esp32 sender and a stm32 bluepill receiver. Both done in Zephyr.
8 Replies
32bitSaviour
32bitSaviour6d ago
I can successfully build for the bluepill stm32f103_mini having issues with the esp32 build, issue looks to be in device tree generation not sure what at the moment. Which sort of persists when I try to build even the zephyr samples, Can anyone successfully build this samples/drivers/can/babbling for any espressif board?
32bitwidesaviour
help a stuck man @ZacckOsiemo whats your esp board name @32bitSaviour And where is yours failing Mine is failing as well but with a build error
zephyr/include/zephyr/device.h:96:41: error: '__device_dts_ord_40' undeclared (first use in this function); did you mean '__device_dts_ord_30'?
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
zephyr/include/zephyr/device.h:96:41: error: '__device_dts_ord_40' undeclared (first use in this function); did you mean '__device_dts_ord_30'?
96 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)
Ok same issue for me just found out about espressif twai Espressif ESP32 Two-Wire Automotive Interface (TWAI), its can. Added
/ {
chosen {
zephyr,canbus = &twai;
};

};
/ {
chosen {
zephyr,canbus = &twai;
};

};
to be more explicit still stuck here. I will cast my eyes somewhere else. Ok I'm in the same place, do you want to check the github for this issue? I will keep you in the know. fail loudly if anything comes up @32bitSaviour Coming to realize that the undefined reference to __device... is a generic problem that happens if you try to get a device pointer from a devicetree node if no such device exists.
32bitwidesaviour
turns out CONFIG_CAN=y doesn't enable the can node in the generated dts
attachment 0
32bitwidesaviour
What else do you need? Need to add an overlay that changes the status to "okay". @32bitSaviour can you jump on rtfes.devheads.io? tell me if you see video Yeah. Right away no remote video available but my browser tab indicates something is playing we are a-building. Enabling status in the overlay solved it
&twai {
status = "okay";
};
&twai {
status = "okay";
};
Booting Zephyr OS build v4.0.0-2949-ge1f15e511ed3 [00:00:00.000,000] <dbg> canopen_driver: CO_CANmodule_init: rxSize = 13, txSize = 9 [00:00:00.000,000] <dbg> canopen_driver: CO_CANmodule_init: excessive number of concurrent CAN RX filters enabled (needs 13, 14 available) [00:00:00.000,000] <inf> app: CANopen stack initialized [00:00:00.000,000] <inf> app: Green LED not available [00:00:00.000,000] <inf> app: Red LED not available [00:00:00.010,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.020,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.040,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.050,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.070,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.081,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.092,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.102,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.113,000] <err> canopen_driver: failed to send CAN frame (err -114) [00:00:00.124,000] <err> canopen_driver: failed to send CAN frame (err -114) Everything is properly wired up but I am getting these from the bluepill. Will need to get a logic analyzer to see if CAN TX/RX signals between the chip controller and the CAN transceiver. Oh shoot my transceiver is faulty. I am getting very around 0.8 and 0.9 voltages between can hi and gnd. What logic analyzer are you using? wondering which exact CAN transceiver module or IC ur using Don't have one on me. Resorted to the good old multimeter, testing between CAN HI and GND then CAN LO and GND. For this transceiver, when connected to one of the devices I am testing the voltage between HI and gnd should be between 2.5 and 3.0 and LO abd gnd should be 2.0 and 2.5. Values I get are very low in the range of 0.8 - 1.1 The CAN transceiver is a TJA1050. Doing comms between an esp32 and a bluepill Hrmmm. That is a good idea! CAN on a digital oscilloscope is just hard especially if you are making the bus yourself Made an order for a couple of CAN transceiver and a logic analyzer. Moving to some ethernet work while I wait on that.
ZacckOsiemo
ZacckOsiemo5d ago
@techielew should this really be forumed?
techielew
techielew5d ago
What is the issue?
ZacckOsiemo
ZacckOsiemo5d ago
There is really no reason to forum or index that conversation
techielew
techielew5d ago
Seems he solved his own problem then identified another. The post title likely needs to be changed and the second part needs to be removed.

Did you find this page helpful?