Skip to content

Commit b63a9af

Browse files
benysfabiobaltieri
authored andcommitted
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 <[email protected]>
1 parent a206e8c commit b63a9af

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/can/can_mcan.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1207,6 +1207,18 @@ int can_mcan_configure_message_ram(const struct device *dev, uintptr_t mrba)
12071207
uint32_t reg;
12081208
int err;
12091209

1210+
err = can_mcan_exit_sleep_mode(dev);
1211+
if (err != 0) {
1212+
LOG_ERR("Failed to exit sleep mode");
1213+
return -EIO;
1214+
}
1215+
1216+
err = can_mcan_enter_init_mode(dev, K_MSEC(CAN_INIT_TIMEOUT_MS));
1217+
if (err != 0) {
1218+
LOG_ERR("Failed to enter init mode");
1219+
return -EIO;
1220+
}
1221+
12101222
can_mcan_enable_configuration_change(dev);
12111223

12121224
reg = ((POINTER_TO_UINT(msg_ram->std_filt) - mrba) & CAN_MCAN_SIDFC_FLSSA) |

0 commit comments

Comments
 (0)