页次: 1
新手小白最近想入手学linux,有推荐吗?
如果有单片机基础个人比较推荐imx6ull的开发板,资料比较多而且有裸机教程比较容易从单片机转到linux,另外原子,野火等的入门资料也写得很详细
一般是先网上找有没有合适的上位机,没有就自己写,python 的wxpyhton,pyqt,C++的QT,MFC都能很方便的编写上位机程序
这种一般是千兆PHY没有配置好或者pcb布线的问题,需要调整tx_delay或者rx_delay
问题解决了,也不是phy配置的问题,是uboot的网卡的设备树pin脚有一个没配好,不知道为什么会影响到kernel,kernel的设备树是没问题的,估计是uboot的引脚没释放吧,改了之后就没问题了
这种一般是千兆PHY没有配置好或者pcb布线的问题,需要调整tx_delay或者rx_delay
用的是野火的板子,用原来的固件是没问题的,所以首先排除PCB等硬件问题
[root@star-mp157]:~$ ifconfig eth0 up
[ 48.193921] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[ 48.201977] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[ 48.221835] dwmac4: Master AXI performs any burst length
[ 48.225722] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 48.233230] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 48.241952] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[ 48.247857] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[ 48.257055] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[ 48.264728] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[root@star-mp157]:~$ [ 52.412118] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 100Mbps/Full - flow control rx/tx
[ 52.419342] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[root@star-mp157]:~$ udhcpc -i eth0
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.22.76
udhcpc: lease of 192.168.22.76 obtained, lease time 7200
deleting routers
adding dns 192.168.25.2
adding dns 202.96.128.166
修改设备树将千兆改成百兆之后能够成功获取ip,感觉是配置千兆的时候哪里出问题了,目前就算百兆能执行udhcpc,但千兆不行,有大佬能指点下吗?
移植st官方的en.SOURCES-stm32mp1-openstlinux-5-4-dunfell-mp1-20-06-24.tar到开发板上,设备树参考野火的设备树进行修改,通过网线将网口直接连接电脑使用静态ip设置能够ping通,然后将网口接到路由器,使用dhcpc命令获取动态ip无法获取ip,请问有知道怎么解决吗?
开关eth0会报如下错误:
root@lubancat:~# ifconfig eth0 down
[ 91.649324] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[ 91.656553] stm32-dwmac 5800a000.ethernet eth0: Link is Down
[ 91.672475] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
root@lubancat:~# ifconfig eth0 up
[ 108.589301] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[ 108.597533] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[ 108.620796] dwmac4: Master AXI performs any burst length
[ 108.624688] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 108.632229] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 108.641048] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[ 108.646857] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[ 108.660790] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
root@lubancat:~# [ 111.772307] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 111.779364] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
动态获取ip一直是这样:
root@lubancat:~# udhcpc -i eth0
udhcpc: started, v1.30.1
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
使用静态IP ping电脑是没问题的
root@lubancat:~# ifconfig
eth0: flags=-28605<UP,BROADCAST,RUNNING,MULTICAST,DYNAMIC> mtu 1500
inet 192.168.10.2 netmask 255.255.255.0 broadcast 192.168.10.255
ether 3e:ab:3b:fb:f4:91 txqueuelen 1000 (Ethernet)
RX packets 291 bytes 29201 (28.5 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 27 bytes 5532 (5.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 45
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 140 bytes 9672 (9.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 140 bytes 9672 (9.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
root@lubancat:~# ping 192.168.10.10
PING 192.168.10.10 (192.168.10.10) 56(84) bytes of data.
64 bytes from 192.168.10.10: icmp_seq=1 ttl=128 time=0.777 ms
64 bytes from 192.168.10.10: icmp_seq=2 ttl=128 time=0.462 ms
64 bytes from 192.168.10.10: icmp_seq=3 ttl=128 time=0.327 ms
^C
--- 192.168.10.10 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 31ms
rtt min/avg/max/mdev = 0.327/0.522/0.777/0.188 ms
root@lubancat:~#
感觉像设备树还是驱动没移植成功
连上wifi执行udhcpc命令是能动态获取ip的,证明动态获取ip相关配置应该是没问题的
[root@star-mp157]:~$ ifconfig
lo Link encapocal Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 94:A1:A2:69:C4:50
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:2 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:254 (254.0 B) TX bytes:248 (248.0 B)
[root@star-mp157]:~$ udhcpc -i wlan0
udhcpc: started, v1.31.1
udhcpc: sending discover
udhcpc: sending select for 192.168.137.83
udhcpc: lease of 192.168.137.83 obtained, lease time 604800
deleting routers
adding dns 192.168.137.1
[root@star-mp157]:~$
但获取eth0的动态ip就是不成功,是设备还是驱动需要修改?有大佬知道吗?
[root@star-mp157]:~$ udhcpc -i eth0
udhcpc: started, v1.31.1
[ 49.832857] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[ 49.840959] stm32-dwmac 5800a000.ethernet eth0: PHY [stmmac-0:01] driver [RTL8211F Gigabit Ethernet]
[ 49.860348] dwmac4: Master AXI performs any burst length
[ 49.864234] stm32-dwmac 5800a000.ethernet eth0: No Safety Features support found
[ 49.872056] stm32-dwmac 5800a000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[ 49.880558] stm32-dwmac 5800a000.ethernet eth0: registered PTP clock
[ 49.886381] stm32-dwmac 5800a000.ethernet eth0: configuring for phy/rgmii-id link mode
[ 49.895610] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[ 49.902976] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
[ 49.912397] stm32-dwmac 5800a000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[ 49.919453] [dhd] CFG80211-ERROR) wl_cfg80211_netdev_notifier_call : wdev null. Do nothing
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
^C
[root@star-mp157]:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 5E:65:81:5C:65:AB
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1026 (1.0 KiB)
Interrupt:45
lo Link encapocal Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
[root@star-mp157]:~$
https://blog.csdn.net/u014170843/article/details/120158095 我看这里的移植步骤我都做了,而且都有相应的打印了,但dhcp就是死活不行
why1canhbjack 说:你不是要卖100吗?批量才50,有几个会批量买的
几千几万块的板子一般来说是公司买,DIY玩家要想赚钱不批量怎么赚钱?我不希望别人买回去都垫桌子,躺在哪个角落吃灰。
个人观点,批量的话还不如自己设计,这样定制度更高,成本更低
你不是要卖100吗?批量才50,有几个会批量买的
大佬,请问是用qt6还是qt5开发的?版本最低要求是什么?想自己编译学习学习,特别是蓝牙BLE部分
求链接
why1canhbjack 说:@ppatb01
这个是linux的串口的一个程序,你怀疑有问题的话可以先在Ubuntu进行编译测试我是远程连接主机,在MobaXterm上登陆,所以是直接把代码写到板子上吗。请问一下可以告诉我具体怎么操作吗
可以参考这个串口部分的https://whycan.com/files/members/11334/%E5%B5%8C%E5%85%A5%E5%BC%8FLinux%E5%BA%94%E7%94%A8%E5%BC%80%E5%8F%91%E5%AE%8C%E5%85%A8%E6%89%8B%E5%86%8CV5.1_T113%E5%BC%80%E5%8F%91%E6%9D%BF.pdf
@ppatb01
这个是linux的串口的一个程序,你怀疑有问题的话可以先在Ubuntu进行编译测试
您好,请问可以分享一下嘛,小白不太懂具体应该如何测试
https://whycan.com/files/202304/T113-I/Linux_UART_%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97.pdf
我也是小白,就是参考这个文档的然后进行写程序和测试
@ppatb01
我也是小白,是参考这篇文档写的,
https://whycan.com/files/202304/T113-I/Linux_UART_%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97.pdf
发现能用就当没问题了
您好,请问问题解决了吗,可以分享一下测试代码吗,感谢!
我是用tina里面的代码替代logan里的代码解决的,应该是longan SDK里面的bug,我测试代码就是普通的linux串口程序,这个网上一堆
longan这个SDK是不是已经过时了,之前用过,有不少bug
主要是longan支持EMMC启动,所以就用了,确实是挺多bug的
使用的SDK是从韦东山那里下载的longanSDK,打算使用串口DMA进行传输数据,然后根据手册进行串口DMA的配置并编写测试程序,然后报错cannot get the DMA channel. 然后网上搜了没有找到答案,然后自己搜sdk源码定位到sunxi-uart.c这个文件,然后发现程序
uart_dma->dma_chan_tx = dma_request_chan(sw_uport->port.dev, "rx");
if (!uart_dma->dma_chan_rx) {
dev_err(port->dev, "cannot get the DMA channel.\n");
return -1;
}
将uart_dma->dma_chan_tx = dma_request_chan(sw_uport->port.dev, "rx");改为uart_dma->dma_chan_rx = dma_request_chan(sw_uport->port.dev, "rx");后能正常运行。但使用多个串口DMA后第二个开始报错:
sun6i-dma 3002000.dma-controller: Failed to alloc lli memory
uart uart4: get rx dma descriptor failed!
在全志论坛https://bbs.aw-ol.com/topic/2902/t113-s3%E5%BC%80%E5%90%AF%E5%A4%9A%E4%B8%AA%E4%B8%B2%E5%8F%A3dma%E9%97%AE%E9%A2%98?lang=zh-CN这个帖子找到相同的现象,请问有大佬知道怎么解决吗?
修改clock_sun8iw20.c
void clock_init_uart(void)
{
struct sunxi_ccm_reg *const ccm =
(struct sunxi_ccm_reg *)SUNXI_CCM_BASE;
/* uart clock source is apb2 */
writel(APB2_CLK_SRC_OSC24M|
APB2_CLK_RATE_N_1|
APB2_CLK_RATE_M(1),
&ccm->apb2_cfg);
APB2_CLK_SRC_OSC24M改为APB2_CLK_SRC_PLL6,从内部pll6时钟分频,即600M时钟,
然后修改APB2_CLK_RATE_N_1和APB2_CLK_RATE_M(1)进行相应的分频得出相应的apb时钟,
然后修改sunxi-common.h,#define CONFIG_SYS_NS16550_CLK 24000000改为相应的apb时钟
修改完成后即可设置相应的波特率
页次: 1