Skip to content

Commit bd741f2

Browse files
henrikbrixandersenjgl-meta
authored andcommitted
drivers: can: stm32h7: fix message RAM address calculations
Calculate the Bosch M_CAN Message RAM addresses relative to the Message RAM Base Address (MRBA), not the offset. Fixes: #59624 Signed-off-by: Henrik Brix Andersen <[email protected]> (cherry picked from commit b809d5c)
1 parent b5e0af7 commit bd741f2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/can/can_stm32h7.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ LOG_MODULE_REGISTER(can_stm32h7, CONFIG_CAN_LOG_LEVEL);
2121

2222
struct can_stm32h7_config {
2323
mm_reg_t base;
24+
mem_addr_t mrba;
2425
mem_addr_t mram;
2526
void (*config_irq)(void);
2627
const struct pinctrl_dev_config *pcfg;
@@ -132,7 +133,7 @@ static int can_stm32h7_init(const struct device *dev)
132133
return ret;
133134
}
134135

135-
ret = can_mcan_configure_mram(dev, stm32h7_cfg->mram, stm32h7_cfg->mram);
136+
ret = can_mcan_configure_mram(dev, stm32h7_cfg->mrba, stm32h7_cfg->mram);
136137
if (ret != 0) {
137138
return ret;
138139
}
@@ -205,6 +206,7 @@ static const struct can_mcan_ops can_stm32h7_ops = {
205206
\
206207
static const struct can_stm32h7_config can_stm32h7_cfg_##n = { \
207208
.base = CAN_MCAN_DT_INST_MCAN_ADDR(n), \
209+
.mrba = CAN_MCAN_DT_INST_MRBA(n), \
208210
.mram = CAN_MCAN_DT_INST_MRAM_ADDR(n), \
209211
.config_irq = stm32h7_mcan_irq_config_##n, \
210212
.pcfg = PINCTRL_DT_INST_DEV_CONFIG_GET(n), \

0 commit comments

Comments
 (0)