All Questions
159 questions
0
votes
1
answer
117
views
STM32 FDCAN filters not filtering anything
The problem
I am unable to get the HAL CAN filters to filter anything. I have FDCAN working perfectly on my STM32H723VGT6 uController. I would like to now implement CAN filters, but when I configure ...
1
vote
0
answers
37
views
Issues Establishing CAN FD on STM32U575
I'm trying to establish CAN FD communication using the STM32U575 microcontroller, but I've encountered some difficulties. While I successfully set up loop-back mode using the HAL library, I keep ...
1
vote
1
answer
87
views
STM32L552 CANFD Filter configuration
Im currently working with CANFD and have to set up the filters in my STM32L552. I need to get four IDs (0, 20, 10, 100).
Currently I only get the two IDs 0 and 20.
FDCAN_FilterTypeDef myFDCanFilter;
...
0
votes
0
answers
30
views
Cannot initialize CAN protocol sing HAL functions on STM32F446RE
I am working on a project that involves a STM32 F446RE nucleo board. I am sending CAN frames on the CAN bus of the car.
I am facing a problem that has not always been:
When i am calling the function &...
0
votes
0
answers
100
views
STM32-L432KC CAN mailboxes are not emptied HAL_CAN_ERROR_PARAM
Trying to send a CAN message every second but after a few tries it returns the HAL_CAN_ERROR_PARAM error.
Tried to check if there is an empty mailbox available before sending the next can message but ...
0
votes
0
answers
104
views
STM32F103 & TJA1050 CAN Read 500kpbs
I want to read data from 500kbps on the card I developed with STM32f103 but I cannot get results.
I used "CubeMX" to get the required kbps setting right and I use "CubeMX" to ...
0
votes
0
answers
227
views
Can STM32 Blue Pill work with JTA 1050 CAN Transceiver?
I currently work on Project CAN communication using stm32f103c8t6 , I have already bought TJA1050 as CAN transceiver but when I try to send CAN message ,the register CAN transmit status register (...
3
votes
0
answers
110
views
ATSAME51 CAN works with no compiler optimizations, error with optimizations
I've written a CAN driver for an ATSAME51 on a Microchip IGAT dev board and when I compile with no optimizations the program runs fine and is able to transmit and receive data. When I turn on any ...
1
vote
0
answers
71
views
FDCAN Loopback mode in stmcubeide
So I was implementing FDCAN External loopbak mode in STM32H7A3ZIT6Q NUCLEO. Clock configuration: HSI is 64MHz and fdcan frq is 50Mhz and I have done the parameter calculations accordingly.The code is ...
2
votes
2
answers
117
views
How do I initialize an array at a specific address for CANbus RX/TX FIFO start address register (ATSAME51)?
The register for the CAN RX & TX buffer/FIFO start address (F0SA/TBSA) only consider the lower 16 bits of an address but a RAM address can span from 0x20000000 to 0x20040000 (18 bits).
Link to ...
1
vote
0
answers
235
views
Is it possible to configure a CAN transceiver with an FDCAN microcontroller?
I am trying to configure a MCP2551 CAN transceiver with my STM32 NUCLEO H7A3ZI-Q which only supports FDCAN. Is it possible to do so? If yes, what are the steps to be followed?
I have seen that FDCAN ...
1
vote
1
answer
2k
views
CAN Error Counter TEC ( Transmitt Error Counter) Does Not Count Up In Error Passive State
I am trying to set up a bus-off condition to observe the behavior of the CAN peripheral. I am using an STM32F103 microcontroller, and I am attempting the following scenarios:
Short-circuiting the CAN ...
1
vote
1
answer
259
views
STM FDCAN Rx has wrong DataLength value
The problem
I am trying to receive a CAN message using FDCAN on my STM32H723 uController. But when I call the function HAL_FDCAN_GetRxMessage(hfdcan, FDCAN_RX_FIFO0, &CAN1RxHeader, CAN1Rx_buffer); ...
0
votes
0
answers
752
views
Address family not supported by protocol: Error using sockets and WSL2
I am having an error trying to setup sockets and using them in C. I am using WSL2 and get the error socket open failed Address family not supported by protocol for this code:
int s;
if ((s = socket(...
0
votes
0
answers
87
views
Viewing of CANbus data on Industrial Panel PC
I have an Industrial PC which has Windows OS. I want to send some data over SPI-CAN module using Arduino to CAN connection of Panel PC.
You can see the system; MCP2515 module usage
Also you can see ...
-1
votes
3
answers
410
views
STM32_lib: Is there a function to pass the IRQ_handler routine to?
I am trying to add an IRQ_handler routine for when there's an interrupt, for example CAN or USART. I wish to avoid writing directly to memory addresses and wonder if there is a function in either ...
0
votes
0
answers
617
views
I am unable to transmit a CAN FD on STM32 Nucleo boards
I am attempting to transmit data over the Tx Pin of the Nucleo-G431RB. I have not been able to measure any signals coming over this pin with an oscilloscope. I know the problem is not the oscilloscope,...
0
votes
0
answers
125
views
CANOpenNode stack heap variable resets when a new function is entered
I have integrated CANopenNodeStack with my STM32 FreeRTOs based code . Below is my code
And here is the repository I am using for CANopenNode stack for STM32 https://github.com/CANopenNode/...
-2
votes
1
answer
846
views
Esp32 sn65hvd230: I can't get it to read in real time
I am working on a project based on the ESP32 processor and Arduino framework, which communicates with another board via CANBUS protocol.
The bitrate is 125k so it is presumably "fast".
I am ...
0
votes
1
answer
602
views
CAN communication Tolerate dominant bit error
I'm working on a BMS project which uses CAN protocol for communication. Recently I'm facing some problems in CAN communication. I will explain the architecture of the BMS, CAN bus, and program with ...
0
votes
0
answers
336
views
How can i clear can buffer?
I am trying to receive data about current angle from engine to raspbery pi and rotate based on received angle + one gradus. Engine send me data angle constantly. But when I read buffer i can only see ...
1
vote
1
answer
226
views
IWDG not stopping on debug when CAN Receive interrupt triggered
I'm having a significant problem debugging my board with CAN traffic. Whenever the debugger is paused, and a CAN message is received, the independent watchdog is being reset. As far as I can tell, I'm ...
2
votes
0
answers
318
views
Can read CANBUS socket, but not write to it
I'm converting a Windows program to Linux and I have some problem writing to the CAN bus. Trying write or send returns -1 with errno as "No such device or address"
Some simplified C code:
...
0
votes
1
answer
182
views
CANopen SYNC Message Detection with STM32L476
With an STM32L476 as CANopen node I have to detect (consume) the CANopen SYNC message on the CAN bus as fast as possible, probably in the ISR context. All other CANopen messages (beside the CANopen ...
0
votes
1
answer
699
views
Signal based CAN bus frame manipulation in C
I'm trying to manipulate a CAN signal using C (with a PCAN Router interface).
What the program does is waits for a CAN specific frame like 0x1F0 and then modify some bits. The bits I want to modify is ...
0
votes
1
answer
664
views
Raspberry pi and arduino CAN bus communication not working
So I am working on a project to establish CAN bus communication between raspberry pi 4 and arduino. Unfortunately, I don't have great success. So I already established connection between multiples ...
2
votes
1
answer
91
views
How can the value of an argument in a function called from a signal handler be different from the value passed in?
Updated question - first version below
I have set up a custom signal handler to buffer frames being removed from a CAN interface. In the handler, I block the signal first, and unblock it last, using ...
1
vote
0
answers
184
views
Multiple cycle times for can frames on a bcm SocketCan possible?
I would like to send and reveive CAN frames via a BCM SocketCAN in Linux with C/C++. Some frames may be 11bit others are 29bit. Each frame can have an individual cycle time and the data will change ...
0
votes
1
answer
1k
views
How to create CAN frame using SocketCAN interface in C using values larger and smaller than 8 bit
I need to write three different CAN messages to a CAN bus.
The first message consists of 8 values of 8 bits so no problem there but the second and third message are more irregular
In the third message ...
0
votes
0
answers
836
views
CANFD in normal mode is not sending message
I am using the stm32mp157C-DK2 board to communicate via FDCAN and my idea is to use it as normal mode to send and receive CAN messages. For this I have created a program in stm32cubeide and I enable ...
0
votes
2
answers
293
views
CAN with STM32F4
Right now I am working with an STMF429 nucleo-144 board and I am trying get the CAN to work.
Here is my Code:
int intCAN();
int intFilter();
int pins();
int main(void)
{
//int CAN
pins();
...
0
votes
1
answer
1k
views
STM32 wakeup from CAN bus
I am trying to wake up the CPU from the CAN bus but it fails. Data from the bus processor receive but does not wake it up, for example, an interrupt from GPIO wakes it up and then it responds to the ...
0
votes
1
answer
878
views
CAN Communication: Can Transmit but Not Receive
I am attempting to use my STM32H7B3I-EVAL evaluation board to send and receive CAN communication messages. I am communicating with a Vector CANalayzer (16.0, VN1630A). The CANalyzer is being used both ...
0
votes
0
answers
152
views
CAN bus by NUCLEO-L432K2 (STM32CubeMXL4) not seen by apps
Using specification UM1884 for the STM32L4, I have (essentially) programmed the following in main():
/* USER CODE BEGIN PTD */
#define NOJI_DEFAULT_ID 102
/* USER CODE END PTD */
/* USER CODE BEGIN 0 ...
1
vote
1
answer
327
views
Decoding signed CAN bytes in C
I've been trying to write a function to decode CAN bytes in C, taking into account endianness of values coming in and endianness of system. Now, it works fine for unsigned values, but sucks for signed ...
0
votes
1
answer
775
views
Can't set the CAN baud rate to 500 Kbps for MINI M4 STM32 on Cube IDE
I am currently using MINI M4 STM32, with an STM32F4RG15 MCU.
I am facing issues wherein I can't increase the CAN baud rate beyond 250 kbps. Whenever I try to change the parameters to set the baud rate ...
1
vote
1
answer
203
views
How do I install a signal handler for a custom I/O signal?
I am trying to set up a signal and signal handler to rebuffer CAN frames as they arrive. Below is my code. I can send a frame from the computer running this code, but when I send a frame back the ...
0
votes
2
answers
79
views
Weird problem in Fujitsu Softune IDE - wrong calculation of 11 bit CAN ID
The code below is part of my code to read CAN ID in Rx callback:
tmpp = (((0x07 << 0x1D)|(0x368 << 0x12)) & 0x1FFC0000); //unsigned long long int tmpp - equal to 0xDA00000
if (...
1
vote
2
answers
600
views
Encryption Strategy for Flashing or updating firmware on ARM Cortex M0+
I want to flash a firmware update through CAN, on my ARM Cortex M0+ MCU. I'm using MKV11 microcontroller.
How can I secure the firmware, so that, even if the transfer(from PC to MCU) is sniffed, it ...
0
votes
1
answer
627
views
How to use on message event inside on timer event?
I want to execute below code only once. Can I use on timer event to execute only once? If yes how can I use on message event inside on timer event ?
on message *
{
if (this.id = "X")
...
1
vote
2
answers
2k
views
Is CRC already calculated by CAN protocol?
I am in a project and I have to comply with ISO26262 so I need to verify my CAN frame. I am going to check my frame using the CRC calculation. My question is: Should I do this calculation in my ...
1
vote
0
answers
564
views
SocketCAN recovery from buffer overflow CAN_ERR_CRTL_RX_OVERFLOW
I write an application in C/C++ which uses SocketCAN. Under some conditions I can generate an buffer overflow error CAN_ERR_CRTL_RX_OVERFLOW on my system.
An ip command shows growing number of ...
0
votes
1
answer
106
views
Alsa plays audio get from CAN FD
I am trying to use Alsa library to reproduce the audio I get from my CAN FD communication, into my headphones. I don't quite understand how to properly configure Alsa's parameters, in order to be able ...
0
votes
0
answers
281
views
Why does Ubuntu throw an I/O error randomly?
I have got a PC/104 (its OS is Ubuntu 16.04 with kernel 4.19.89 xenomai3) that is connected to two motors via two CAN adapters. Few days back, I wrote some simple code to open my PC/104's CAN ports ...
0
votes
1
answer
172
views
Why does 0x90 become 0xFF (255) as a argument i Eclipse 2021-03 CDT - C code?
I'm building on a J1939 project called Open SAE J1939 for industrial Can-bus systems and I notice something with weird with Eclipse CDT.
I call the function
ENUM_J1939_STATUS_CODES ...
0
votes
1
answer
182
views
Cannot run a large structure filled with arrays win C
I'm building a SAE J1939 library for embedded systems such as Arduino, STM32, AVR etc.
But I have an issue I don't understand. First when I compile. No error!
But when I run, I get this assembler ...
0
votes
1
answer
1k
views
I need to configure CAN filters in such a way that only ID 0x80 and IDs between 0x200 and 0x300 passes all others are not allowed to be passed
I tried in this way but the problem is only 200-300 can pass but 80h is not passed. if I use if-else then only 80h is passed not 200-300h. So, the problem is I can pass either 80h or 200h-300h. Not ...
1
vote
1
answer
1k
views
Socket reading error on CAN BUS Linux Socketcan?
I implemented a CAN bus communication for writing and read operations with linux. I am using socketCan library.
Write function works correctly. I have problems with my reading function:
int ...
0
votes
1
answer
671
views
CAN frame over MQTT (need to convert hex string to byte array)
I am implementing a MQTT communication. I want to send CAN frames over MQTT through a graphical interfaces (realized in python). I am able to send messages from the GUI to one topic and I am able to ...
-1
votes
1
answer
320
views
Reading CAN message (PCAN-Router Pro FD)
please I have a problem with writing a code which will read a CAN message, edit it (limit to some maximum value) and then send back with same ID.
I´m using PCAN-Router Pro FD and will show you their ...