Skip to content

drivers: can: sam: wrong MRBA configuration #80750

Closed
@henrikbrixandersen

Description

@henrikbrixandersen

Describe the bug
Commit 1b09d5a (#73594) added configuration of the Bosch M_CAN message RAM DMA base address for the Atmel SAM series. However, the order of the arguments to sys_write32() was reversed, leading to run-time issues.

To Reproduce
Steps to reproduce the behavior:

  1. Enable both CAN0 and CAN1 on an Atmel SAME70-based board (tested with an out-of-tree board).
  2. Notice how the Atmel SAM front-end driver for the Bosch M_CAN writes to the wrong memory address, sometimes leading to crashes like below (seems easier to reproduce if also enabling USB device support).

Expected behavior
MRBA configured correctly.

Impact
MPU faults.

Logs and console output

[00:00:00.000,000] <err> os: ***** MPU FAULT *****
[00:00:00.000,000] <err> os:   Data Access Violation
[00:00:00.000,000] <err> os:   MMFAR Address: 0x20400030
[00:00:00.000,000] <err> os: r0/a1:  0x0040b524  r1/a2:  0x20400000  r2/a3:  0x00000002
[00:00:00.000,000] <err> os: r3/a4:  0x40088114 r12/ip:  0x00000000 r14/lr:  0x00401925
[00:00:00.000,000] <err> os:  xpsr:  0x01000000
[00:00:00.000,000] <err> os: Faulting instruction address (r15/pc): 0x00406d0e
[00:00:00.000,000] <err> os: >>> ZEPHYR FATAL ERROR 19: Unknown error on CPU 0
[00:00:00.000,000] <err> os: Current thread: 0x20401370 (unknown)
[00:00:00.078,000] <err> os: Halting system

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr SDK
  • Commit SHA: 5c376ad

Additional context
N/A

Metadata

Metadata

Labels

area: CANbugThe issue is a bug, or the PR is fixing a bugplatform: Microchip SAMMicrochip SAM Platform (formerly Atmel SAM)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions