I purchased an AMOS 820 from VIA, which uses an i.MX 6Quad Cortex-A9 quad-core SoC made by Freescale (NXP). I installed the Linux HMI Solution Pack Board Support Package (BSP) Yocto 1.5 OS, available on the VIA website, on an SD card. Everything seems to work fine, but I do not believe FlexCAN was actually installed on the system, although I specified that it should be installed in the BitBake recipe.
How can I properly install FlexCAN along with the developer tools for FlexCAN on the system (without starting from scratch and building a new image)? I cannot seem to find the necessary binaries on the web.
Solved! Go to Solution.
I was able to get an accurate answer from VIA. FlexCAN is not a module, so lsmod will not work to discover if the device driver is actually installed. Instead, one should execute "dmesg | grep 'can\|CAN'" once the device first starts (or within a reasonable time period from it starting). The results should be similar to the ones below:
[ 0.000000] vcan: Virtual CAN interface driver
[ 0.000000] CAN device driver interface
[ 0.000000] flexcan netdevice driver
[ 0.000000] flexcan imx6q-flexcan.0: device registered (reg_base=c09e8000, irq=142)
[ 0.000000] flexcan imx6q-flexcan.1: device registered (reg_base=c09f0000, irq=143)
[ 0.000000] can: controller area network core (rev 20090105 abi 8)
[ 0.000000] can: raw protocol (rev 20090105)
[ 0.000000] can: broadcast manager protocol (rev 20090105 t)
There may be some differences in the messages printed (for example, I do not see anything related to vcan). If you do not see similar results and it has been a while since you started the microcontroller, you can try to execute "ifconfig can0 down; ifconfig can0 up" then "dmesg | grep 'can\|CAN'" and you should see a line similar to above with the word flexcan in the message. If you do not see any of these messages, FlexCAN is probably not installed; however, VIA does set FlexCAN to be installed by default in the defconfig file for BitBake.
To integrate with the CAN bus, VIA uses both SocketCAN and can-utils. VIA provided this link to examples of programming with the SocketCAN framework.
I was able to get an accurate answer from VIA. FlexCAN is not a module, so lsmod will not work to discover if the device driver is actually installed. Instead, one should execute "dmesg | grep 'can\|CAN'" once the device first starts (or within a reasonable time period from it starting). The results should be similar to the ones below:
[ 0.000000] vcan: Virtual CAN interface driver
[ 0.000000] CAN device driver interface
[ 0.000000] flexcan netdevice driver
[ 0.000000] flexcan imx6q-flexcan.0: device registered (reg_base=c09e8000, irq=142)
[ 0.000000] flexcan imx6q-flexcan.1: device registered (reg_base=c09f0000, irq=143)
[ 0.000000] can: controller area network core (rev 20090105 abi 8)
[ 0.000000] can: raw protocol (rev 20090105)
[ 0.000000] can: broadcast manager protocol (rev 20090105 t)
There may be some differences in the messages printed (for example, I do not see anything related to vcan). If you do not see similar results and it has been a while since you started the microcontroller, you can try to execute "ifconfig can0 down; ifconfig can0 up" then "dmesg | grep 'can\|CAN'" and you should see a line similar to above with the word flexcan in the message. If you do not see any of these messages, FlexCAN is probably not installed; however, VIA does set FlexCAN to be installed by default in the defconfig file for BitBake.
To integrate with the CAN bus, VIA uses both SocketCAN and can-utils. VIA provided this link to examples of programming with the SocketCAN framework.
I am still not certain that FlexCAN was not installed. When using `lsmod`, no modules appear that suggest that FlexCAN was installed; however, according to this post, I should not be able to see `can0` or `can1` when I run `ifconfig -a` when FlexCAN is not installed. I can see both, though. Furthermore, can-utils is installed on the system (not sure if this is a sign that FlexCAN is installed or not). On the other hand, I cannot find a (fsl_)flexcan.c or (fsl_)flexcan.h file anywhere on the microcontroller's filesystem, so I'm not sure how I could use FlexCAN even if it were installed.
I have tried to figure out how to install FlexCAN using bitbake and menuconfig. According to this site for another microcontroller, I should be able to execute either `bitbake -c menuconfig bitbake-recipe-name` or `bitbake -c devshell bitbake-recipe-name` then `make nconfig`; however, neither of these methods work with the recipe VIA provides. Executing the first command gives the error below:
`ERROR: Task do_menuconfig does not exist for target via-image-x11. Close matches:
do_configure`
No make file is found when attempting to execute the second set of comands. When I try `bitbake -c menuconfig linux-imx`, all options for FlexCAN are already selected. So all questions remain. How can I determine for sure if FlexCAN is installed properly or not? If it is not installed properly, how can I install it properly using Yocto and BitBake? Are there any developer tools for FlexCAN and, if so, how can they be installed?
I am attempting to get some of these questions answered by Yocto and VIA and will report back if I find answers, but it would be nice if NXP could provide the answers (succinctly) since it is a driver for NXP microcontrollers.
Hi Calvin
I am afraid it is not possible as it is disabled by default on NXP/FSL BSPs,
please refer to attached Release Notes p.4
Board Support Packages (29)
L3.14.52_1.1.0_MX6QDLSOLO (REV L3.14.52_1.1.0)
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
igorpadykov If I'm not mistaken,it says on p. 19 that it supports one CAN with the default device tree, but if the second CAN is used there will be a pin conflict with FEC and the VIA website claims that one CAN port can be used on the board.
If that is true, how can I determine if FlexCAN was installed on the microcontroller and how can I install the developer tools for FlexCAN if it has already been installed. If FlexCAN was not installed on the system, I assume this means I have to start afresh and build another image (as opposed to not being able to use the CAN at all)?
Thank you for your help so far igorpadykov
So I confirmed that FlexCAN was not installed on the system. My next question is how do I actually install FlexCAN (and the developer tools) using Yocto? I thought I had specified to include the driver in the BitBake recipe, but this does not seem to be the case. The Reference Manual you attached does not seem to have instructions for Yocto, only the old Linux image using menuconfig (which is not used by Yocto from what I have seen).
I noticed that there is a link for a FlexCAN driver on the i.MX 6Quad webpage for device drivers; however, the link takes you to a page that only gives the option to download the FlexCAN driver only for Topaz boards running Windows CE, which does not help in this instance.