OpenWrt Forum Archive

Topic: HAME MPR-A1 - Small and cheap router with built-in battery

The content of this topic has been archived between 12 May 2015 and 2 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Squonk wrote:

I also used mac80211 patch from http://heffer.fedorapeople.org/openwrt/ … 5350.patch

Can you test with this patch (http://pastebin.com/hc8NxHbL) and r34270 and see if wireless works for you?

I got wireless working in that revision and with that patch. Newer revision upgraded compat-wireless package and the patch didn't work anymore.

The only difference in our working boards is the flash and the ram. I checked your pcb layout (MPR-L8) with mine (a1 v1.4 so it seems) and they are the same.

arpunk wrote:
Squonk wrote:

I also used mac80211 patch from http://heffer.fedorapeople.org/openwrt/ … 5350.patch

Can you test with this patch (http://pastebin.com/hc8NxHbL) and r34270 and see if wireless works for you?

I got wireless working in that revision and with that patch. Newer revision upgraded compat-wireless package and the patch didn't work anymore.

The only difference in our working boards is the flash and the ram. I checked your pcb layout (MPR-L8) with mine (a1 v1.4 so it seems) and they are the same.

Ok, please allow me some time for that, I will checkout this rev aside from current trunk, and I have a slow machine...

Squonk wrote:

Ok, please allow me some time for that, I will checkout this rev aside from current trunk, and I have a slow machine...

Sure, in the meantime I'll try to get my board working with the AT25DF321 flash I have using this patch:

--- a/drivers/mtd/devices/m25p80.c
+++ b/drivers/mtd/devices/m25p80.c
@@ -633,6 +633,7 @@ static const struct spi_device_id m25p_i
     { "at25fs040",  INFO(0x1f6604, 0, 64 * 1024,   8, SECT_4K) },
 
     { "at25df041a", INFO(0x1f4401, 0, 64 * 1024,   8, SECT_4K) },
+    { "at25df321",  INFO(0x1f4700, 0, 64 * 1024,  64, SECT_4K) },
     { "at25df321a", INFO(0x1f4701, 0, 64 * 1024,  64, SECT_4K) },
     { "at25df641",  INFO(0x1f4800, 0, 64 * 1024, 128, SECT_4K) },
 

Give me a few minutes and I'll tell you how it went.

Edit: No luck, log says:

[    0.390000] ramips-spi ramips-spi.0: master is unqueued, this is deprecated
[    0.410000] m25p80 spi0.0: unrecognized JEDEC id 7f9d46
...
[    0.470000] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[    0.490000] Please append a correct "root=" boot option; here are the available partitions:
[    0.500000] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

(Last edited by arpunk on 17 Dec 2012, 23:42)

I tried the patched r34270: no luck, no wireless sad

I have a wlan0 interface, but no IP assigned to it. If I do, then I don't see any incoming data, though it accepts pings, and the OpenWrt SSID doesn't show on my PC:

root@OpenWrt:/etc/config# ifconfig wlan0
wlan0     Link encap:Ethernet  HWaddr 00:20:0C:06:35:A0  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:33 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:32 
          RX bytes:0 (0.0 B)  TX bytes:6417 (6.2 KiB)

As for your Flash problem, are you sure it is an Atmel chip? What is written onto the package? They may well have patched an entry in the JEDEC table... I see nothing wrong with your code and by looking at the AT25DF321 datasheet.

(Last edited by Squonk on 18 Dec 2012, 08:40)

Squonk wrote:

I tried the patched r34270: no luck, no wireless sad

I have a wlan0 interface, but no IP assigned to it. If I do, then I don't see any incoming data, though it accepts pings, and the OpenWrt SSID doesn't show on my PC:

Same here. Maybe we need someone more knowledgable than me (like Daniel Golle) look over the patch for the latest revision wink

Squonk wrote:

As for your Flash problem, are you sure it is an Atmel chip? What is written onto the package? They may well have patched an entry in the JEDEC table... I see nothing wrong with your code and by looking at the AT25DF321 datasheet.

Well the JEDEC ID of his chip is

spi device id: 7f 9d 46 7f 9d (9d467f9d)

So basically it's not 0x1f4700 (like in your patch) but 0x7f9d46. I have no idea what chip this actually is. So you'd definitely need to look what's written on the package. The OEM firmware however does seem to identify the chip as AT25DF321 and I guess that your chip is either that or is compatible to it.

Heffer wrote:
Squonk wrote:

I tried the patched r34270: no luck, no wireless sad

I have a wlan0 interface, but no IP assigned to it. If I do, then I don't see any incoming data, though it accepts pings, and the OpenWrt SSID doesn't show on my PC:

Same here. Maybe we need someone more knowledgable than me (like Daniel Golle) look over the patch for the latest revision wink

I tried to take a working wireless config from some other TP-Link TL-WR703N routers I have, to no avail sad

Wireless was working with the stock firmware, but not without any of the OpenWrt-based firmware I tried, including p1vo's.

Maybe there is an "RF power-switch" we are missing?



Heffer wrote:
Squonk wrote:

As for your Flash problem, are you sure it is an Atmel chip? What is written onto the package? They may well have patched an entry in the JEDEC table... I see nothing wrong with your code and by looking at the AT25DF321 datasheet.

Well the JEDEC ID of his chip is

spi device id: 7f 9d 46 7f 9d (9d467f9d)

So basically it's not 0x1f4700 (like in your patch) but 0x7f9d46. I have no idea what chip this actually is. So you'd definitely need to look what's written on the package. The OEM firmware however does seem to identify the chip as AT25DF321 and I guess that your chip is either that or is compatible to it.

As the AT25DF321 is the default chip used in Ralink's SDK, they may well have applied a dirty patch to the JEDEC table, see the typo in the bootlog smile:

deice id : 7f 9d 46 7f 9d (9d467f9d)
Warning: un-recognized chip ID, please update SPI driver!
AT25DF321(1f 47000000) (4096 Kbytes)
arpunk wrote:

Could you share at least what bits did you add for WLAN to work?

rt5350 use different rf_vals table for 20MHz/40MHz external clock generator. For details see last patches for rt3352 support. And keep in mind that 20MHz/40MHz external clock generator have no direct relation to HT20/HT40 channel.I've added support for rt3352 & rt5350 by myself so my current soure tree differs too much from trunk to create clear patch quickly.

arpunk wrote:

How did you corrected reset_fe?

As I said it looks like:

--- devices.c.orig      2012-12-18 20:32:27.000000000 +0600
+++ devices.c   2012-12-18 20:33:53.000000000 +0600
@@ -116,7 +116,7 @@
 
 static void rt305x_fe_reset(void)
 {
-       rt305x_sysc_wr(RT305X_RESET_FE, SYSC_REG_RESET_CTRL);
+       rt305x_sysc_wr(RT305X_RESET_FE | (soc_is_rt5350() ? RT305X_RESET_ESW : 0), SYSC_REG_RESET_CTRL);
        rt305x_sysc_wr(0, SYSC_REG_RESET_CTRL);
 }

I am using latest trunk (r34763), so I am using compat-wireless-2012-12-06 and the mac80211 package already contains these 2 patches:
http://patchwork.openwrt.org/patch/2883/ => 610-rt2x00-fix-rt3352-ext-pa.patch
http://patchwork.openwrt.org/patch/2901/ =>  611-rt2x00-rf_vals-rt3352-xtal20.patch

I also applied "630-rt2x00-support-rt5350.patch" from http://heffer.fedorapeople.org/openwrt/ … 350.patch.

root@OpenWrt:/lib/firmware# hexdump /dev/mtdblock2                              
0000000 5350 0100 2000 060c a035 ffff ffff ffff                                 
0000010 ffff ffff ffff ffff ffff ffff ffff ffff                                 
0000020 ffff ffff ffff ffff 419c 267c 954e 419c                                 
0000030 267c 974e ff11 0020 ffff 011d 7755 aaa8                                 
0000040 888c ffff 000c 0000 0000 0000 0000 ffff                                 
0000050 ffff 0d0d 0c0c 0b0c 0b0b 0b0b 0b0b 0b0b                                 
0000060 ffff ffff ffff ffff ffff ffff ffff ffff                                 
0000070 ffff ffff ffff 8003 ffff ffff ffff ffff                                 
0000080 ffff ffff ffff ffff ffff ffff ffff ffff                                 
*                                                                               
00000d0 ffff ffff ffff ffff ffff ffff ffff 6666                                 
00000e0 aacc 6688 aacc 6688 aacc 6688 aacc 6688                                 
00000f0 ffff ffff ffff ffff ffff ffff ffff ffff                                 
*                                                                               
0000120 0981 131c 154f 154f 1d03 1d07 ffff ffff                                 
0000130 ffff ffff ffff ffff ffff ffff ffff ffff                                 
*                                                                               
0010000

From what I can see, my physical crystal is a 40MHz, but I am not sure if this is the one that the software is detecting or not.

I removed the definition for the red LED in my "mach-mpr-a1.c"  file and at least I don't have the -16 (-EBUSY) error any more, but LED are still not working sad

I need to find an easy way to test the reset button (how to do it using debugfs?).

Switch is now working with your patch, thank you Serge!

123serge123 wrote:

rt5350 use different rf_vals table for 20MHz/40MHz external clock generator.

thanks for the tip!


with trunk(r34739) and these patches:

http://heffer.fedorapeople.org/openwrt/ … 5350.patch

631-rt2x00-rt5350-rf_vals.patch

diff -urN a/drivers/net/wireless/rt2x00/rt2800lib.c b/drivers/net/wireless/rt2x00/rt2800lib.c
--- compat-wireless-2012-12-06/drivers/net/wireless/rt2x00/rt2800lib.c
+++ compat-wireless-2012-12-06.new/drivers/net/wireless/rt2x00/rt2800lib.c
@@ -5363,7 +5363,6 @@
            rt2x00_rf(rt2x00dev, RF3022) ||
            rt2x00_rf(rt2x00dev, RF3290) ||
            rt2x00_rf(rt2x00dev, RF3320) ||
-           rt2x00_rf(rt2x00dev, RF5350) ||
            rt2x00_rf(rt2x00dev, RF5360) ||
            rt2x00_rf(rt2x00dev, RF5370) ||
            rt2x00_rf(rt2x00dev, RF5372) ||
@@ -5371,7 +5370,8 @@
            rt2x00_rf(rt2x00dev, RF5392)) {
         spec->num_channels = 14;
         spec->channels = rf_vals_3x;
-    } else if (rt2x00_rf(rt2x00dev, RF3322)) {
+    } else if (rt2x00_rf(rt2x00dev, RF3322) ||
+           rt2x00_rf(rt2x00dev, RF5350)) {
         spec->num_channels = 14;
         if (spec->clk_is_20mhz)
             spec->channels = rf_vals_xtal20mhz_3x;

wifi now works on my dir320nru/revb1

Please pay attention that register rf13 = 0x1f/0x9f for 20MHz/40MHz clock generator. My dir320b1 works too but it have 20MHz smile. Full patch looks like
http://pastebin.com/q5hbehXv

I confirm RT5350 radio now works.

serge, would you mind submitting the RT5350 patch for inclusion in trunk? You can take the patch I adapted from yours, no need to credit me (as you did all the work anyway smile).

I confirm that WiFi is working now with latest trunk and Heffer's last patch on my HAME MPR-A1-compatible MPR-L8 board.

I found out that the "RT305X_GPIO_MODE_JTAG" flag in the  rt305x_gpio_init() call is required to have LEDs working, so now II have both blue and red LED working, as well as the reset button and the Ethernet switch.

However, USB is not working any more, despite that I have both GPIO 7 and 12 set to 1: the attached devices is powered, but I don't see any attach/detach messages in log any more sad

BTW, can someone explain the role of GPIO12?

EDIT: Never mind, I was missing kmod-usb2 tongue
I added it to the profile dependencies with kmod-usb-core and kmod-ledtrig-usbdev.

As for the GPIOs usage regarding USB:

  • GPIO7 controls USB power: when toggling, the device power toggles accordingly

  • it looks like GPIO12 is controlling the USB root hub power: when toggling, the device power is not modified, but you see connect/disconnect events in the kernel logs accordingly

(Last edited by Squonk on 20 Dec 2012, 19:31)

Heffer wrote:

serge, would you mind submitting the RT5350 patch for inclusion in trunk? You can take the patch I adapted from yours, no need to credit me (as you did all the work anyway smile).

Thx, WLAN and switch patches are sent. smile

@arpunk: IIRC, you have an MPR1-compatible board with 8MB Flash / 32 MB SDRAM... Could you post a link where to find it, please?

This seems to be sold under the brand Sanoxy WR-M3GU12 also, for example on Amazon for 4x the price. Manual: http://sanoxy.com/manuals/WR-M3GU12.pdf

I would also be interested in a link for the 8MB Flash / 32 MB SDRAM version.

arpunk wrote:

There are different models for that same RT5350F 3G modem. I currently have one from Embedsys (EBS-PMA-W1) and another from other factory (it isn't labeled at all, assuming a prototype).

I hame EBS-PMA-W1 too. Could you post serial pinouts ?

arteqw wrote:
arpunk wrote:

There are different models for that same RT5350F 3G modem. I currently have one from Embedsys (EBS-PMA-W1) and another from other factory (it isn't labeled at all, assuming a prototype).

I hame EBS-PMA-W1 too. Could you post serial pinouts ?

Sure, the pinouts are (ethernet facing left):

1. ground
2. rx
3. tx
4. vcc

Squonk wrote:

@arpunk: IIRC, you have an MPR1-compatible board with 8MB Flash / 32 MB SDRAM... Could you post a link where to find it, please?

Of course, I haven't got enought time but so far the switch does not work on those boards (Embedsys ESB-PMA-M1) but wireless *does* work, however I get random resets on those boards.

I managed to change the flash chip of my working board (a1-v1.4) but OpenWRT runs very very slow with the flash I changed (I changed the pm25lq032 flash with a en25q32b flash).

I'll post my findings later today.

I've been following this thread with interest, and have just ordered my device.  In the 703N board layout thread, Squonk suggested that some manufacturer of this board might be willing to produce a custom, hacker-friendly version.  I, too, would like to see a 2nd usb port, 8mb flash, 32mb ram, and gpios brought out (micro-sd desireable but less important to me).

I would like to see something like this for a gpio header:

  1 = 3V3    2 = 5V
  3 = GPIO0  4 = GPIO4
  5 = GPIO1  6 = GND
  7 = GPIO2  8 = TX
  9 = GPIO3  10= RX
 11 = GND    12= GND
 13 = i2cSCL 14= TX2
 15 = i2cSDA 16= RX2

This is similar to the Raspberry Pi header, with fewer pins, and no N/Cs.  Pins 1, 2, 3, 5, 6, 8, 9 are the same.  A second serial TX and RX would be helpful, and I2C.  There are three 0V pins to make specific 3-pin connections easy for TX/RX, TX2/RX2, I2C.

(Last edited by lizby on 22 Dec 2012, 17:25)

lizby wrote:

I've been following this thread with interest, and have just ordered my device.  In the 703N board layout thread, Squonk suggested that some manufacturer of this board might be willing to produce a custom, hacker-friendly version.  I, too, would like to see a 2nd usb port, 8mb flash, 32mb ram, and gpios brought out (micro-sd desireable but less important to me).

I would like to see something like this for a gpio header:

  1 = 3V3    2 = 5V
  3 = GPIO0  4 = GPIO4
  5 = GPIO1  6 = GND
  7 = GPIO2  8 = TX
  9 = GPIO3  10= RX
 11 = GND    12= GND
 13 = i2cSCL 14= TX2
 15 = i2cSDA 16= RX2

This is similar to the Raspberry Pi header, with fewer pins, and no N/Cs.  Pins 1, 2, 3, 5, 6, 8, 9 are the same.  A second serial TX and RX would be helpful, and I2C.  There are three 0V pins to make specific 3-pin connections easy for TX/RX, TX2/RX2, I2C.

My Company is producing the 32mb/8mb version of this device. We will start shipping them in February. With Openwrt built in.
This is our own prototype Image shown below.
PunBB bbcode test
PunBB bbcode test
PunBB bbcode test

We have not made any changes to GPIO. But i might consider it. What advantages from an openwrt perspective would there be in having additional GPIOs besides sd flash?

(Last edited by swatfa on 22 Dec 2012, 20:14)

swatfa wrote:

My Company is producing the 32mb/8mb version of this device. We will start shipping them in February. With Openwrt built in.

Does this mean there is (or soon will be) a working OpenWRT image available?

denovo wrote:
swatfa wrote:

My Company is producing the 32mb/8mb version of this device. We will start shipping them in February. With Openwrt built in.

Does this mean there is (or soon will be) a working OpenWRT image available?

There is a "somewhat" working image available, at this stage the developer is ironing out any bugs and making sure that everything runs smoothly. Than they need to load some popular packages e.g. cloud sharing, webcam support, airplay support, etc than we would be ready for mass production and shipment

(Last edited by swatfa on 22 Dec 2012, 20:08)