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.

perazim wrote:

I am waiting for a supplier to build one of these with a built-in 3G modem.

And while they are at it, an on-board SLIC ATA interface too.

Perazim

Great!

It would be nice to have more Flash and SDRAM capacity, too...

Let us know if this become available!

@Squonk I managed to enable the GPIO 7 in my board def. as you suggested and USB is working now smile

I haven't been able to test it fully due to some squashfs errors when I try to use LuCI or when using the console (serial) at random times.

The flash type I'm using is "m25p32-nonjedec". Official firmware outputs: AT25DF321 (1f 47000000) (4096 Kbytes). Full output:

AT25DF321(1f 47000000) (4096 Kbytes)
mtd .name = raspi, .size = 0x00400000 (4M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Creating 7 MTD partitions on "raspi":
0x00000000-0x00400000 : "ALL" 
0x00000000-0x00030000 : "Bootloader" 
0x00030000-0x00040000 : "Config" 
0x00040000-0x00050000 : "Factory" 
0x00050000-0x0015a6aa : "Kernel" 
mtd: partition "Kernel" doesn't end on an erase block -- force read-only
0x0015a6aa-0x01000000 : "RootFS" 
mtd: partition "RootFS" extends beyond the end of device "raspi" -- size truncated to 0x2a5956
mtd: partition "RootFS" doesn't start on an erase block boundary -- force read-only
0x00050000-0x01000000 : "Kernel_RootFS" 
mtd: partition "Kernel_RootFS" extends beyond the end of device "raspi" -- size truncated to 0x3b0000

I have another rt5350 board but with different flash:

EN25Q64(1c 30171c30) (8192 Kbytes)
mtd .name = raspi, .size = 0x00800000 (8M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Creating 7 MTD partitions on "raspi":
0x00000000-0x00800000 : "ALL" 
0x00000000-0x00030000 : "Bootloader" 
0x00030000-0x00040000 : "Config" 
0x00040000-0x00050000 : "Factory" 
0x00050000-0x0015a734 : "Kernel" 
mtd: partition "Kernel" doesn't end on an erase block -- force read-only
0x0015a734-0x01000000 : "RootFS" 
mtd: partition "RootFS" extends beyond the end of device "raspi" -- size truncated to 0x6a58cc
mtd: partition "RootFS" doesn't start on an erase block boundary -- force read-only
0x00050000-0x01000000 : "Kernel_RootFS" 
mtd: partition "Kernel_RootFS" extends beyond the end of device "raspi" -- size truncated to 0x7b0000

However, when I try to boot OpenWRT on the 8Mb flash ralink the kernel freezes at:

[    0.000000] Linux version 3.6.10 (arpunk@bela) (gcc version 4.6.4 20121106 (prerelease) (Linaro GCC 42
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] Ralink RT5350 id:1 rev:3 running at 360.00 MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]

These are the sdram:

- M12L128168A (4mb ralink)
- EM639165TS-6G (8mb ralink)

Any hints on where I should look at?

arpunk wrote:

@Squonk I managed to enable the GPIO 7 in my board def. as you suggested and USB is working now smile

Great! I'm glad it worked as expected!

arpunk wrote:

However, when I try to boot OpenWRT on the 8Mb flash ralink the kernel freezes at:

[    0.000000] Linux version 3.6.10 (arpunk@bela) (gcc version 4.6.4 20121106 (prerelease) (Linaro GCC 42
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] Ralink RT5350 id:1 rev:3 running at 360.00 MHz
[    0.000000] Determined physical RAM map:
[    0.000000]  memory: 02000000 @ 00000000 (usable)
[    0.000000] Initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   Normal   [mem 0x00000000-0x01ffffff]
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x00000000-0x01ffffff]

These are the sdram:

- M12L128168A (4mb ralink)
- EM639165TS-6G (8mb ralink)

Any hints on where I should look at?

There is something wrong here: the kernel reports 32MB (0x02000000), but the EM639165TS-6G is a 8Mbit x16bit, so only 16MB... See datasheet.

However, I don't know where the kernel is getting this size? In the cmdline args? You may try to locate the "Determined physical RAM map:" message in the sources and see how this is computed.

There is something wrong here: the kernel reports 32MB (0x02000000), but the EM639165TS-6G is a 8Mbit x16bit, so only 16MB... See datasheet.

Look for the EM63A165TS-6G (16Mx16bitx1MB).

Regards.

p1vo wrote:

And guys pls try http://www.pivo.neostrada.pl/openwrt-ra … pgrade.bin
and let me know is it stable or not.

It looks like it doesn't work as is on my MPR-L8 board sad

Can you post the patches so I can try to figure out what is going on?

p1vo wrote:

New Revision of Hame A1 -  v1.4 vs v.2.1

http://www.pivo.neostrada.pl/20121213_172148small.jpg

And guys pls try http://www.pivo.neostrada.pl/openwrt-ra … pgrade.bin
and let me know is it stable or not.

I try it , it works except the ethernet. My board isn't the Hame A1 . I guess maybe switch wrong.

Would be great if you shared your patches somewhere.

123serge123 wrote:

I start porting to rt5350 based router (dlink dir-320b1). Switch, usb,wifi work. Images for test rt5350-flash8M-mem32M-sysupgrage.bin or rt5350-flash8M-mem16M-sysupgrage.bin. Memory size autodetect don't work (kernel crash) so two files. Wifi work is configured for 20MHz clock generator.

Is the USB wired to GPIO 7? does the ethernet switch work out of the box with OpenWRT?

Please SHARE your patches!

Posting binaries is useless!

@Squonk I specified the correct memory size (mem=16M) but I don't have ethernet working on that board. USB also does not work even if I wire up the GPIO 7.

So my plan is to add the correct flash type (AT25DF321) to the board I have ethernet working. I currently hit a lot of squashfs errors (http://pastebin.com/EVpb1D4Y) probably because I'm using m25p32-nonjedec as flash type.

The original ralink SDK specifies the SPI flash as:

{ "AT25DF321",          0x1f, 0x47000000, 64 * 1024, 64,  0 },

(Last edited by arpunk on 15 Dec 2012, 22:52)

@Squonk also, one board I have reports a EN25Q64 (8MB) flash but OpenWRT does not recognize that ID and instead it falls back to EN25Q32B (4MB):

[    0.390000] ramips-spi ramips-spi.0: master is unqueued, this is deprecated
[    0.410000] m25p80 spi0.0: found en25q32b, expected en25q64
[    0.420000] m25p80 spi0.0: en25q32b (4096 Kbytes)
[    0.430000] 6 cmdlinepart partitions found on MTD device spi0.0
[    0.440000] Creating 6 MTD partitions on "spi0.0":
[    0.450000] 0x000000000000-0x000000030000 : "u-boot"
[    0.460000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.480000] 0x000000040000-0x000000050000 : "factory"
[    0.490000] 0x000000050000-0x000000130000 : "kernel"
[    0.510000] 0x000000130000-0x000000400000 : "rootfs"
[    0.520000] mtd: partition "rootfs" set to be root filesystem
[    0.530000] mtd: partition "rootfs_data" created automatically, ofs=370000, len=90000 
[    0.550000] 0x000000370000-0x000000400000 : "rootfs_data"
[    0.560000] 0x000000050000-0x000000400000 : "firmware"

Could you tell us how exactly you proceed?

Are you starting from trunk?

Which patches  do you apply?

How many boards do you have, and what are their characteristics?

Can you make a short status on each one, I am lost!

Can you take pictures of the PCB, as it looks like there are numerous variants.

Thanks!

@Squonk sure, let me sum it up.

I have 5 ralink rt5350 boards but 3 of them are different. They are all boot OpenWRT (trunk) but only one of them has working USB, ethernet switch and I got WiFi working on r34270 (compat-wireless-2012-09-07) with a patch Daniel Golle sent me a few weeks back on that board.

The board I have ethernet and USB working has a 4MB FLASH (AT25DF321 (1f 47000000) (4096 Kbytes)) and 16MB RAM (M12L128168A).

The original flash layout is as follows:

# cat /proc/mtd 
dev:    size   erasesize  name
mtd0: 00400000 00010000 "ALL" 
mtd1: 00030000 00010000 "Bootloader" 
mtd2: 00010000 00010000 "Config" 
mtd3: 00010000 00010000 "Factory" 
mtd4: 0010a6aa 00010000 "Kernel" 
mtd5: 002a5956 00010000 "RootFS" 
mtd6: 003b0000 00010000 "Kernel_RootFS" 
#

And stock firmware reports this SPI flash:

AT25DF321(1f 47000000) (4096 Kbytes)
mtd .name = raspi, .size = 0x00400000 (4M) .erasesize = 0x00010000 (64K) .numeraseregions = 0
Creating 7 MTD partitions on "raspi":
0x00000000-0x00400000 : "ALL" 
0x00000000-0x00030000 : "Bootloader" 
0x00030000-0x00040000 : "Config" 
0x00040000-0x00050000 : "Factory" 
0x00050000-0x0015a6aa : "Kernel" 
mtd: partition "Kernel" doesn't end on an erase block -- force read-only
0x0015a6aa-0x01000000 : "RootFS" 
mtd: partition "RootFS" extends beyond the end of device "raspi" -- size truncated to 0x2a5956
mtd: partition "RootFS" doesn't start on an erase block boundary -- force read-only
0x00050000-0x01000000 : "Kernel_RootFS" 
mtd: partition "Kernel_RootFS" extends beyond the end of device "raspi" -- size truncated to 0x3b0000

Currently I get squashfs errors on the working board, that's why I haven't been able to use it further (check this reply: https://forum.openwrt.org/viewtopic.php … 3#p186173)

With the help of PaulFertser in IRC I managed to get it working in OpenWRT using m25p32-nonjedec as flash type in my board definition. The red and blue leds I got them with your help posting the info of the polish forum (as well as working USB).

The other ralink boards I have (with serial attached) have different flash and ram chips, as well as a sightly different PCB layout. I don't have high-res pictures at the moment, I'll post them later. This is the board that doesn't have USB nor ethernet working: http://imgur.com/f86vU

To make them work, I passed the memory size as kernel parameter since it seems the bootloader reports a wrong size, freezing the kernel at boot.

USB and ethernet does not work on them atm and I haven't tried all the GPIO ports yet. Those boards also randomly reboot themselfs.

The device shows the ethernet ports but it just doesn't respond.

[   23.120000] device eth0.1 entered promiscuous mode
[   23.130000] device eth0 entered promiscuous mode
[   23.160000] br-lan: port 1(eth0.1) entered forwarding state
[   23.170000] br-lan: port 1(eth0.1) entered forwarding state
[   25.170000] br-lan: port 1(eth0.1) entered forwarding state
root@OpenWrt:/# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:11:22:33:44:55  
          inet addr:192.168.1.1  Bcast:192.168.1.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:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0      Link encap:Ethernet  HWaddr 00:11:22:33:44:55  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:1191 (1.1 KiB)
          Interrupt:5 

eth0.1    Link encap:Ethernet  HWaddr 00:11:22:33:44:55  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth0.2    Link encap:Ethernet  HWaddr 00:11:22:33:44:55  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:1179 (1.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@OpenWrt:/#

So:

- ralink board with AT25DF321 flash: USB, Ethernet and WiFi (reverting to r34270 and Daniel's patch) work, no random reboots, squashfs errors (and different PCB than the other ralinks).

- ralink boards with EN25Q64 flash: USB, Ethernet and WiFi does not work, random reboots, flash does not get recognized.

Also, check my last 2 posts regarding the flash chip.

OK, thank you!

What I would be interesting for others to know in details is what you did to make it work:

  • trunk revision used

  • exact target/subtarget/profile chosen

  • patches that have been applied and where to find them

  • "mach-*" file that has been used, containing what has been added to the board setup

  • network config, including wireless driver and maybe also binary firmware used

We should try to put everything together to get things working faster, Instead of doing each our of experiments at random...

This should start by finding a way to describe all the boards that we have and highlight their common features and differences, then list precisely the method we used to get such and such things working, not throwing unidentified binary firmwares that are likely not working in every situation, given the multiple differences we have seen so far in the hardware.

Particularly, there seems to be a lot of remaining problem with Flash/SDRAM, and now a little bit less with USB, wireless and Ethernet.

If we share our knowledge, we have better chances to find out what is going on.

My board is an MPR-L8 which look very similar to the HAME-A1:
http://imageshack.us/a/img441/6029/mprl8pcbtop.png
http://imageshack.us/a/img821/9373/mprl8pcbbottom.png

It has an EtronTech EM639165TS-6G 8Mbitx16bit 16MB SDRAM and a Winbond W25Q32BV 32Mbitx8bit 4MB Flash, but unlike other boards, it has only a very limited busybox msh shell with only a few useless commands available, even using the serial console sad.

What I want to do first is to backup everything using U-Boot, then start to play with a custom firmware... But as my flash map is not exactly the same as a HAME, I will have to tweak it a bit! Same for GPIOs, LEDs, etc.

(Last edited by Squonk on 16 Dec 2012, 01:59)

arpunk wrote:

Is the USB wired to GPIO 7? does the ethernet switch work out of the box with OpenWRT?

1. USB works out of the box so I don't think that GPIO7 used.
2. Memsize was corrected with kernel parameter.
3. Switch start working after corrected reset_fe (see devices.c) - legacy driver reset frame engine and switch together. Symptom: swconfig show received packets in active port but no interrupts in /proc/interrupts from enet.
4. WLAN support was added based on dlink gpl ftp://ftp.dlink.ru/pub/Router/DIR-320_N … NRU.tar.gz

Squonk wrote:

Please SHARE your patches!

Posting binaries is useless!

Keep patience. Tests and patches refreshing upto current trunk need more time smile

123serge123 wrote:
Squonk wrote:

Please SHARE your patches!

Posting binaries is useless!

Keep patience. Tests and patches refreshing upto current trunk need more time smile

I am not asking for clean, polished patches that you just need to pull from trunk, but at least to share the pieces of code that makes something work.

The fact that nobody is sharing the "mach-*' board support file is significant of a deliberate attempt to retain information for unknown reasons: I have seldom seen such a low level of sharing knowledge for a new OpenWrt-based platform, thus my lack of patience...

What individual developers should realize though, is that we are facing here is a reference design made by Ralink, that has been adapted and modified more or less by several unnamed Chinese manufacturer. So this is not like you try to port OpenWrt to a new router by a single manufacturer as usual.

There will be some common features and some variants among manufacturers, but also differences among different revisions from the same manufacturer: the quite radical changes for the Hame A1 -  v1.4 vs v.2.1 is a good example.

The only way to make these boards work quickly and reliably with OpenWrt is by sharing our experience as a community, not by doing our stuff alone. This doesn't prevent some commercial developments, and actually I think that this could help them, as this could accelerate the time to market.

123serge123 wrote:
arpunk wrote:

Is the USB wired to GPIO 7? does the ethernet switch work out of the box with OpenWRT?

1. USB works out of the box so I don't think that GPIO7 used.
2. Memsize was corrected with kernel parameter.
3. Switch start working after corrected reset_fe (see devices.c) - legacy driver reset frame engine and switch together. Symptom: swconfig show received packets in active port but no interrupts in /proc/interrupts from enet.
4. WLAN support was added based on dlink gpl ftp://ftp.dlink.ru/pub/Router/DIR-320_N … NRU.tar.gz

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

Squonk wrote:

OK, thank you!

What I would be interesting for others to know in details is what you did to make it work:

  • trunk revision used

  • exact target/subtarget/profile chosen

  • patches that have been applied and where to find them

  • "mach-*" file that has been used, containing what has been added to the board setup

  • network config, including wireless driver and maybe also binary firmware used

We should try to put everything together to get things working faster, Instead of doing each our of experiments at random...

This should start by finding a way to describe all the boards that we have and highlight their common features and differences, then list precisely the method we used to get such and such things working, not throwing unidentified binary firmwares that are likely not working in every situation, given the multiple differences we have seen so far in the hardware.

Particularly, there seems to be a lot of remaining problem with Flash/SDRAM, and now a little bit less with USB, wireless and Ethernet.

If we share our knowledge, we have better chances to find out what is going on.

My board is an MPR-L8 which look very similar to the HAME-A1:
...

It has an EtronTech EM639165TS-6G 8Mbitx16bit 16MB SDRAM and a Winbond W25Q32BV 32Mbitx8bit 4MB Flash, but unlike other boards, it has only a very limited busybox msh shell with only a few useless commands available, even using the serial console sad.

What I want to do first is to backup everything using U-Boot, then start to play with a custom firmware... But as my flash map is not exactly the same as a HAME, I will have to tweak it a bit! Same for GPIOs, LEDs, etc.

Hi Squonk,

1. I used from r34270 to latest trunk with the following mach-*.c: http://pastebin.com/qR6QSxg8 (I used pocketap4 as identifier because I do not know the board name, revision or manufacturer.)

2. I choosed:

- Target system: Ralink RT288x/RT3xxx
- Subtarget: RT305x based boards
- Profile: default profile.

3. The patches that I applied to trunk for WLAN: http://pastebin.com/AAfwdS5Z (this applies to trunk but does not activate the wireless)

4. The patches that I applied to r34270 for WLAN: http://pastebin.com/hc8NxHbL (this applies to r34270, older compat-wireless-2012-09-07)

My board images are here: http://imgur.com/CDKyH,QvRNt,Y3ByQ,iOJyc#0 (the boards named Embedsys are the ones on which ethernet and USB does not work.)

6. By network config, what do you mean exactly? I have only used the compat-wireless work that comes with OpenWRT. By binary drivers you mean the ones that come with the stock firmware?

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

Squonk wrote:

My board is an MPR-L8 which look very similar to the HAME-A1:
...

It has an EtronTech EM639165TS-6G 8Mbitx16bit 16MB SDRAM and a Winbond W25Q32BV 32Mbitx8bit 4MB Flash, but unlike other boards, it has only a very limited busybox msh shell with only a few useless commands available, even using the serial console sad.

What I want to do first is to backup everything using U-Boot, then start to play with a custom firmware... But as my flash map is not exactly the same as a HAME, I will have to tweak it a bit! Same for GPIOs, LEDs, etc.

The boad I have working is exactly the same layout as yours but with different flash (AT25DF321 http://www.soselectronic.com/a_info/res … 5DF321.pdf ) and SDRAM (ESMT m12l128168a  www.esmt.com.tw/DB/manager/upload/M12L128168A.pdf).

Mine didn't come with a msh shell. I had a full working terminal. I have a working bootloader for that board (ralink U-Boot 3.6.0.0)

What flash map do you have?

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

Thank you for sharing your detailed config!

Here is my flash map:

0x00000000-0x00030000 : "Bootloader"
0x00030000-0x00040000 : "Config"
0x00040000-0x00050000 : "Factory"
0x00050000-0x00150000 : "Kernel"
0x00150000-0x00400000 : "RootFS"
0x00050000-0x00400000 : "Firmware"

In the meantime, I replaced it with firmware from p1vo: LAN, USB, blue LED is GPIO20 defined as a led, red LED is GPIO17 (active low GPIO only, no LED def) are working, I have a wlan0 but can't connect to any SSID, no RF packet sent/received.

If I export GPIO7, I am able to toggle USB power of an attached device on/off and when on, it enumerates correctly, so I guess USB is working ok. It looks like your board having the USB not working by default is just because of lack of init in the bootloader.

No problem with Flash (except "m25p80 spi0.0: found w25q32, expected pm25lq032") or SDRAM (I only have 16MB, though...).

I will try to roll my own image based on your config, but I will define a separate MPR-A1 config instead of using default.

(Last edited by Squonk on 17 Dec 2012, 23:19)

OK, I created my own image to replace p1vo's one, and it is almost working the same, except that I provide the patch is available below wink

I created an "MPR-A1" profile, so I compile using (I had to flush "tmp"):

  • Target system: Ralink RT288x/RT3xxx

  • Subtarget: RT305x based boards

  • Profile: HAME MPR-A1.

Here is the patch to trunk (revision 34735): http://pastebin.com/jESjc2nH

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

Ethernet and USB are working, GPIO7 is pre-declared as "USB power" and working as expected, but wireless doesn't work as with p1vo's firmware sad

I also have an issue with LEDs: both are on but not full brightness, and nothing in "/sys/cless/leds":

- preinit -
[    5.130000] leds-gpio: probe of leds-gpio failed with error -16
Press the [f] key and hit [enter] to enter failsafe mode

and

root@OpenWrt:/sys/class/leds# ls
rt2800pci-phy0::assoc    rt2800pci-phy0::quality  rt2800pci-phy0::radio
root@OpenWrt:/sys/class/leds# cd /sys/class/gpio/
root@OpenWrt:/sys/class/gpio# ls
export      gpio7       gpiochip0   gpiochip24  gpiochip40  unexport