can: mcan: fix setup configuration ram
SAM0 required can module was in init state before configure pointers to ram which handle can frames. Signed-off-by: Kamil Serwus <kserwus@gmail.com>
This commit is contained in:
parent
a206e8ce53
commit
b63a9af07d
|
@ -1207,6 +1207,18 @@ int can_mcan_configure_message_ram(const struct device *dev, uintptr_t mrba)
|
||||||
uint32_t reg;
|
uint32_t reg;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
err = can_mcan_exit_sleep_mode(dev);
|
||||||
|
if (err != 0) {
|
||||||
|
LOG_ERR("Failed to exit sleep mode");
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
|
err = can_mcan_enter_init_mode(dev, K_MSEC(CAN_INIT_TIMEOUT_MS));
|
||||||
|
if (err != 0) {
|
||||||
|
LOG_ERR("Failed to enter init mode");
|
||||||
|
return -EIO;
|
||||||
|
}
|
||||||
|
|
||||||
can_mcan_enable_configuration_change(dev);
|
can_mcan_enable_configuration_change(dev);
|
||||||
|
|
||||||
reg = ((POINTER_TO_UINT(msg_ram->std_filt) - mrba) & CAN_MCAN_SIDFC_FLSSA) |
|
reg = ((POINTER_TO_UINT(msg_ram->std_filt) - mrba) & CAN_MCAN_SIDFC_FLSSA) |
|
||||||
|
|
Loading…
Reference in a new issue