Skip to main content
VPras
Associate III
October 21, 2019
Question

UART not working correct when using with CANBUS

  • October 21, 2019
  • 1 reply
  • 1881 views

Hi,

I have generated the code using CUBEMX.

In my code i'm trying to send data over CAN and USART .

CAN is working as i have tested with my analyser but over USART sending some junk data.

is there any possibility that CANBUS and USART gets conflicted.i'm using STM32F7 and in that i'm using CAN1 and USART3

I have checked the baudrate is fine.0690X00000AqaTXQAZ.png

Thanks,

Vimal

This topic has been closed for replies.

1 reply

Ozone
Principal
October 21, 2019

I'm pretty sure both rely on interrupts with the same priority, and you do too much in interrupt context (callbacks).

Like calling UART output in the CAN callback.

Cube/Hal is not a good role model for an efficient and properly structured application.

And it surely doesn't relieve you from learning about the inner workings of the MCU and it's peripherals.

Tesla DeLorean
Guru
October 21, 2019

Also if you print from a live buffer the content might change.​

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..