hame RT5350移植OpenWrt

参考:

https://github.com/Squonk42/OpenWrt-RT5350?ref=commandbarr

http://www.right.com.cn/forum/thread-120311-1-1.html


最新openwrt已经支持RT5350,不需要再打补丁了。(http://www.right.com.cn/forum/forum.php?mod=viewthread&tid=120311)

文章见后面【UBUNTU下Hame MPR-A1 openwrt固件生成


以841n v3做例子,使用OpenWrt编个带USB脱机下载的固件(引出这个地址,为了让没有动手编译过的人,了解一下别人的编译过程【图文详解】,起到一个抛砖引玉的作用) 【http://www.right.com.cn/forum/forum.php?mod=viewthread&tid=83746

OpenWrt-RT5350

Patches to compile OpenWrt Linux on Ralink RT5350-based routers.

Note These patches only apply to kernel < 3.8.x. For more recent kernels, please visit our new repository athttps://github.com/kaechele/openwrt!

Introduction

RT5350-based routers are not yet supported in OpenWrt, not even yet in the bleeding edge trunk.

However, here are some experimental patches to the current OpenWrt trunk repository that should work.

These patches were originally developed for the Hame MPR-A1 router, but they also apply to its numerous clones and more generally to a lot of Ralink RT5350-based routers.

This comes from the fact that the RT5350 is a SoC ("System on Chip") that requires only a few external components to provide a working wireless router. So basically, all these designs are very similar, only differing in the SP Flash chip model or the way to control the USB overcurrent protection switch chip.

Build Instructions

In order to build OpenWrt on an RT5350-based router, you need to:

  • download the latest OpenWrt trunk sources from svn
  • download the patches
  • apply the patches
  • choose your target/subtarget/profile for the build
  • compile the firmware

This is achieved using the following code snippet:

 mkdir openwrt
 cd openwrt
 svn co svn://svn.openwrt.org/openwrt/trunk
 git clone https://github.com/Squonk42/OpenWrt-RT5350.git
 cd trunk
 patch -p0 <../OpenWrt-RT5350/openwrt_add_pm25lq032_flash_support.patch
 patch -p0 <../OpenWrt-RT5350/openwrt_add_rt5350_wlan_support.patch
 patch -p0 <../OpenWrt-RT5350/openwrt_hame_mpr-a1.patch
 make menuconfig

In the configuration menu, you need to select the following options:

  • Target Ssytem: Ralink RT288x/RT3xxx
  • Subtarget: RT305x based boards
  • Target Profile: HAME MPR-A1

Then proceed to build:

 make -j x

... where "x" is the number of CPU on your PC + 1.

The first time you compile can take hours, since the toolchains is built first. Subsequent builds only take a few minutes.

Then copy the the resulting image to your TFTP server root, so you can Flash it from the router's U-Boot bootloader:

 cp bin/ramips/openwrt-ramips-rt305x-mpr-a1-squashfs-sysupgrade.bin /tftpboot/

Patch Contents

openwrt_add_pm25lq032_flash_support.patch

This patch contains the definition of 3 SPI Flash chip that are commonly used in RT5350-based routers, but that are missing from the default OpenWrt MTD Flash device driver:

  • PMC PM25LQ032

This patch is platform independent, as these definitions may also be useful to other non RT5350-based machines.

openwrt_add_rt5350_wlan_support.patch

This patch contains the changes required to add support for the RT5350 to the mac80211 driver.

This patch has been developped bi 123serge123 from the OpenWrt forum (https://forum.openwrt.org/viewtopic.php?pid=186493#p186493), adapted by Heffer from the same forum, then ported to the latest mac80211 2013-01-07 by myself.

openwrt_hame_mpr-a1.patch

This patch contains all the required changes required to define the HAME MPR-A1 profile for OpenWrt.

It is based on previous work by arpunk, arteq, Heffer, p1vo and myself from OpenWrt forum (https://forum.openwrt.org/viewtopic.php?id=37002).

==========================================================

UBUNTU下Hame MPR-A1 openwrt固件生成【http://www.right.com.cn/forum/forum.php?mod=viewthread&tid=120311】

先粘贴一下MPR-A1 的硬件配置 【见http://bbs.mydigit.cn/read.php?tid=421833】

硬件配置: 
1)RT5350,MIPS体系的SOC芯片;W9812G6是16MB的DDR RAM;25Q32是4MB的串行FLASH。
2)另外还有EMC5755是电池充电控制器。
3)RJ45座、网口变压器、USB口、按钮、开关、WIFI天线等,都使用了特别小的封装,见细节特写照片。


注意: 截止到2013-07-29, openwrt trunk已经支持了MPR-A1和MPR-A2了, 请大家直接下载官方的openwrt-trunk编译即可,打补丁神马的已经是历史了.
特此更正,以免误人子弟)
搭建开发环境
ubuntu 12.04LTS

  1. sudo apt-get install build-essential subversion git-core libncurses5-dev zlib1g-dev gawk flex quilt libssl-dev xsltproc libxml-parser-perl
复制代码
Openwrt编译环境搭建(English)

准备文件
1.下载truck35407代码
  1. $ mkdir openwrt
  2. $ cd openwrt
  3. $ svn co svn://svn.openwrt.org/openwrt/trunk@35407 trunk35407
  4. $ ./scripts/feeds update -a
  5. $ ./scripts/feeds install -a
复制代码
2.下载 Github上的Patch (使用GIT工具或者点击zip下载)
  1. $ git clone https://github.com/Squonk42/OpenWrt-RT5350.git
复制代码
3.为源代码打补丁
  1. cd trunck35407 
  2. patch -p0 <补丁路径//openwrt_add_pm25lq032_flash_support.patch
  3. patch -p0 <补丁路径//openwrt_add_rt5350_wlan_support.patch
  4. patch -p0 <补丁路径//openwrt_hame_mpr-a1.patch
复制代码
4.编译
trunck35407路径下执行
  1. make menuconfig
复制代码
Target Ssytem: Ralink RT288x/RT3xxx
    Subtarget: RT305x based boards
    Target Profile: HAME MPR-A1
保存后退出,执行
  1. make
复制代码
如果想查看详细编译信息,执行
  1. make V=99
复制代码
多核加速(双核是使用3参数,4核则使用5)
  1. make -j 3
复制代码
5.编译后的bin文件位于truck35407/bin/ramips/ramips/openwrt-ramips-rt305x-mpr-a1-squashfs-sysupgrade.bin 

ubuntu下烧录固件
1.需要拆壳,MPR-A1的壳子非常好拆,需要使用螺丝刀。
2.板子背面有四个焊点(V2.2的MPR-A1串口焊盘上面都盖了绿油需要手工刮开),串口各个引脚的定义:

3.连接TTL工具,TTL工具的质量有点要求,我手上的pl2303连上去之后MPR-A1不能启动,而另外一个FTDI的就正常,这个地方要注意一下。
4.安装putty
  1. sudo apt-get install putty
复制代码
设置串口波特率为57600,8,n,1.(dmesg | grep tty 可以用来查看串口号)
5.连接网线设置本机的地址为192.168.2.2(其他也可)
6.安装tftp,
  1. sudo apt-get install tftpd-hpa tftp
复制代码
, copy bin文件到/var/lib/tftpboot
  1. sudo cp 路径/openwrt-ramips-rt305x-mpr-a1-squashfs-sysupgrade.bin /var/lib/tftpboot  
复制代码
, 执行
  1. tftp 192.168.2.2
复制代码
7.启动MPR-A1, 在putty中快速按下2,烧录固件, 
输入Y,回车。
设置设备ip为192.168.2.1
设置服务器ip为192.168.2.2
输入bin文件的文件名openwrt-ramips-rt305x-mpr-a1-squashfs-sysupgrade.bin

一切顺利的话,现在你就拥用一台Hame mpr-a1的openwrt设备了。


原文地址:http://blog.csdn.net/onetwothreef/article/details/9143081

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值