Nontrivial code example for bxCAN i / f on STM32?

I use STM Peripheral Library to configure and use CANBus. The problem is that I have to put a delay between Tx packets or I start to drop packets. Entering read status lines, etc., It seems to have no effect. Does anyone have a working example that doesn't include adding a magic number delay?

+4
source share
2 answers

This does not apply to CAN or STM32, but really about how often something happens in the microcontroller.

There are several ways to solve this problem:

1) Use a timer

, , . (.. 10 ). . , ; "", , , , , , .

2) , FreeRTOS

RTOS , . , , . , 10 , 200 .

+2

STM32 + HAL + FreeRTOS

# , 3x . .

  • ,

    • IRQ
    • / 3
    • ,
  • translation()

  • . IRQ translation()
  • . ()
    • ,
    • [n], [n]
0

Source: https://habr.com/ru/post/1628163/


All Articles