-
Notifications
You must be signed in to change notification settings - Fork 3k
Description
Description of defect
Setting CAN bus speed on constructor doesn't work, the speed doesn't change and it is always set to 100kHz. Changing it using the frequency()
method works.
Target(s) affected by this defect ?
Any STM32 with can bus
Toolchain(s) (name and version) displaying this defect ?
GCC_ARM. arm-none-eabi version 9.2.1
What version of Mbed-os are you using (tag or sha) ?
release tag mbed-os-5.15.3
What version(s) of tools are you using. List all that apply (E.g. mbed-cli)
mbed-cli version 1.10.2
How is this defect reproduced ?
Instantiate a CAN object on an STM target and specify any speed other than 100kHz in the constructor. The constructor ignores the hz
parameter and always set the speed to 100kHz.
The issue is caused by function can_init_freq
that ignores the passed hz
parameter:
mbed-os/targets/TARGET_STM/can_api.c
Line 198 in f7861e6
CAN_INIT_FREQ_DIRECT(obj, &static_pinmap, 100000); |
and
mbed-os/targets/TARGET_STM/can_api.c
Line 695 in f7861e6
CAN_INIT_FREQ_DIRECT(obj, &static_pinmap, 100000); |
this is already fixed in master branch.