Dear Support Team,
In my project, the Ethernet driver (ENET0) works well as long as I turn the MPU off. Otherwise I get a bus error on frame Rx (EIR[EBERR]=1). My RTOS uses the MPU with checking process ID and supervisor/user (i.e., problem state). Most likely, my problem sits in the specification of the access rules. To revise them, I would like to know if the ENET's DMA appears as a supervisor or as a user to the MPU? (Where to find this information?)
As I'm anyway reviewing the MPU settings, could you please tell me the same for the normal, common DMA?
Thanks a lot and kind regards,
Peter
Solved! Go to Solution.
this table from section "21.1 System Memory Protection Unit (SMPU) configuration" is important:
Regards,
Lukas
I had a problem similar to yours, EBERR problem during ENET initialization, seems to be unable to apply for send buffer descriptor. I want to know how you turn off the MPU function, I'm going to verify; How did you solve the problem
Hi Jack,
You ask how to turn the MPU off: this lets me think that our problems are not the same. In my project, the MPU is required and the task to solve was to define a memory region such that the ENET driver can fill it but user processes should not be able to touch the same memory area. The rules one has to formulate for granting or prohibiting access to some RAM depend on the privilege level of the code execution (or "executor", respectively) and this caused my question. The answer -- the MPU sees the ENET device as a user -- let to this modification of the MPU configuration: https://github.com/PeterVranken/DEVKIT-MPC5748G/blob/master/samples/safe-RTOS/code/system/RTOS/rtos_..., l.200, commit https://github.com/PeterVranken/DEVKIT-MPC5748G/commit/47ccfdb335518a64e1aee807eaddd51ba2cc0fdf.
However, if you don't want the MPU to operate, then, most likely, it doesn't; the MPU is off by default and out of reset, so if you didn't explicitly enable it in your startup code then it is not working and all RAM access is allowed, to normal code and as well to the ENET's DMA.
You probably will have to look for other possible reasons for seeing the bus error. Maybe your destination address is out of bounds, e.g., a NULL pointer, pointing to an address range, where no RAM sits at all. Maybe you disregarded the alignment of the destination address. For Rx frames, it needs to be 64 Byte aligned. See Reference Manual, section 42.6.14.1, pp.1670ff.
Kind regards,
Peter
Meanwhile, I continued my experiments on this issue and it turned out that Ethernet0 as bus master no. 5 is considered a user to the MPU. The user access bits rwx need to be configured 110b to allow frame Rx and Tx by the device's DMA. It is not sufficient to set the supervisor bits.
Peter
this table from section "21.1 System Memory Protection Unit (SMPU) configuration" is important:
Regards,
Lukas