RT3070 imx28 SoftAP功能移植。

本文详细记录了RT3070 SoftAP功能在imx28平台上的移植过程,包括DHCP服务器配置及编译、软AP驱动模块的修改与编译、系统启动脚本设置等内容。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

RT3070 imx28 SoftAP功能移植。

分类: LINUX

/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-linux-strip udhcpd
1.#PATH=$PATH:/etc/apache/bin
/home/liyun/work/ltib/rpm/BUILD/linux-2.6.35.3
/home/liyun/maye9/ltib/rpm/BUILD

一:DHCP服务器端:(编译器)
1. 修改Makefile: 添加:     CROSS_COMPILE=arm-linux-
2. #make , 把生成的dhcpd文件下载到板子上.
make LDFLAGS="-static"
我编译时提示有个C文件出错,是因为文件中switch case 少了个break。
使用/usr/local/arm/2.95.3/bin/arm-linux-strip处理一下,
3. #cp samples/udhcpd.conf    /etc/                #copy udhcp/samples下的文件到目标板子的 /etc目录
4. # vi /etc/udhcpd.conf: 修改如下:
3 # The start and end of the IP lease block
4
5 start       192.168.1.20    #default: 192.168.0.20   为winXP的ip地址范围
6 end        192.168.1.25    #default: 192.168.0.254

9 # The interface that udhcpd will use
10
11 interface   wlan0       #default: eth 0#目标板子上的无线网卡wlan0 ,按照实际情况改写如ra0等
85 #Examles
86 opt dns 222.201.130.30 222.201.130.33   #dns服务器
87 option subnet 255.255.255.0
88 opt router 192.168.1.10                       #wlan的 ip地址,做为网关地址
89 #opt    wins    192.168.10.10              #注释掉
90 option dns 192.168.1.10 # appened to above DNS servers for a total of 3
91 option domain local
92 option lease   864000      # 10 days of seconds
5# ./dhcpd //运行dhcpd服务器
到此DHCP服务器运行成功。
 
 
二:SoftAP功能移植。
参考 http://my.oschina.net/wuying/blog/54939中博客。在此感谢分享。
/////////////////////////////////////////////////////////////////
//environment:
//       compile system:Ubantu 10.04
//       target system:   imx28
//       resource:            RT3070_SoftAP_v2.4.0.rar
                                   ltib --- L2.6.35_10.11.01_ER_source.tar.gz 
//       cross compile:   arm-none-linux-gnueabi-   
//ps :                           My English is the primary level(most of YouDao) --   Welcome Guidance
//reference:               http://blog.youkuaiyun.com/king_sundi/article/details/6158475
                                   http://blog.youkuaiyun.com/linfeng999/article/details/6410224                                       
//////////////////////////////////////////////////////////////////
/////////////////////compile rt3070ap///////////////////////////////
("-" remove row, "+" add row )
$ cd 2010_0203_RT3070_SoftAP_v2.4.0.1_DPA
$ vim MODULE/Makefile
   -PLATFORM = PC
   +PLATFORM = SMDK
    ifeq ($(PLATFORM),SMDK)
    -LINUX_SRC = /home/bhushan/itcenter/may28/linux-2.6-samsung
    -CROSS_COMPILE = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-
    +LINUX_SRC = /home/lin/Desktop/linux-2.6.35.3
    +CROSS_COMPILE = /opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-
     endif
$ vim NETIF/Makefile
$ vim UTIL/Makefile
  repair the same as MODULE/Makefile
 
// repair usb_buffer_free and usb_buffer_allow error
$ vim UTIL/os/linux/rt_usb_util.c
  repair following:
   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
  void *rausb_buffer_alloc(struct usb_device *dev,
         size_t size,
         gfp_t mem_flags,
         dma_addr_t *dma)
  {
   - return usb_buffer_alloc(dev, size, mem_flags, dma);
   + return usb_alloc_coherent(dev, size, mem_flags, dma);
  }
  EXPORT_SYMBOL(rausb_buffer_alloc); 
  void rausb_buffer_free(struct usb_device *dev,
         size_t size,
         void *addr,
         dma_addr_t dma)
  {
   - usb_buffer_free(dev, size, addr, dma);
   + usb_free_coherent(dev, size, addr, dma);
  }
  EXPORT_SYMBOL(rausb_buffer_free);
  #endif // LINUX_VERSION_CODE //
 
//repair rt3070ap: module license 'RALINK' taints kernel.
$ vim NETIF/os/linux/usb_main_dev.c
     +MODULE_LICENSE("GPL");
$ vim MODULE/common/rtmp_init.c
  repair following:
  #ifdef RTMP_MAC_USB
  - MODULE_LICENSE("RALINK");
  + MODULE_LICENSE("GPL");
  #endif // RTMP_MAC_USB //
 
  + #ifndef RTMP_MAC_USB
  + MODULE_LICENSE("GPL");
  + #endif
 
$ sudo make ARCH=arm KBUILD_NOPEDANTIC=1
//compile dhcpd
$ cd ltib/
$ ./ltib -c
Package list  --->
 [*] dhcp                                                     
   [*]   Include DHCP server                            
   [*]   Include DHCP client support
$ cp rootfs/usr/sbin/dhcpd   @target rootfs/usr/local/bin/dhcpd
//////////////////////configuration dhcpd/////////////////////
reference google (dhcpd 配置)
example:
ddns-update-style ad-hoc;
deny client-updates;
subnet 192.168.1.0 netmask 255.255.255.0 {
default-lease-time 21600;
max-lease-time 43200;
option routers 192.168.1.1;
option subnet-mask 255.255.255.0;
option broadcast-address  192.168.1.255;
option domain-name " http://my.oschina.net/wuying";
option domain-name-servers 192.169.1.10;
option netbios-name-servers     192.168.1.10;
option www-server               192.168.1.10;
range  192.168.1.20 192.168.1.25;
}
$ mkdir -p @target rootfs/var/state/dhcp/
$ touch @target rootfs/var/state/dhcp/dhcpd.leases
 
//////////////////////////////powerboot/////////////////////////
// cp *.ko to filesystem
$ tar -jxvf rootfs.tar.bz2 /tftpboot/
$ sudo make -p /tftpboot/usr/local/module
$ sudo cp MODULE/os/linux/*.ko /tftpboot/usr/local/module
$ sudo cp NETIF/os/linux/*.ko /tftpboot/usr/local/module
$ sudo cp UTIL/os/linux/*.ko /tftpboot/usr/local/module
// cp ap-set.dat to filesystem
$ sudo make -p /tftpboot/etc/Wireless/RT2870AP
$ sudo cp MODULE/RT2870AP.dat /tftpboot/etc/Wireless/RT2870AP/

// set ap argument
$ vim /tftpboot/etc/Wireless/RT2870AP/RT2870AP.dat
// set powerboot
$ vim /etc/rc.d/rcS
----Added to the last line of behind
+ #install rc3070ap
+ insmod /usr/local/module/rtutil3070ap.ko
+ insmod /usr/local/module/rt3070ap.ko
+ insmod /usr/local/module/rtnet3070ap.ko
+ #run rc3070ap
+ ifconfig ra0 192.168.1.19
+ /usr/local/bin/dhcpd
 
在移植的过程中insmod时出现,如下错误
代码:
# dmesg | grep atl1c
atl1c: disagrees about version of symbol alloc_etherdev_mqs
atl1c: Unknown symbol alloc_etherdev_mqs (err -22)
atl1c: disagrees about version of symbol __vlan_hwaccel_rx
atl1c: Unknown symbol __vlan_hwaccel_rx (err -22)
atl1c: disagrees about version of symbol skb_put
atl1c: Unknown symbol skb_put (err -22)
atl1c: disagrees about version of symbol consume_skb
atl1c: Unknown symbol consume_skb (err -22)
atl1c: disagrees about version of symbol __netif_schedule
atl1c: Unknown symbol __netif_schedule (err -22)
atl1c: disagrees about version of symbol unregister_netdev
atl1c: Unknown symbol unregister_netdev (err -22)
atl1c: disagrees about version of symbol ___pskb_trim
atl1c: Unknown symbol ___pskb_trim (err -22)
atl1c: disagrees about version of symbol eth_validate_addr
atl1c: Unknown symbol eth_validate_addr (err -22)
atl1c: disagrees about version of symbol pskb_expand_head
atl1c: Unknown symbol pskb_expand_head (err -22)
atl1c: disagrees about version of symbol eth_type_trans
atl1c: Unknown symbol eth_type_trans (err -22)
atl1c: disagrees about version of symbol __napi_schedule
atl1c: Unknown symbol __napi_schedule (err -22)
atl1c: disagrees about version of symbol ethtool_op_set_sg
atl1c: Unknown symbol ethtool_op_set_sg (err -22)
atl1c: disagrees about version of symbol netif_device_detach
atl1c: Unknown symbol netif_device_detach (err -22)
atl1c: disagrees about version of symbol netif_device_attach
atl1c: Unknown symbol netif_device_attach (err -22)
atl1c: disagrees about version of symbol dev_kfree_skb_irq
atl1c: Unknown symbol dev_kfree_skb_irq (err -22)
atl1c: disagrees about version of symbol dev_kfree_skb_any
atl1c: Unknown symbol dev_kfree_skb_any (err -22)
atl1c: disagrees about version of symbol netif_napi_add
atl1c: Unknown symbol netif_napi_add (err -22)
atl1c: disagrees about version of symbol netif_receive_skb
atl1c: Unknown symbol netif_receive_skb (err -22)
atl1c: disagrees about version of symbol register_netdev
atl1c: Unknown symbol register_netdev (err -22)
atl1c: disagrees about version of symbol free_netdev
atl1c: Unknown symbol free_netdev (err -22)
atl1c: disagrees about version of symbol ethtool_op_get_link
atl1c: Unknown symbol ethtool_op_get_link (err -22)
atl1c: disagrees about version of symbol dev_alloc_skb
atl1c: Unknown symbol dev_alloc_skb (err -22)
atl1c: disagrees about version of symbol netif_carrier_off
atl1c: Unknown symbol netif_carrier_off (err -22)
atl1c: disagrees about version of symbol ethtool_op_get_sg
atl1c: Unknown symbol ethtool_op_get_sg (err -22)
atl1c: disagrees about version of symbol netif_carrier_on
atl1c: Unknown symbol netif_carrier_on (err -22)
atl1c: disagrees about version of symbol napi_complete
atl1c: Unknown symbol napi_complete (err -22)

搜索到解决方法:
The "disagrees about version of symbol" errors seem to imply that your kernel and atl1c modules were built with different compiler versions or very different configurations.
Try rebuilding the kernel (including the Atheros/Attansic modules) from scratch:
make clean
make
make modules_install
Strange, the --clean argument should have helped. But perhaps doing the following will make a difference:
1. back up your kernel .config file (cp /usr/src/linux/.config /usr/src/my.config)
2. cd /usr/src/linux; make mrproper
3. restore the .config file (cp /usr/src/my.config /usr/src/linux/.config)
4. and finally, run genkernel.
是因为用错了kernel,要保持和编译过的kernel移植,包括编译器版本。
把udhcpd.conf中的 interface   wlan0       #default: eth 0 改为ra0.

### IMX6ULL 平台 RT-Thread 操作系统的移植 #### 移植概述 RT-Thread 是一个实时嵌入式操作系统,其在 i.MX6ULL 平台上运行需要完成硬件驱动适配以及 BSP(Board Support Package)的构建。通常情况下,BSP 文件夹包含了启动代码、外设驱动程序以及其他必要的组件。 为了实现 RT-Thread 在 i.MX6ULL 上的成功移植,可以参考已有的开发板配置并进行调整。以下是关于如何修改和适配的关键部分: --- #### 修改 `board.c` 驱动文件 在 RT-Thread 的 BSP 中,`board.c` 负责初始化硬件资源,例如时钟、GPIO 和其他外设。如果目标平台与现有支持的开发板存在差异,则需针对新开发板重新定义这些功能[^1]。 具体操作如下: 1. 找到对应的路径:`D:\rtthread\rt-smart\kernel\bsp\imx6ull\drivers\board.c`。 2. 编辑该文件以匹配新的硬件特性,比如 GPIO 初始化函数或设备树节点更新。 --- #### 创建自定义开发板目录结构 基于已有模板创建一个新的开发板目录是非常常见的做法。假设当前正在为名为 “lanjut”的开发板做准备,可以通过复制现有的 MX6ULLEVK 板子来快速搭建环境[^2]: ```bash cp -r board/freescale/mx6ullevk/ board/freescale/mx6ull_lanjut/ mv board/freescale/mx6ull_lanjut/mx6ullevk.c board/freescale/mx6ull_lanjut/mx6ull_lanjut.c ``` 上述命令完成了以下工作: - 将原始 EVK 板的相关资料拷贝至新位置; - 对核心 C 文件重命名以便区分不同型号间的逻辑实现。 --- #### 设置 CPU 及外围模块频率参数 i.MX6ULL 默认引导过程中会自动设定一系列重要总线与时钟速率。例如,在某些模式下 BootROM 设定核频达到 396 MHz (System PLL = 528 MHz),而 AHB 总线则维持于较低水平——即大约 132 MHz 左右[^3]。因此,在实际项目里可能还需要进一步确认是否有必要手动干预此类默认行为。 --- #### 复制 U-Boot 或裸机工程中的必要片段作为补充材料 当涉及到更深层次定制化需求的时候,可以从厂商提供的文档或者开源社区获取灵感。例如从指定路径提取 UART 测试样例用于串口通信验证[^5]: ```c // Example of initializing a simple UART communication on IMX6ULL. #include "fsl_common.h" #include "fsl_uart.h" void uart_init(void){ CLOCK_EnableClock(kCLOCK_Uart); uart_config_t config; UART_GetDefaultConfig(&config); config.baudRate_Bps = 115200; // Set baud rate to standard value UART_Init(UART_BASEADDR, &config, CLOCK_GetFreq(kCLOCK_CoreSysClk)); } ``` 此段伪代码展示了怎样通过 FSL 提供 API 接口去激活特定端口号下的数据收发能力。 --- #### 关键步骤总结 尽管每一步单独看来并不复杂,但整体流程却涵盖了多个层面的知识点。主要包括但不限于以下几个方面[^4]: - **生成专属配置档案**: 借助既有样板迅速建立基础框架。 - **调试工具链兼容性问题**: 确认交叉编译器版本满足最新标准要求。 - **完善中断服务机制设计**: 结合应用场合合理规划优先级分配策略。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值