I'm trying to set up an 32g2 development board, with yocto linux up as a CAN gateway.
I'm using the dbugFS interface to configure the LLCE to use a combination of basic and advanced filters.
The routing matrix requires around 500 rules, all of type `exact`
After around 250 rules have been added, the following errors occur:
1) I/O error when writing to `/sys/kernel/debug/llce_can_core/can_filters/add/
execute`
2) `llce_can_core 43ff8000.llce:llce_can_core: LLCE FW error 62` in dmesg
3) `llce_can_core 43ff8000.llce:llce_can_core: Failed to add an RX filter
to controller ` in dmesg
In the LLCE firmware user guide, table 1.4 lists some errors, but they aren't associated with a number (62) as far as I can tell.
Repeating these commands eventually reproduces the error:
```
echo $(cat /sys/kernel/debug/llce_can_core/can_destinations/add/execute) > /sys/kernel/debug/llce_
can_core/can_filters/add/can_dest
echo 0 > /sys/kernel/debug/llce_can_core/can_filters/add/can_mask_id
echo exact > /sys/kernel/debug/llce_can_core/can_filters/add/entry
echo 6 > /sys/kernel/debug/llce_can_core/can_filters/add/hw_ctrl
echo 0x00 > /sys/kernel/debug/llce_can_core/can_filters/add/tag
echo 0x10 > /sys/kernel/debug/llce_can_core/can_filters/add/mb_count
echo short > /sys/kernel/debug/llce_can_core/can_filters/add/mb_type
echo 0x1CEBFF25 > /sys/kernel/debug/llce_can_core/can_filters/add/msg_id
echo enabled > /sys/kernel/debug/llce_can_core/can_filters/add/status
echo 1 > /sys/kernel/debug/llce_can_core/can_filters/add/execute
```
In summary, I have 2 questions:
1) Where can I find the definition of ` LLCE FW error 62`
2) what could be the root cause of this error?
Thanks in advance.
Hey @carlos_o
Thanks for your reply. Could you please check the definition of error **62** in that file, you looked at 63. I did find a file named Llce_InterfaceFwMgr.H, but it does not associate the error descriptions with numbers.
My second concern is that the error occurs well before 512 filters of any type have been created. My script attempts to create around 450 filters, and fails after 257 of them have been created. If I run the same script again, about 5 more filters are created, with the rest failing.
This behavior seems to be the same for basic and advanced filters. Introducing a 0.5sec delay between creating filters also makes no difference.
In summary,
1) Can you think of anything else to try?
2) Could you please get the description for error 62? Or where I can find the Llce_InterfaceFwMgr.h that enumerates them.
Hi @m_bez,
1. I'm reviewing if there is any information of how many filters can be added to the same controller. Could you please share what is the max count of filters you are trying to add to a specific controller?
2. I found the file at linux repository of NXP at the path: ./include/linux/mailbox/nxp-llce/llce_fw_interface.h
The error 62 is the following
Hi Carlos, I'm attempting to create the following numbers of filters for 9 controllers
```
| Controller | # |
| ---------- | --- |
| 1 | 129 |
| 2 | 79 |
| 3 | 55 |
| 4 | 40 |
| 5 | 39 |
| 6 | 38 |
| 7 | 28 |
| 8 | 33 |
| 9 | 6 |
```
And at the point where the creation fails, I have created the following numbers of filters
```
| hw_ctrl | count |
| ------- | ----- |
| 1 | 32 |
| 2 | 32 |
| 3 | 32 |
| 4 | 32 |
| 5 | 32 |
| 6 | 32 |
| 7 | 28 |
| 8 | 32 |
| 9 | 6 |
```
At this point, I get the error 62 when I try to add a filter to any of the interfaces that already have 32 filters added. It seems like something is limiting the number of filters on a controller to 32. Is it possible work around this limitation? I could reduce the number of filters by using range/mask filters, but this would have some security implications, so I would like to make sure that this is impossible using exact filters.
Hi @m_bez,
There are just 512 exact filters available for S32G2, this is 32 for each controller as we have 16 controllers. There is not a work around for the limitations. The max number of filters increase for the S32G3 product.
Hey @carlos_o, I've found another odd behavior that might help point in the right direction. If I attempt to create more than 32 filters, the driver starts reporting error frames on the interface. I connected a CAN probe and the errors don't seem to be transmitted on the bus physically, but somthing is malfunctioning. I can see the counters in:
- /sys/class/net/llcecan1/statistics/rx_errors
- /sys/class/net/llcecan1/statistics/tx_errors
counting up to many thousands of errors in a short time, but this happens when the filteres were just created, no CAn frames were sent or received on the bus at this point.
An apology for the late response
I reviewed this with the internal team, and they share the following information:
For the Tx, the max filter is 16 for each HW channel, for Rx, there are not limitation for each HW channel, they are share 1024 filters (exact +rang).
For the Linux side, it is configured in the device tree. the detail is in the chapter 12.3.6 Advanced parameters in BSP RM
the 32 limitation comes from here, so if customer want to increase filter, customer should increase the variable as below
So, my last response was wrong, there is a way to modify the max num to attach for the same HW channel.
Hey @carlos_o , Thanks for the reply. Ive been spending some time trying to get these configuration changes applied, but I'm stuck:
1) In the Yocto/BSP build tree, which dts or dtsi file do I need to modify, and which yocto recipe do I need to modify to get the configuration change in the device tree.
2) Is there some way to modify this configuration at runtime? That is, after u-boot has passed the device tree to the kernel?
Best regards,
Matthys
Hi @m_bez
1. If you want to do it with Yocto here is a guide to how to do your own modifications Yocto Project customization guide the guide is for the i.MX family but work very similar to the S32G in the Yocto Project.
Also, at the BSP Reference Manual you could find what modification is needed to the device tree:
[page 112, Linux BSP 42.0 User Manual for S32G3 platforms]
This changes you could do it at the file s32g399a-rdb3.dts for rdb3 or s32g274a-rdb2.dts for rdb2 located at
/your_Yocto_project/build_s32g274ardb2/tmp/work-shared/s32g274ardb2/kernel-source/arch/arm64/boot/dts/freescale/
2. Yes, at the ethernet chapter of the BSP manual you could find the following information:
So, at u-boot you could try something like
-> setenv fdt_override 'fdt addr ${fdt_addr}; fdt resize; fdt set <node> <property> <value>; ${fdt_override}'
and you need to use
node as /soc/llce_can0
property as nxp,max_regular_filters
value as you desire value
you need also to add another fdt set to the nxp,max_adv_filters property, only remember to separte each instruction with ; at the fdt_override string
Let me know if you have more questions.
Hi @m_bez,
Thanks for the questions!
At the LLCE firmware user guide at chapter 3.2.4.2 Llce_Fw_ReturnType you can find as you mentioned the table of the error enumerator below that table it mentioned where you can find this at the code "Definition at line 131 of file Llce_InterfaceFwMgr.h"
At the code I found the following with the enum 63:
Also, the error is listed at the Table of the User guide
Also, consider the following limitation for filters at your implementation: