ADAFRUIT_F405_EXPRESS and CANbus num_filter_banks

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
ilium007
Posts: 37
Joined: Tue Feb 16, 2021 10:29 am

ADAFRUIT_F405_EXPRESS and CANbus num_filter_banks

Post by ilium007 » Sun Apr 03, 2022 4:05 am

The CANbus documentation I am reading does not seem to match what I am seeing in practice. I have the ADAFRUIT_F405_EXPRESS STM32F405 based board so the CAN bus implementation for CAN port 1 should be identical to the PyBoard CAN1. When I attempt to set the number of filter banks on CAN 1 to 28 (or anything) I get an error:

Code: Select all

>>> can.init(CAN.NORMAL, baudrate=500_000, extframe=True, num_filter_banks=28)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: extra keyword arguments given
>>>
This is following the documentation at:
https://docs.micropython.org/en/latest/ ... b.CAN.html

Line 82 of https://github.com/micropython/micropyt ... tm32/can.h does not seem to have this parameter:

Code: Select all

bool can_init(pyb_can_obj_t *can_obj, uint32_t mode, uint32_t prescaler, uint32_t sjw, uint32_t bs1, uint32_t bs2, bool auto_restart);
Is the documentation wrong or am I doing something wrong?

ilium007
Posts: 37
Joined: Tue Feb 16, 2021 10:29 am

Re: ADAFRUIT_F405_EXPRESS and CANbus num_filter_banks

Post by ilium007 » Sun Apr 03, 2022 4:54 am

Getting the same error when trying to set the filter with extframe=True. It fails and I can't receive a CAN frame that was sent with extframe=True.

ilium007
Posts: 37
Joined: Tue Feb 16, 2021 10:29 am

Re: ADAFRUIT_F405_EXPRESS and CANbus num_filter_banks

Post by ilium007 » Sun Apr 03, 2022 5:02 am

Just realised there have been breaking changes in the github code for can.c relating to extended id's and I was looking at the 'latest' doco (even though it says v1.18 at top of doco page). The version https://docs.micropython.org/en/v1.18/l ... ml#pyb-can has the 1.18 release doco that is all different.

Post Reply