页次: 1
已经找到原因,是内核和ko文件要一致。ko文件用下面的命令编译出来
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=out modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=out modules_install
rtl8723bs_nic.bin文件已经放到lib/firmware/rtlwifi/目录下了
下面是报错信息,请大佬们帮忙看看是啥问题
# insmod r8723bs.ko
[ 19.512071] r8723bs: module is from the staging directory, the quality is unknown, you have been warned.
[ 19.536491] RTL8723BS: module init start
[ 19.540676] RTL8723BS: rtl8723bs v4.3.5.5_12290.20140916_BTCOEX20140507-4E40
[ 19.547782] RTL8723BS: rtl8723bs BT-Coex version = BTCOEX20140507-4E40
[ 19.556528] pnetdev = c326b000
[ 19.639450] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[ 19.647750] pgd = c3174000
[ 19.650473] [00000004] *pgd=4310a835, *pte=00000000, *ppte=00000000
[ 19.656779] Internal error: Oops: 817 [#1] SMP ARM
[ 19.661575] Modules linked in: r8723bs(C+)
[ 19.665705] CPU: 0 PID: 118 Comm: insmod Tainted: G C 4.14.14-licheepi-zero #13
[ 19.674138] Hardware name: Allwinner sun8i Family
[ 19.678847] task: c3975cc0 task.stack: c3132000
[ 19.684189] PC is at rtw_drv_register_netdev+0x4c/0x80 [r8723bs]
[ 19.690229] LR is at netif_carrier_off+0x14/0x50
[ 19.694853] pc : [<bf056114>] lr : [<c057d3e8>] psr: 600f0013
[ 19.701122] sp : c3133d28 ip : 00000000 fp : 00000124
[ 19.706350] r10: 0000000b r9 : c326b000 r8 : c428e000
[ 19.711579] r7 : c428b000 r6 : c428b000 r5 : 00000000 r4 : c326b000
[ 19.718108] r3 : c428e318 r2 : 00000004 r1 : 57e6c32c r0 : c326b000
[ 19.724643] Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 19.731779] Control: 10c5387d Table: 4317406a DAC: 00000051
[ 19.737532] Process insmod (pid: 118, stack limit = 0xc3132210)
[ 19.743456] Stack: (0xc3133d28 to 0xc3134000)
[ 19.747828] 3d20: c326a800 c3bcca00 00000000 bf05886c c3bcca08 00000000
[ 19.756016] 3d40: c3bcca00 bf06a544 bf05cfc4 00000000 0000000b c04ea00c c3bcca08 c0a87104
[ 19.764201] 3d60: c0a87108 bf06a544 00000000 c0415fc8 c3bcca08 bf06a544 c3bcca3c 00000000
[ 19.772388] 3d80: c3be1080 c3be10a4 c44e4000 c0416134 00000000 bf06a544 c041607c c0414530
[ 19.780573] 3da0: c3919a58 c3bbd6b4 bf06a544 c3259c80 c0a3d3a4 c0415488 bf0625c4 00000001
[ 19.788760] 3dc0: bf06a544 bf06a544 bf06a534 00000000 c3be1200 c0416a18 bf066000 bf06a534
[ 19.796945] 3de0: 00000000 bf08106c ffffe000 bf081000 00000000 c01019dc c3e88dd8 80080007
[ 19.805131] 3e00: 00187961 c0a46740 00000000 c0a7b3c0 c0a063c4 8040003f c3133e38 0000009a
[ 19.813318] 3e20: c3801a80 c3133e38 0000009a c3801e40 c3133e50 00002dbe bf06a5c0 bf06a5c0
[ 19.821505] 3e40: bf06a5c0 bf06a5c0 00000001 c3be1080 c3be10a4 c018ec50 c3be10a4 c3133f50
[ 19.829692] 3e60: bf06a5c0 c3133f50 bf06a5c0 00000001 00000001 c018de64 bf06a5cc 00007fff
[ 19.837880] 3e80: bf06a5c0 c018b1e0 00000000 bf06a5c0 bf06a608 c31102c4 c3133f50 bf06a6f0
[ 19.846067] 3ea0: c0837c9c c0703130 c07e5830 c07e5894 c07e583c bf06a77c ffffe000 bf000000
[ 19.854253] 3ec0: 000a27d4 00000000 c3133f48 00000000 00000000 00000000 00000000 00000000
[ 19.862436] 3ee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 19.870622] 3f00: 00000000 00000000 7fffffff 00000000 00000003 000d5008 0000017b c0107964
[ 19.878807] 3f20: c3132000 00000000 00000000 c018e680 7fffffff 00000000 00000003 c3128418
[ 19.886996] 3f40: c3bb3000 c44e4000 000a27d4 00000000 c4546aad c44e4000 000a27d4 c45860f4
[ 19.895180] 3f60: c4585f28 c455d3a0 00070000 00077490 00000000 00000000 00000000 0001a330
[ 19.903367] 3f80: 00000029 0000002a 00000021 00000000 00000013 00000000 000d5008 be8c9f4e
[ 19.911553] 3fa0: be8c9e54 c0107780 000d5008 be8c9f4e 00000003 000d5008 00000000 be8c9f4e
[ 19.919740] 3fc0: 000d5008 be8c9f4e be8c9e54 0000017b be8c9f4e 00000000 b6fb6000 00000000
[ 19.927927] 3fe0: be8c9cb0 be8c9ca0 0002fa50 b6f10a42 800e0030 00000003 43f1e861 43f1ec61
[ 19.937085] [<bf056114>] (rtw_drv_register_netdev [r8723bs]) from [<bf05886c>] (rtw_drv_init+0x1d0/0x208 [r8723bs])
[ 19.947950] [<bf05886c>] (rtw_drv_init [r8723bs]) from [<c04ea00c>] (sdio_bus_probe+0x108/0x11c)
[ 19.956769] [<c04ea00c>] (sdio_bus_probe) from [<c0415fc8>] (driver_probe_device+0x234/0x2e8)
[ 19.965307] [<c0415fc8>] (driver_probe_device) from [<c0416134>] (__driver_attach+0xb8/0xbc)
[ 19.973763] [<c0416134>] (__driver_attach) from [<c0414530>] (bus_for_each_dev+0x68/0x9c)
[ 19.981959] [<c0414530>] (bus_for_each_dev) from [<c0415488>] (bus_add_driver+0x100/0x20c)
[ 19.990239] [<c0415488>] (bus_add_driver) from [<c0416a18>] (driver_register+0x78/0xf4)
[ 19.998660] [<c0416a18>] (driver_register) from [<bf08106c>] (rtw_drv_entry+0x6c/0x1000 [r8723bs])
[ 20.008027] [<bf08106c>] (rtw_drv_entry [r8723bs]) from [<c01019dc>] (do_one_initcall+0x44/0x168)
[ 20.016925] [<c01019dc>] (do_one_initcall) from [<c018ec50>] (do_init_module+0x60/0x1f0)
[ 20.025035] [<c018ec50>] (do_init_module) from [<c018de64>] (load_module+0x1d24/0x232c)
[ 20.033058] [<c018de64>] (load_module) from [<c018e680>] (SyS_finit_module+0xa8/0xb8)
[ 20.040907] [<c018e680>] (SyS_finit_module) from [<c0107780>] (ret_fast_syscall+0x0/0x54)
[ 20.049097] Code: e59421d8 e2833018 e1a00004 e5931000 (e5821000)
[ 20.055496] ---[ end trace 9ba82625b586b48a ]---
Segmentation fault
[I] AWBoot r13 starting...
[I] SMHC: sdhci0 controller v50310 initialized
[I] SHMC: SD card detected
[W] SMHC: error 0x80 status 0x24
[W] SMHC: data timeout
[W] SMHC: read failed
[W] FATFS: MMC read 0/16384 blocks
[E] FATFS: mount error: 1
[W] SMHC: loading failed, trying SPI
在SD卡zImage和dtb已经拷贝至FAT32分区,不知道为什么无法加载内核
twzy大佬的原帖地址:https://whycan.com/p_85107.html
按照大佬的步骤,完整的实现了AWboot的编译过程,写了一个编译流程文档分享给大家参考。
AWboot需要用到arm-none-eabi-的交叉编译工具,我们首先进行环境配置:
# 1. 进入交叉编译器目录下
cd gcc-arm-none-eabi-10.3-2021.10-x86_64-linux/
# 2. 创建目录
sudo mkdir /usr/local/arm-none-eabi
# 3. 将该目录下的所有文件复制到新建的目录下
sudo cp -rd * /usr/local/arm-none-eabi/
# 4. 最后需要添加该工具链的环境变量使其可以在任何目录下执行,使用bash -c命令在文件/etc/profile末尾添加”PATH=$PATH:/usr/local/arm-none-eabi/bin”
sudo bash -c 'echo "export PATH=\$PATH:/usr/local/arm-none-eabi/bin" >> /etc/profile'
# 5. 添加完毕,使路径立即生效可以使用如下命令
source /etc/profile
# 6. 接下来在终端输入
arm-none-eabi-
# 8. 按两次tab键进行验证
#cd gcc-arm-none-eabi-10.3-2021.10/
#sudo mkdir /usr/local/arm-none-eabi
#sudo cp -rd * /usr/local/arm-none-eabi/
#sudo bash -c 'echo "export PATH=\$PATH:/usr/local/arm-none-eabi/bin" >> /etc/profile'
#source /etc/profile
#arm-none-eabi-
arm-none-eabi-addr2line arm-none-eabi-gdb
arm-none-eabi-ar arm-none-eabi-gdb-add-index
arm-none-eabi-as arm-none-eabi-gdb-add-index-py
arm-none-eabi-c++ arm-none-eabi-gdb-py
arm-none-eabi-c++filt arm-none-eabi-gprof
arm-none-eabi-cpp arm-none-eabi-ld
arm-none-eabi-elfedit arm-none-eabi-ld.bfd
arm-none-eabi-g++ arm-none-eabi-lto-dump
arm-none-eabi-gcc arm-none-eabi-nm
arm-none-eabi-gcc-10.3.1 arm-none-eabi-objcopy
arm-none-eabi-gcc-ar arm-none-eabi-objdump
arm-none-eabi-gcc-nm arm-none-eabi-ranlib
arm-none-eabi-gcc-ranlib arm-none-eabi-readelf
arm-none-eabi-gcov arm-none-eabi-size
arm-none-eabi-gcov-dump arm-none-eabi-strings
arm-none-eabi-gcov-tool arm-none-eabi-strip
#
# 1. 制作编译工具
cd awboot/tools/
gcc mksunxi.c -o mksunxi
# 2. 编译 awboot
cd ..
Make
如果文件夹下awboot下生成了:awboot-boot-sd.bin则表示工作正常了。
# 3. 烧录 bin文件到SD卡进行验证(若无串口打印信息请看下一章节)
sudo dd if=awboot-boot-sd.bin of=/dev/sdb bs=1024 seek=8
此处为在SD卡进行验证,若需要在其他介质上启动可以参考:
FEL memory boot:
xfel write 0x30000 awboot-fel.bin
xfel exec 0x30000
FEL SPI NOR boot:
make spi-boot.img
xfel spinor
xfel spinor write 0 spi-boot.img
xfel reset
FEL SPI NAND boot:
make spi-boot.img
xfel spi_nand
xfel spi_nand write 0 spi-boot.img
xfel reset
# 4. awboot支持MBR或者GPT分区,内核和设备树文件需要放置在一个偏移量至少为4M的FAT32分区,其中bin文件的偏移量:
MBR分区: 8KB (sector 16)
GPT分区: 128KB (sector 256)
拷贝zlmage文件和.dtb文件到FAT32分区
#cd ..
#cd awboot/tools/
#gcc mksunxi.c -o mksunxi
#cd ..
#make
#ls
Arch awboot-fel.bin build main.c
awboot-boot.bin awboot-fel.elf include main.h
awboot-boot.elf awboot-fel.map lib Makefile
awboot-boot.map board.c linux README.md
awboot-boot-sd.bin board.h linux-6.0-bootlog.txt tools
awboot-boot-spi.bin board-v851s.c linux-6.0-v851s.txt
#sudo dd if=awboot-boot-sd.bin of=/dev/sdb bs=1024 seek=8
1.打开awboot目录下的board.h文件
修改USART_DBG宏定义可以修改调试串口
#define USART_DBG usart3_dbg
修改CONFIG_DTB_FILENAME宏定义可以修改设备树文件名
#define CONFIG_DTB_FILENAME "sun8i-t113-mangopi-dual.dtb"
2.具体的串口定义可以在board.c文件中修改
打开awboot目录下的board.c文件,根据硬件进行配置,串口对应基地址和外设复用号可以查看本文档附录,也可以查看《T113-S3_User_Manual_V1.6.pdf》中的“GPIO Multiplex Function”章节。
sunxi_usart_t usart5_dbg = {
.base = 0x02501400,
.id = 5,
.gpio_tx = {GPIO_PIN(PORTB, 4), GPIO_PERIPH_MUX7},
.gpio_rx = {GPIO_PIN(PORTB, 5), GPIO_PERIPH_MUX7},
};
sunxi_usart_t usart0_dbg = {
.base = 0x02500000,
.id = 0,
.gpio_tx = {GPIO_PIN(PORTE, 2), GPIO_PERIPH_MUX7},
.gpio_rx = {GPIO_PIN(PORTE, 3), GPIO_PERIPH_MUX7},
};
sunxi_usart_t usart3_dbg = {
.base = 0x02500c00,
.id = 3,
.gpio_tx = {GPIO_PIN(PORTG, 8), GPIO_PERIPH_MUX5},
.gpio_rx = {GPIO_PIN(PORTG, 9), GPIO_PERIPH_MUX5},
};
3.板载运行灯在board.c文件中led_blue变量定义处修改:
static gpio_t led_blue = GPIO_PIN(PORTD, 22);
T113-S3串口号基地址和复用号表格(格式:Tx/Rx)此处省略,可以查看附件内容
资源地址:
AWboot GitHub地址:
https://github.com/szemzoa/awboot
gcc-arm-none-eabi-10.3-2021.10-x86_64-linux.tar.bz2 地址:
https://developer.arm.com/downloads/-/gnu-rm
T113的版本,现在插拔USB可以识别到,并且烧录,但是烧到一半就掉了,还是不行。。。换了电脑也不行
按住并保持fel按键,点一下rst按键,设备管理器可以出来全志的VID设备,但是PhoenixSuit一直显示无设备连接,重启电脑和重启软件均无效
housework这个可以~~~
已经不贵了,官网价不便宜
硬件佬表示,家里很多破烂~~~
你出运费,我送你一个ST的开发板
TF卡在开发板上是可以正常启动的,电源也测试过没有问题
2路SD卡都试过不行的话,主频和DDR频率也降低一些,试一下SPI flash启动。uboot也改一下从SPI flash启动。
谢谢楼主,用的那颗主控啊?
STM32F405RGT6,基本上STM32F4以上的U都可以,比如G431也行,需要自己改一下底层。
感觉是Uboot运行有问题,如果固件没问题,建议换个TF卡试试。还有个可能是TF卡的走线有问题,或者电源问题。
建议去淘宝看看
@Blueskull 感谢大佬科普,原来flash的水好深。
最好的方式,买个ST的驱动开发板~~~
现在变频器的门槛不高了,硬件软件都很成熟了,不大建议新人进来了。
有个STM32H7的项目,需要用到大量的网络操作,想直接用linux来降低开发难度
我们用的是SVN版本控制
用buildroot,make menuconfig 之后 勾选Target packages -> Audio and video applicantions -> mplayer,再make,就可以用mplayer播放视频了
把VESC的github的代码转成了Keil工程,方便大家开发
VESC官网:https://vesc-project.com/
Github地址:https://github.com/vedderb/bldc
把VESC的github的代码转成了Keil工程,方便大家开发
VESC官网:https://vesc-project.com/
Github地址:https://github.com/vedderb/bldc
页次: 1