Hi all,
I am working on a project to route CAN messages. I found out that CAN write block by default has arbitration process, which choose highest-priority CAN message buffer to send first. I want to change it to lowest-number message buffer to send first.
After I read document, there are some lines:
73.3.3.1
Lowest-number message buffer first
"If CTRL1[LBUF] is 1, the first (lowest number) active transmission message buffer found is the arbitration winner. MCR[LPRIOEN] has no effect when CTRL1[LBUF] is 1."
So I am trying to write CTRL1[LBUF] to 1. I believe that I need to change to Freeze Mode.
"MCR[FRZ] must be 1 and the module must not be in a low-power mode"
"After requesting Freeze mode, you must wait for MCR[FRZACK] to become 1 before executing any other action, otherwise FlexCAN may operate unpredictably. In Freeze mode, all memory-mapped registers are accessible."
I tried to write MCR[FRZ] to 1 but I failed to change to Freeze mode. Can anyone here have the knowledge about this? I appreciate it.
##S32K34 #FlexCAN #CAN #Route #AUTOSAR #NXP
Hello,
To put the FLEXCAN module into FreezeMode, we can use the S32K3 RTD functions:
Inside case 2 and case 3, you have to add a MATLAB function block. The custom code to enter/exit freezemode can be found below:
To validate this I've done the following:
The S32K3 RTD sources can be found inside the toolbox, where you can check the implementation for a specific module in case you need it. To open the root of the S32K3 folder, you can type the following command in MATLAB command window : cd(mbd_find_s32k3_root).
Do not hesitate to reply in case you have any other questions.
Best regards,
Sorin Bancila