色偷偷偷久久伊人大杳蕉,色爽交视频免费观看,欧美扒开腿做爽爽爽a片,欧美孕交alscan巨交xxx,日日碰狠狠躁久久躁蜜桃

電子工程網(wǎng)

標(biāo)題: 飛凌嵌入式分享丨全志 A40i / T3對CAN的支持 [打印本頁]

作者: 哦哈喲    時(shí)間: 2021-12-8 09:12
標(biāo)題: 飛凌嵌入式分享丨全志 A40i / T3對CAN的支持
[color=rgb(51, 51, 51) !important]全志A40i或者T3的CPU中無CAN控制器,而在實(shí)際使用過程中,會(huì)用到CAN,通常會(huì)采用SPI轉(zhuǎn)CAN的方式。

在OKA40i-C底板上,有一路SPI,但由于電壓與mcp2515的電壓不匹配,所以會(huì)采用串口2的這組復(fù)用為SPI外接mcp2515模塊。
[color=rgb(51, 51, 51) !important]根據(jù)CPU手冊第三章描述,可以將PI17-19復(fù)用為SPI1,采用PH08作為中斷。
[color=rgb(51, 51, 51) !important]A40i/T3采用sys_config.fex或者dts 配置引腳復(fù)用功能,下面我們采用dts 進(jìn)行配置。

01-打開SPI1
[color=rgb(51, 51, 51) !important]修改sys_config.fex,將uart2的配置去掉,打開SPI1的配置。
[color=rgb(51, 51, 51) !important]同時(shí)將PH08注釋掉:
[color=rgb(51, 51, 51) !important]同時(shí)修改設(shè)備樹:

02-修改defconfig
[color=rgb(51, 51, 51) !important]采用通過其他平臺(tái)驗(yàn)證,且適配設(shè)備樹的驅(qū)動(dòng)mcp251x.c,
[color=rgb(51, 51, 51) !important]修改defconfig 配置文件:
[color=rgb(51, 51, 51) !important]Networking support ---> CAN bussubsystem support--->CAN Device Drivers --->Microchip MCP251x SPI CAN controllers選中。
[color=rgb(51, 51, 51) !important]同時(shí)選中SPI配置,默認(rèn)已支持,此處不再說明。

03-配置iproute
[color=rgb(51, 51, 51) !important]文件系統(tǒng):
[color=rgb(51, 51, 51) !important]buildroot-201611/configs/sun8iw11p1_hf_defconfig
[color=rgb(51, 51, 51) !important]需要配置上BR2_PACKAGE_IPROUTE2=y.
[color=rgb(51, 51, 51) !important]重新編譯,并打包鏡像,燒錄。

04-測試can0節(jié)點(diǎn)
[color=rgb(51, 51, 51) !important]啟動(dòng)之后,ifconfig 查看出現(xiàn)can0節(jié)點(diǎn)。使用以下命令進(jìn)行測試:
[color=rgb(51, 51, 51) !important]ifconfig can0 down
[color=rgb(51, 51, 51) !important]ip link set can0 up type can bitrate 125000 triple-sampling on
[color=rgb(51, 51, 51) !important]ifconfig can0 up
[color=rgb(51, 51, 51) !important]cansend can0 123#12345678
[color=rgb(51, 51, 51) !important]candump can0
[color=rgb(51, 51, 51) !important]如果有必要請聯(lián)系飛凌技術(shù)服務(wù)人員,提供patch文件。

注意事項(xiàng)
[color=rgb(51, 51, 51) !important]在設(shè)備樹中,用作中斷時(shí),因A40i/T3只能使用PH組的引腳復(fù)用為中斷,在設(shè)備樹中設(shè)置中斷時(shí)的如下:
[color=rgb(51, 51, 51) !important]interrupt-parent = <&pio>;
[color=rgb(51, 51, 51) !important]interrupts = <8 0>;
[color=rgb(51, 51, 51) !important]另外,需要注意驅(qū)動(dòng)中的中斷觸發(fā)方式。
[color=rgb(51, 51, 51) !important]原文鏈接:https://www.forlinx.com/article_view_794.html






歡迎光臨 電子工程網(wǎng) (http://m.54549.cn/) Powered by Discuz! X3.4