OpenWrt Forum Archive

Topic: Hi-Link wireless module HLK-RM04

The content of this topic has been archived between 31 Dec 2017 and 26 Apr 2018. Unfortunately there are posts – most likely complete pages – missing.

tman wrote:
ABATAPA wrote:

What pin corresponds to GPIO 11?

GPIO11 isn't available on the HLK-RM04 module pins. Look at the link provided by e_lm_70 above to see which GPIOs are available.

Thank you, I saw it.
Then another question: now in trunk in the description dts no GPIO, which could be used. How to release GPIO?
I patch target/linux/ramips/dts/HLKRM04.dts :

                state_default: pinctrl0 {
                        gpio {
                                ralink,group = "i2c", "jtag", "rgmii", "mdio";
                                ralink,function = "gpio";
                        };
                };

After this I can do:
for i in 11 12 13; do
  echo $i >  /sys/class/gpio/export
done

But only this gpio.
How I can use free pins as GPIO? What changes should I make in HLKRM04.dts?

Hello Everyone,

I'm joining the discussion because I also encountered some problems with this board, and with OpenWRT as well.

Just to give you a short summary on my use case:
When I first heard about VoCore, I got pretty enthusiastic about it, and got the idea of a homebrew project in which I would integrate it into the housing of a 4 port USB-serial adapter, and thus convert it to a low-power, network-enabled remote router-administration solution.
Then I asked a friend of mine, whether he knows any alternatives to VoCore (which will only ship October 2014), and he showed me this board.

Currently I have a board, with flashed u-boot (most likely) from "Hame MPR-A1", with a 8 MB SPI flash chip, and the default amount of ram. (I have plans to upgrade it to 32 MB of RAM.)

I have currently two build environments for OpenWRT:
A) one with the latest trunk version, with kernel 3.10.36
B) one with the revision 38333 of the trunk (as originally suggested by JiapengLi's guide) with kernel version 3.10.13

Right now I'm having some problems with flashing firmware images via tftp, from the boot loader:

Bytes transferred = 3670020 (380004 hex)
NetBootFileXferSize= 00380004
raspi_erase_write: offs:50000, count:380004
raspi_erase: offs:50000 len:380000
........................................................
raspi_write: to:50000 len:380000
........................................................
raspi_read: from:50000 len:10000
.blocksize write incorrect block#=0!
## Booting image at bc050000 ...
raspi_read: from:50000 len:40
.Bad Magic Number,FFFFFFFF

What I can do now, is trying to boot the uImage firmware image via tftp-boot (so without flashing), and enter failsafe mode during the boot.

At this point, as it turned out, both build environments produced flawed images:

- With the images built in "A", I encountered the same problem as fgomes mentioned in post #112 (2014-05-09 00:56:59). When booting the image, it will hang after printing the line:

[ 0.220000] TCP: Hash tables configured (established 512 bind 512) 
[ 0.230000] TCP: reno registered 
[ 0.240000] UDP hash table entries: 256 (order: 0, 4096 bytes) 
[ 0.250000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) 
[ 0.260000] NET: Registered protocol family 1

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

[ 0.160000] TCP: reno registered
[ 0.160000] UDP hash table entries: 256 (order: 0, 4096 bytes)
[ 0.180000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
[ 0.190000] NET: Registered protocol family 1
[ 0.200000] rt-timer 10000100.timer: maximum frequncy is 7324Hz
[ 0.240000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.260000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.

So my guess would be, that something might be wrong about the rt-clock, or something in the vicinity.

- The images compiled in "B" do boot, but I can't really put them to any use, because the TCP checksum offload seems to be broken, so any TCP and most likely UDP packets too are generated by the board are discarded at the other end of the communication channel, because their checksums are incorrect.
IP, and ICMP work fine, the board responds to pings, but everything above TCP and UDP is broken.*

There is a patch for this, but I can only apply it to 3.10.36, because the file drivers/net/ethernet/ralink/ralink_soc_eth.c was modified so heavily between 3.10.13 and 3.10.36.
http://patchwork.openwrt.org/patch/4655/

So basically I'm stuck with two sets of firmware images, neither of which actually work.

*: This is a big problem, because in order to recover the flash (see the above bad magic number error), I should be able to somehow transfer either the uImage, or the sysupgrade.bin to the board, to do a sysupgrade, or simply dd the uImage to the appropriate mtd partition. (TFTP and netcat won't work because of the invalid checksums.)

My future plans include generating images for 8 MBs of flash chips, because the current images have a hardcoded kernel command line, and so only 4 MBs of flash are usable. (AFAIK, I will need to modify the HLKRM04.dts and the target/linux/ramips/image/Makefile files for this.)

(Last edited by wowbaggerHU on 19 Jun 2014, 15:18)

Hello Everyone,

I've managed to make some progress since yesterday:
The images compiled in the "A" envornment don't hang anymore, but they crash in the end because the system runs out of the 16 MB RAM during boot.
Basically all I did was disabling the kmod-rfkill and rfkill-related confinguration entried in "make menuconfig". I don't exactly know how this influences how the kernel boots, but it doesn't hang anymore.

A few interesting things that are worth mentioning are:
- this is an image built with the flash size increased to 8MB (in the .dts file, and in the Makefile as well).
- the mtdparts section of the built-in kernel command line seems to be missing! (I will have to debug this later on, but right now it seems, that the other images were missing the "mtdparts=" section of the command line as well.)
- the reserved memory size during the boot was significantly lower with in the image built in the "B" environment (with kernel 3.10.13), and I suspect that this might be the cause of the OOM killer firing:

3.10.13:

[  0.000000] Memory: 13176k/16384k available (2104k kernel code, 3208k reserved, 526k data, 184k init, 0k highmem)

3.10.36:

[  0.000000] Memory: 10996k/16384k available (2127k kernel code, 5388k reserved, 548k data, 2312k init, 0k highmem)

The boot log:

Automatic boot of image at addr 0x80800000 ...
## Booting image at 80800000 ...
   Image Name:   HLK-RM02
   Created:  2014-06-19  21:48:50 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:  3206878 Bytes =  3.1 MB
   Load Address: 80000000 
   Entry Point:  80000000 
   Verifying Checksum ... OK  
   Uncompressing Kernel Image ... OK  
No initrd 
## Transferring control to Linux (at address 80000000) ...  
## Giving linux memsize in MB, 16 

Starting kernel ... 

[  0.000000] Linux version 3.10.36 (janos@debian-build) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r41055) ) #38 Thu Jun 19 23:48:40 CEST 2014  
...
[  0.000000] Kernel command line: console=ttyS1,57600 rootfstype=squashfs,jffs2 mem=16M 
[  0.000000] PID hash table entries: 64 (order: -4, 256 bytes)  
[  0.000000] Dentry cache hash table entries: 2048 (order: 1, 8192 bytes) 
[  0.000000] Inode-cache hash table entries: 1024 (order: 0, 4096 bytes)  
[  0.000000] Writing ErrCtl register=00021ec2 
[  0.000000] Readback ErrCtl register=00021ec2  
[  0.000000] Memory: 10996k/16384k available (2127k kernel code, 5388k reserved, 548k data, 2312k init, 0k highmem) 
[  0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 
...
[  0.250000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)  
[  0.260000] NET: Registered protocol family 1  
[  4.980000] rt-timer 10000100.timer: maximum frequncy is 7324Hz  
[  5.040000] squashfs: version 4.0 (2009/01/31) Phillip Lougher 
[  5.050000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.  
[  5.070000] msgmni has been set to 21  
[  5.080000] io scheduler noop registered 
[  5.090000] io scheduler deadline registered (default) 
[  5.100000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled 
[  5.120000] 10000500.uart: ttyS0 at MMIO 0x10000500 (irq = 13) is a 16550A 
[  5.130000] 10000c00.uartlite: ttyS1 at MMIO 0x10000c00 (irq = 20) is a 16550A 
[  5.150000] console [ttyS1] enabled, bootconsole disabled  
[  5.150000] console [ttyS1] enabled, bootconsole disabled  
[  5.190000] m25p80 spi32766.0: found s25fl064k, expected gd25q64 
[  5.200000] m25p80 spi32766.0: s25fl064k (8192 Kbytes) 
[  5.210000] 4 ofpart partitions found on MTD device spi32766.0 
[  5.220000] Creating 4 MTD partitions on "spi32766.0": 
[  5.230000] 0x000000000000-0x000000030000 : "u-boot" 
[  5.240000] 0x000000030000-0x000000040000 : "u-boot-env" 
[  5.260000] 0x000000040000-0x000000050000 : "factory"  
[  5.270000] 0x000000050000-0x000000400000 : "firmware" 
[  5.290000] swapper: page allocation failure: order:0, mode:0x200020 
[  5.290000] CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.36 #38  
[  5.290000] Stack : 00000000 00000000 00000000 00000000 804e2ee2 00000033 8082c1a8 00000000  

[  5.290000] Call Trace:  
[  5.290000] [<800101d0>] show_stack+0x48/0x70  
[  5.290000] [<8005b750>] warn_alloc_failed+0x108/0x12c 
[  5.290000] [<8005d940>] __alloc_pages_nodemask+0x3a0/0x634  
[  5.290000] [<800830d0>] new_slab+0xb0/0x2b8 
[  5.290000] [<80083eac>] __slab_alloc.isra.73.constprop.77+0x1f4/0x400 
[  5.290000] [<80084234>] kmem_cache_alloc+0x3c/0xec  
[  5.290000] [<80181980>] build_skb+0x44/0xc8 
[  5.290000] [<80184010>] __netdev_alloc_skb+0x6c/0x114 
[  5.290000] [<8016f83c>] fe_alloc_skb.isra.31+0x14/0x40  
[  5.290000] [<802ae0f4>] fe_init+0x1bc/0x5ac 
[  5.290000] [<80191424>] register_netdevice+0xa4/0x48c 
[  5.290000] [<80191828>] register_netdev+0x1c/0x38 
[  5.290000] [<8016f7a0>] fe_probe+0x1bc/0x244  
[  5.290000] [<8014f0d8>] driver_probe_device+0xcc/0x20c  
[  5.290000] [<8014f2f8>] __driver_attach+0x7c/0xb4 
[  5.290000] [<8014d488>] bus_for_each_dev+0x98/0xa8  
[  5.290000] [<8014e710>] bus_add_driver+0x108/0x24c  
[  5.290000] [<8014f720>] driver_register+0xbc/0x16c  
[  5.290000] [<802adf14>] init_rtfe+0x24/0x48 
[  5.290000] [<8000bea0>] do_one_initcall+0xf0/0x198  
[  5.290000] [<8029ea78>] kernel_init_freeable+0x150/0x208  
[  5.290000] [<80008bb0>] kernel_init+0x10/0x10c  
[  5.290000] [<80004878>] ret_from_kernel_thread+0x14/0x1c  
[  5.290000]  
[  5.290000] Mem-Info:  
[  5.290000] Normal per-cpu:  
[  5.290000] CPU  0: hi:  0, btch:   1 usd:   0 
[  5.290000] active_anon:0 inactive_anon:0 isolated_anon:0  
[  5.290000]  active_file:79 inactive_file:2118 isolated_file:0 
[  5.290000]  unevictable:0 dirty:0 writeback:0 unstable:0  
[  5.290000]  free:39 slab_reclaimable:100 slab_unreclaimable:196
[  5.290000]  mapped:0 shmem:0 pagetables:0 bounce:0
[  5.290000]  free_cma:0
[  5.290000] Normal free:156kB min:416kB low:520kB high:624kB active_anon:0kB inactive_anon:0kB active_file:316kB inactive_file:8472kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:16384kBo
[  5.290000] lowmem_reserve[]: 0 0
[  5.290000] Normal: 1*4kB (U) 1*8kB (U) 1*16kB (U) 0*32kB 0*64kB 1*128kB (U) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 156kB
[  5.290000] 2197 total pagecache pages
[  5.290000] 0 pages in swap cache
[  5.290000] Swap cache stats: add 0, delete 0, find 0/0
[  5.290000] Free swap  = 0kB
[  5.290000] Total swap = 0kB
[  5.290000] SLUB: Unable to allocate memory on node -1 (gfp=0x20)
[  5.290000]   cache: files_cache, object size: 192, buffer size: 192, default order: 0, min order: 0
[  5.290000]   node 0: slabs: 0, objs: 0, free: 0
[  5.890000] ralink_soc_eth 10100000.ethernet: error bringing up device
[  5.900000] ralink_soc_eth: probe of 10100000.ethernet failed with error -12
[  6.020000] kworker/u2:0 invoked oom-killer: gfp_mask=0x3000d0, order=1, oom_score_adj=0
[  6.030000] CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 3.10.36 #38
[  6.040000] Workqueue: khelper __call_usermodehelper
[  6.050000] Stack : 80844000 8023ed78 00000abd 80288ed0 00000000 003000d0 00000001 00000000
  00000000 8001b4b0 00000006 80035574 8082d698 003000d0 8025e8d8 80847c14
  80847c14 8001b4b0 00000000 800318a4 00000006 000000af 00000000 00000000
  00000000 00000000 00000000 00000000 00000000 00000000 6c65686b 00726570
  00000000 00000000 00000000 00000000 80845000 80845100 8002c9a4 80847bc0
  ...
[  6.130000] Call Trace:
[  6.130000] [<800101d0>] show_stack+0x48/0x70
[  6.140000] [<8005a08c>] dump_header.isra.16+0x4c/0x13c
[  6.150000] [<8005aaf0>] out_of_memory+0x270/0x2e4
[  6.160000] [<8005db70>] __alloc_pages_nodemask+0x5d0/0x634
[  6.170000] [<800176f4>] copy_process.part.77+0xe0/0xcfc
[  6.180000] [<80018408>] do_fork+0xe0/0x25c
[  6.190000] [<800185b4>] kernel_thread+0x30/0x3c
[  6.200000] [<8002ca04>] __call_usermodehelper+0x60/0xcc
[  6.210000] [<8002f560>] process_one_work+0x228/0x364
[  6.220000] [<8003040c>] worker_thread+0x234/0x388
[  6.230000] [<80035208>] kthread+0xb0/0xb8
[  6.240000] [<80004878>] ret_from_kernel_thread+0x14/0x1c
[  6.250000]
[  6.250000] Mem-Info:
[  6.260000] Normal per-cpu:
[  6.260000] CPU  0: hi:  0, btch:   1 usd:   0
[  6.270000] active_anon:0 inactive_anon:0 isolated_anon:0
[  6.270000]  active_file:79 inactive_file:0 isolated_file:0
[  6.270000]  unevictable:2118 dirty:0 writeback:0 unstable:0
[  6.270000]  free:39 slab_reclaimable:100 slab_unreclaimable:196
[  6.270000]  mapped:0 shmem:0 pagetables:0 bounce:0
[  6.270000]  free_cma:0
[  6.330000] Normal free:156kB min:416kB low:520kB high:624kB active_anon:0kB inactive_anon:0kB active_file:316kB inactive_file:0kB unevictable:8472kB isolated(anon):0kB isolated(file):0kB present:16384kBs
[  6.410000] lowmem_reserve[]: 0 0
[  6.420000] Normal: 1*4kB (U) 1*8kB (U) 1*16kB (U) 0*32kB 0*64kB 1*128kB (U) 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 156kB
[  6.440000] 2197 total pagecache pages
[  6.450000] 0 pages in swap cache
[  6.450000] Swap cache stats: add 0, delete 0, find 0/0
[  6.460000] Free swap  = 0kB
[  6.470000] Total swap = 0kB
[  6.480000] 4096 pages RAM
[  6.480000] 1347 pages reserved
[  6.490000] 34308 pages shared
[  6.490000] 2596 pages non-shared
[  6.500000] [ pid ]   uid  tgid total_vm  rss nr_ptes swapents oom_score_adj name
[  6.520000] Kernel panic - not syncing: Out of memory and no killable processes...

Hi All,

I've made little progress since my last post.
To me, it seems that the OOM situation seems to occur due to the RaLink ethernet driver (in ralink_soc_eth.c) in kernel version 3.10.36.

Let me illustrate this with the boot logs:

kernel 3.10.36 with compiled-in RaLink ethernet driver:

[  4.000000] m25p80 spi32766.0: found s25fl064k, expected gd25q64  
[  4.010000] m25p80 spi32766.0: s25fl064k (8192 Kbytes)  
[  4.020000] 4 ofpart partitions found on MTD device spi32766.0  
[  4.030000] Creating 4 MTD partitions on "spi32766.0":  
[  4.040000] 0x000000000000-0x000000030000 : "u-boot"  
[  4.060000] 0x000000030000-0x000000040000 : "u-boot-env"  
[  4.070000] 0x000000040000-0x000000050000 : "factory"   
[  4.080000] 0x000000050000-0x000000400000 : "firmware"  
[  4.110000] swapper: page allocation failure: order:0, mode:0x20  
[  4.110000] CPU: 0 PID: 1 Comm: swapper Not tainted 3.10.36-hlkrm02-svn39949 #66  
[  4.110000] Stack : 00000000 00000000 00000000 00000000 80502ee2 00000044 8082c1a8 00000000   
[  4.110000] Call Trace:   
[  4.110000] [<800101d0>] show_stack+0x48/0x70   
[  4.110000] [<8005b750>] warn_alloc_failed+0x108/0x12c  
[  4.110000] [<8005d940>] __alloc_pages_nodemask+0x3a0/0x634   
[  4.110000] [<80196424>] __netdev_alloc_frag+0x78/0x184   
[  4.110000] [<801985a8>] __netdev_alloc_skb+0x58/0x114  
[  4.110000] [<801704c8>] fe_alloc_skb.isra.31+0x14/0x40

kernel 3.10.13 with compiled-in RaLink ethernet driver:

[  4.990000] 10000500.uart: ttyS1 at MMIO 0x10000500 (irq = 13) is a 16550A  
[  5.020000] m25p80 spi32766.0: s25fl064k (8192 Kbytes)  
[  5.030000] 4 ofpart partitions found on MTD device spi32766.0  
[  5.040000] Creating 4 MTD partitions on "spi32766.0":  
[  5.050000] 0x000000000000-0x000000030000 : "u-boot"  
[  5.060000] 0x000000030000-0x000000040000 : "u-boot-env"  
[  5.080000] 0x000000040000-0x000000050000 : "factory"   
[  5.090000] 0x000000050000-0x000000400000 : "firmware"  
[  5.120000] eth0: done loading  
[  5.120000] rt3xxx-usbphy ubsphy.3: loaded
[  5.130000] rt2880_wdt 10000120.watchdog: Initialized
[  5.150000] TCP: cubic registered
[  5.150000] NET: Registered protocol family 17
[  5.160000] 8021q: 802.1Q VLAN Support v1.8
[  5.200000] Freeing unused kernel memory: 2224K (80294000 - 804c0000)
Console is alive

kernel 3.10.36 without compiled-in RaLink ethernet driver:

[  4.060000] 4 ofpart partitions found on MTD device spi32766.0
[  4.080000] Creating 4 MTD partitions on "spi32766.0":
[  4.090000] 0x000000000000-0x000000030000 : "u-boot"
[  4.100000] 0x000000030000-0x000000040000 : "u-boot-env"
[  4.110000] 0x000000040000-0x000000050000 : "factory"
[  4.130000] 0x000000050000-0x000000400000 : "firmware"
[  4.140000] rt3xxx-usbphy ubsphy.3: loaded
[  4.160000] rt2880_wdt 10000120.watchdog: Initialized
[  4.170000] TCP: cubic registered
[  4.170000] NET: Registered protocol family 17
[  4.180000] 8021q: 802.1Q VLAN Support v1.8
[  4.220000] Freeing unused kernel memory: 2332K (80299000 - 804e0000)

As it can be seen (in case of 3.10.13, see middle excerpt), the initialization of the on-board ethernet controller runs just after the mtd partitions are autodetected, and that's exactly when the OOM errors start occuring with 3.10.36 (first excerpt).
I even managed to put together a kernel+openwrt config that magages to boot with 3.10.36, but sadly, I had to remove Ethernet support for this (last piece of boot log).

Any comments, and ideas on how to proceed from here are warmly welcome!
Stay tuned...

Hi,

is it possible to flash OpenWRT via the serial port? I only have the HLK-RM04 module and no development board. I connected VCC, GND, RX and TX. Via Wifi I was able to flash uboot. When powered up the uboot menu is displayed. The problem is, there is no option to "flash system code via serial". If I hit "4" there is a command prompt. I guess that using the command "loadb" I can upload a file. But to which address? Does anyone have more insight into this?

U-Boot 1.1.3 (Jan  9 2014 - 18:11:05)                                     

Board: Ralink APSoC DRAM:  16 MB                                
relocate_code Pointer at: 80fb4000                                  
spi_wait_nsec: 42                 
spi device id: ef 40 16 0 0 (40160000)                                      
find flash: W25Q32BV                    
raspi_read: from:30000 len:1000                               
.*** Warning - bad CRC, using default environment                                                 

============================================                                            
Ralink UBoot Version: 3.6.0.0                             
--------------------------------------------                                            
ASIC 5350_MP (Port5<->None)                           
DRAM_CONF_FROM: Boot-Strapping                              
DRAM_TYPE: SDRAM                
DRAM_SIZE: 256 Mbits                    
DRAM_WIDTH: 16 bits                   
DRAM_TOTAL_WIDT              
TOTAL_MEMORY_SIZE: 32 MBytes                            
Flash component: SPI Flash                          
Date:Jan  9 2014  Time:18:11:05                               
============================================                                            
icache: sets:256, ways:4, linesz:32 ,total:32768                                                
dcache: sets:128, ways:4, linesz:32 ,total:16384                                

 ##### The CPU freq = 360 MHZ ####
 estimate memory size =16 Mbytes

Please choose the operation:
   1: Load system code to SDRAM via TFTP.
   2: Load system code then write to Flash via TFTP.
   3: Boot system code via Flash (default).
   4: Entr boot command line interface.
   7: Load Boot Loader code then write to Flash via Serial.
   9: Load Boot Loader code then write to Flash via TFTP.

> But to which address? Does anyone have more insight into this?
It can spy in the logs on the pages OpenWRT WiKi, but wiki.openwrt.org now does not work.

Hi,

after trying endlessly several addresses from logs and tutorials, I gave up. The best result I could achieve was an LZMA error 1.

I then disassembled an old NIC and wired the module to its port. Tftpd was no problem then. So I can flash now.

The next problem is to find a minimal OpenWRT configuration. I want to compile it by myself. I don't know yet which options are absolutely needed for network and wifi. I already managed to compile one without /etc/config/network wink

Hi

how did u manage to connect the NIC to the hlk without the dev board. i have been trying for hours and keep getting link status disconnected with the stock firmware.

anistig wrote:

how did u manage to connect the NIC to the hlk without the dev board.


Datasheet here:
http://dangerousprototypes.com/forum/do … p?id=11135
Do not forget to
ifconfig eth0 up

(Last edited by ABATAPA on 27 Jun 2014, 05:31)

On the NIC I (mis)use, there is no "MagJack" port, so I could not simply wire it to the port. I instead googled for the data sheet of the transformer on the NIC, and soldered the wires (TXOP1, TXON1, RXIN1, RXIP1 and VDD_1.8) to its corresponding pins. This is pretty ugly and there is no shield around those wires... but since there are several layers of error correction features in the network protocols it worked. Tftpd workes and I already tried different images.

Currently I am using the one from the OpenWRT server (under snapshots). This is the only one with DHCP and wireless ap mode. If I try to compile one myself I end up with an image without /etc/config/network. Network does not work then...
The official precompiled version is fine. However, RAM is a big problem! And I need a simple web server for my application. The next thing I will try is to disable unneeded modules. There are tons of them in the firmware I do not need (USB, PPPoE, LED stuff, ...). They are all loaded, so I guess, if I find a way to prevent this, I will have more free RAM.
I also helps so disable certain daemons: telnet, ntpd, also the led stuff.

(Last edited by blubbb on 27 Jun 2014, 10:05)

We need bare "modules" for our application, i.e. with pin header, separate UART. HLK-RM04 would be ok and its price is fantastic. Maybe we can convince Hilink to create a version with 32M RAM.....

If you need more ram take a look at Carambola 1 and Carambola 2 devices.

Yes, we know Carambola. However, it is too expensive for this project. Also, Carambola 2 has no pin header. Back to topic please. wink

(Last edited by blubbb on 27 Jun 2014, 15:55)

Thanks i did find the datasheet and followed the datasheet i still can't seem to get linux to reconginze the ethernet from the hlk rm04

here is how i wired it
TXOP1(pin 11)  -  > cat 5 (pin 1)
TXON1(pin 12)  -  >  cat 5 (pin 2)
RXIP1(pin 16)  - >  cat 5( pin 3)
RXIN1(pin 15) - >  cat 5 (pin 6)
1.8 vdd (pin 27)  -> cat 5 (pin 4 & 5)

the cable still shows up as disconencted.

doesn't seem like i am getting any activity on the hlk-rm04 on the lan ports

i can't figure out whats wrong

the wifi seems to be working managed to get uboot installed via the wifi page.

Does your LAN connector have a transformer? Like a MagJack? If not, you need one! You can't just connect the LAN cable... I used one from an old NIC (LF-H50X), looked for a datasheet and compared it to the schematics in the HLK-RM04 datasheet.
Example (for LF-H50X):
http://i.imgur.com/Mi8SW4o.jpg
http://www.wasp.kz/Stat_PC/m-b/shuttle_ak39n/lf-h50x.jpg
A MagJack has all this stuff already built in. This would be the best solution, of course.

(Last edited by blubbb on 28 Jun 2014, 20:24)

In relation to my problem with the OOM errors during the boot, I made some progress.
After many unsuccessful attempts to get my images to boot, I discovered some relation between the image size, and whether the image simply hangs, runs out of memory, or boots properly.
I built a stripped-down version of OpenWRT with ethernet support only (I threw out USB and WiFi support among others), and so the image size went down to 1.6 MB, and with this version, the image booted successfully, and the Ethernet driver also worked (no running out of memory), and now TCP and UDP connections work (no bad checksums) as well. (On this last topic: I don't know whether the patch fixed it, or if it was OK in 3.10.36 by default. What's sure, is that the patch didn't break anything.)

[  1.660000] m25p80 spi32766.0: found s25fl064k, expected gd25q64  
[  1.680000] m25p80 spi32766.0: s25fl064k (8192 Kbytes)  
[  1.690000] 6 cmdlinepart partitions found on MTD device spi32766.0   
[  1.700000] Creating 6 MTD partitions on "spi32766.0":  
[  1.710000] 0x000000000000-0x000000030000 : "u-boot"  
[  1.720000] 0x000000030000-0x000000040000 : "u-boot-env"  
[  1.740000] 0x000000040000-0x000000050000 : "factory"   
[  1.750000] 0x000000050000-0x000000130000 : "kernel"  
[  1.760000] 0x000000130000-0x000000800000 : "rootfs"  
[  1.780000] mtd: device 4 (rootfs) set to be root filesystem  
[  1.790000] mtdsplit: no squashfs found in "spi32766.0"   
[  1.800000] 0x000000050000-0x000000800000 : "firmware" 

On the other hand, I'm experiencing flash-related problems now.
The whole point of getting Ethernet working, was that this way I could copy files over to the board.
The problem is that I couldn't flash any new image from u-boot via TFTP, because the process always failed when trying to verify writes to the flash.
Currently the board doesn't boot openwrt from flash at all (u-boot still works), because it can't find the magic number of the Linux kernel image. (

 Bad Magic Number,FFFFFFFF 

)
I'm booting over TFTP now, at least that option still works, and when OpenWRT is done booting, I copy over my image of choice over TFTP, and try to dd it into the "firmware" partition. (I tried sysupgrade as well, but the results were the same.)
The process seems to finish successfully, in that it doesn't yield any error messages about I/O errors or anything, but if I try to re-read the contents of the "firmware" partition, all I get is just a bing bunch of "FF"s.

I'm thinking that I will have to replace the 8 MB flash chip I currently have installed, to get rid of this behavior.
Has anyone experienced anything similar to this?

wowbaggerHU wrote:

I built a stripped-down version of OpenWRT with ethernet support only


Why? If all is going well and works from the unstable branch or trunk?

ABATAPA wrote:

Why? If all is going well and works from the unstable branch or trunk?

As I mentioned, I had to boot the image via TFTP, because I encountered  problems with the onboard 8 MB flash (a friend of mine replaced the original), and flashing the firmware in general.
I had to reduce the image size, because my original openwrt build (which included some built-in extra packages - it was about 3.1 MB with initramfs built-in) always hung, or ran out of memory during boot.
In order to decrease the memory footprint of the running firmware, I decided to strip-down the original package/feature set, to see whether it improves the situation. As expected, it resolved the hanging, and OOM problems during boot.
Now I'm back with my original problem - the flash chip being most likely faulty.

Hi
Is it possible to add support for RS-485, as it is in the original firmware?
I mean control transfer (RTS).
In the original firmware using PIN9

will a bitbang works for you?
you can toggle output pin with gpio control and connect it to your 485 driver flow control.

HLK-RM04 supports "full UART" mode with CTS/RTS. See .dts file for details.

Is it correct that the wifi led is inverse, i.e. it is on and goes off shortly on access?

Sorry, I've never worked with openvart.
You can describe more?

chuvakpasha wrote:

Sorry, I've never worked with openvart.
You can describe more?

It is here:

--- a/trunk/target/linux/ramips/dts/HLKRM04.dts
+++ b/trunk/target/linux/ramips/dts/HLKRM04.dts

                                ralink,function = "gpio";
                        };
                };
+               uartf_pins: uartf {
+                       uartf {
+                                ralink,group = "uartf";
+                                ralink,function = "uartf";
+                        };
+                };
        };
 
        ethernet@10100000 {

See also https://forum.openwrt.org/viewtopic.php … 37#p222837 and gaplee's original post.
But the overall procedure is rather complicated and requires substantial linux knowledge.

(Last edited by dimonix on 5 Jul 2014, 18:24)