ZmmFly · 2022年01月24日

【XR806开发板试用】RT-Thread移植系列① - 必要文件及静态库准备

想要移植RT-Thread首先得有准备吧,首先根据SDK的make输出把必要的库和文件找出来。

因为make输出过于冗长这里就删去部分参数,举个栗子。
以下是chip这个库的make输出

make[5]: Entering directory '~/xr806_RTT/src/driver/chip'
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o codec/ac101.o codec/ac101.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o codec/ac107.o codec/ac107.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o codec/xradio_internal_codec.o codec/xradio_internal_codec.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o crypto/drv_trng.o crypto/drv_trng.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o flash_crypto.o flash_crypto.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o flashchip/flash_EN25QHXXX.o flashchip/flash_EN25QHXXX.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o flashchip/flash_chip.o flashchip/flash_chip.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o flashchip/flash_chip_cfg.o flashchip/flash_chip_cfg.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_adc.o hal_adc.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_board.o hal_board.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_ccm.o hal_ccm.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_crypto.o hal_crypto.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_csi.o hal_csi.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_csi_jpeg.o hal_csi_jpeg.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_dcache.o hal_dcache.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_dma.o hal_dma.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_dmic.o hal_dmic.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_efuse.o hal_efuse.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_flash.o hal_flash.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_flashctrl.o hal_flashctrl.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_global.o hal_global.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_gpio.o hal_gpio.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_i2c.o hal_i2c.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_i2s.o hal_i2s.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_icache.o hal_icache.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_irrx.o hal_irrx.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_irtx.o hal_irtx.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_mbox.o hal_mbox.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_nvic.o hal_nvic.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_prcm.o hal_prcm.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_psensor.o hal_psensor.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_pwm.o hal_pwm.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_rcosc_cali.o hal_rcosc_cali.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_rtc.o hal_rtc.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_scr.o hal_scr.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_snd_card.o hal_snd_card.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_spi.o hal_spi.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_spinlock.o hal_spinlock.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_swd.o hal_swd.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_sysctl.o hal_sysctl.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_timer.o hal_timer.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_trng.o hal_trng.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_uart.o hal_uart.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_util.o hal_util.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_wakeup.o hal_wakeup.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_wdg.o hal_wdg.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_wkpin.o hal_wkpin.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o hal_xip.o hal_xip.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o ir_nec.o ir_nec.c
~/tools/gcc-arm/bin/arm-none-eabi-gcc -o system_chip.o system_chip.c
~/tools/gcc-arm/bin/arm-none-eabi-ar -crs libchip.a codec/ac101.o codec/ac107.o codec/xradio_internal_codec.o crypto/drv_trng.o flash_crypto.o flashchip/flash_EN25QHXXX.o flashchip/flash_chip.o flashchip/flash_chip_cfg.o hal_adc.o hal_board.o hal_ccm.o hal_crypto.o hal_csi.o hal_csi_jpeg.o hal_dcache.o hal_dma.o hal_dmic.o hal_efuse.o hal_flash.o hal_flashctrl.o hal_global.o hal_gpio.o hal_i2c.o hal_i2s.o hal_icache.o hal_irrx.o hal_irtx.o hal_mbox.o hal_nvic.o hal_prcm.o hal_psensor.o hal_pwm.o hal_rcosc_cali.o hal_rtc.o hal_scr.o hal_snd_card.o hal_spi.o hal_spinlock.o hal_swd.o hal_sysctl.o hal_timer.o hal_trng.o hal_uart.o hal_util.o hal_wakeup.o hal_wdg.o hal_wkpin.o hal_xip.o ir_nec.o system_chip.o

用正则表达式[\w\/]+.[csS]$进行多行匹配,可以得到一个列表

codec/ac101.c
codec/ac107.c
codec/xradio_internal_codec.c
crypto/drv_trng.c
flash_crypto.c
flashchip/flash_EN25QHXXX.c
flashchip/flash_chip.c
flashchip/flash_chip_cfg.c
hal_adc.c
hal_board.c
hal_ccm.c
hal_crypto.c
hal_csi.c
hal_csi_jpeg.c
hal_dcache.c
hal_dma.c
hal_dmic.c
hal_efuse.c
hal_flash.c
hal_flashctrl.c
hal_global.c
hal_gpio.c
hal_i2c.c
hal_i2s.c
hal_icache.c
hal_irrx.c
hal_irtx.c
hal_mbox.c
hal_nvic.c
hal_prcm.c
hal_psensor.c
hal_pwm.c
hal_rcosc_cali.c
hal_rtc.c
hal_scr.c
hal_snd_card.c
hal_spi.c
hal_spinlock.c
hal_swd.c
hal_sysctl.c
hal_timer.c
hal_trng.c
hal_uart.c
hal_util.c
hal_wakeup.c
hal_wdg.c
hal_wkpin.c
hal_xip.c
ir_nec.c
system_chip.c

即在~/xr806_RTT/src/driver/chip这个路径下, 以上文件将编译为静态库libchip.a
可能有人会好奇为什么路径名字是xr806_RTT, 其实是因为之前参考XR806和OHOS的device,做过一次移植,但是以无任何串口输出失败,这一个准备重新移植,
不想打无准备的仗,所以呢,就把编译文件和参数都给扒了。

至于SDK提供的静态库则在lib文件夹当中。

下一部分预告:【XR806开发板试用】RT-Thread移植系列② - 使用xmake编译XR806固件,跑起RTT

完整编译文件清单见Github: xr806_RTT

上面这个仓库也就是之前做过的移植,但是串口没输出,暂时不准备继续调试,后面会根据这次获得的清单和参数来重新做一个开源SDK。

推荐阅读
关注数
13823
内容数
139
全志XR806开发板相关的知识介绍以及应用专栏。
目录
极术微信服务号
关注极术微信号
实时接收点赞提醒和评论通知
安谋科技学堂公众号
关注安谋科技学堂
实时获取安谋科技及 Arm 教学资源
安谋科技招聘公众号
关注安谋科技招聘
实时获取安谋科技中国职位信息