Re: Hi-Link wireless module HLK-RM04

Jenshoej

try this

make kernel_menuconfig
find kernel hacking , enter and then find(rootfstype=squashfs,jffs2) Default kernel command string
enter again and manually set SDRAM value rootfstype=squashfs,jffs2 mem=16M

Re: Hi-Link wireless module HLK-RM04

My first attempt to upload openwrt using the built in web upload method failed and left me with a device that didn't do anything. Think the problem was that I compiled with the latest from subversion and not the specific revision mentioned in the readme. (At that time the revision number in the readme was different from now, and the patches didn't apply, so I just assumed I should use the newest)

So I had to desolder the flash, and upload a new uboot. For this I used uboot128.img from git. This boots ok, and I can then upload the image using tftp.

I compiled OpenWrt again using revision 38333. I followed the instructions in the git readme for patching and configuring. Only difference was that I didn't select LuCI. No errors during patching and compiling, so I assume all is ok.

But the kernel doesn't boot.

Full boot log below:

U-Boot 1.1.3 (Jul 31 2013 - 23:35:04)

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 
.raspi_read: from:30000 len:1000 
.============================================ 
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_WIDTH: 16 bits
TOTAL_MEMORY_SIZE: 32 MBytes
Flash component: SPI Flash
Date:Jul 31 2013  Time:23:35:04
============================================ 
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. 
4 3 2 1 0 
   
3: System Boot system code via Flash.
## Booting image at bc050000 ...
raspi_read: from:50000 len:40 
.   Image Name:   HLK-RM02
   Created:      2013-10-24  11:49:35 UTC
   Image Type:   MIPS Linux Kernel Image (lzma compressed)
   Data Size:    970333 Bytes = 947.6 kB
   Load Address: 80000000
   Entry Point:  80000000
raspi_read: from:50040 len:ece5d 
...............   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.13 (jonas@mint) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2013.05 r38333) ) #1 Thu Oct 24 13:49:23 CEST 2013
[    0.000000] SoC Type: Ralink RT5350 id:1 rev:3
[    0.000000] bootconsole [early0] enabled
[    0.000000] CPU revision is: 0001964c (MIPS 24KEc)
[    0.000000] MIPS: machine is HILINK HLK-RM04
[    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]

53 (edited by jenshoej 2013-10-25 19:20:58)

Re: Hi-Link wireless module HLK-RM04

WrtQuater wrote:

make kernel_menuconfig
find kernel hacking , enter and then find(rootfstype=squashfs,jffs2) Default kernel command string
enter again and manually set SDRAM value rootfstype=squashfs,jffs2 mem=16M

Ok, this worked. Now I'm able to boot.

But then after 180 seconds I get a crash and an out of memory error. Is this what I should expect when I only have 16M?

Re: Hi-Link wireless module HLK-RM04

jenshoej

I flashed my hlk-rm04 a few days ago.

I compiled my openwrt by following JiapengLi's instruction. Just like you I encountered the 'memory not set to 16M' issue and resolved it by setting the SDRAM value to 'rootfstype=squashfs,jffs2 mem=16M'.

At first, I used the ***-factory.bin and it didn't boot. It booted fine after I used ****-Sysupgrade.bin.

Can you post your boot log?

Re: Hi-Link wireless module HLK-RM04

I think I just bricked my module how can I retrive it.
I followed step by step the instructions availiable on
https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04
and I compiled and obtained number of binary files
one of them was
openwrt-ramips-rt305x-hlk-rm04-initramfs-factory.bin
I uploaded the image on the original HiLink firmware update webpage (my module version is HLK V1.7StartKit)

And It uploaded and then rebooted the module.
After reboot my module became brick.
Which means no SSID,the module RED light is only on even I connceted it to the LAN Eth,
If I connect the Cable to WAN port and then connect the cable to PC both green lights on th LAN socket will start blinking.
I do not know how can I un-brick it.  :-(
If I am obligated to unsolder the flash and reprogram it where can I find a detailed tutorial on how to do it.
 
Thanks

Re: Hi-Link wireless module HLK-RM04

sina wrote:

I think I just bricked my module how can I retrive it.
I followed step by step the instructions availiable on
https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04
and I compiled and obtained number of binary files
one of them was
openwrt-ramips-rt305x-hlk-rm04-initramfs-factory.bin
I uploaded the image on the original HiLink firmware update webpage (my module version is HLK V1.7StartKit)

And It uploaded and then rebooted the module.
After reboot my module became brick.
Which means no SSID,the module RED light is only on even I connceted it to the LAN Eth,
If I connect the Cable to WAN port and then connect the cable to PC both green lights on th LAN socket will start blinking.
I do not know how can I un-brick it.  :-(
If I am obligated to unsolder the flash and reprogram it where can I find a detailed tutorial on how to do it.
 
Thanks

I am very sorry about this.
A few days ago, someone sent me a mail said that the 16M version HLK-RM04 can't start up. After dig it, i found that the memory node in dts file doesn't work. Now i think there are two ways to solve this bug:

1. If you can modify the hardware then this way fits you.
Change the memory configure resistor to the right place. Follow http://wiki.openwrt.org/toh/hilink/hlk- … figuration

2. If you have once replaced the uboot of the HLK-RM04, then you can use the new uboot(which outputs prompt characters to uartlite) to update the firmware.

Re: Hi-Link wireless module HLK-RM04

Hi gaplee,
I have a 16M as well. I used the same dts from your wiki. My unit kept running out of memory especially when wifi is turned on. I wonder why I was able to flash mine last week. I following the same instruction, except I flashed with uboo123.img first and then flashed the bin file I compiled through the  serial console. Why would my works? Could you post the updated dts file please?

Re: Hi-Link wireless module HLK-RM04

WrtQuater wrote:

Hi gaplee,
I have a 16M as well. I used the same dts from your wiki. My unit kept running out of memory especially when wifi is turned on. I wonder why I was able to flash mine last week. I following the same instruction, except I flashed with uboo123.img first and then flashed the bin file I compiled through the  serial console. Why would my works? Could you post the updated dts file please?

I don't get you very much. Can you explain it? What is the problem? Because i've modified the HLK-RM04 to 16M flash and 32M SDRAM, so i didn't test the 4M/16M version much.  Don't you solve the problem by setting the mem=16M in kernel menuconfig?

Replace the uboot is recommended, as we can update firmware even if OpenWrt is not in its way.

The dts file (the patch) is on my github https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04.
This patch is maintained for sometime. But unfortunately, there are still several problems need to be fixed.
1. Enable uartfull.
There are two UARTs of HLK-RM04, it is its advantage. Most RT5350 routers use only one uart(the uartlite) to supply the serial console, the other UART(the uartfull) is used as GPIOs, in this station uartlite is register as /dev/ttyS0, and the /dev/ttyS0 is the serial console. But after enable uartfull, the uartlite is register as /dev/ttyS1, and uartfull is /dev/ttyS1, in this station uartfull is used as the Serial Console, which we hope uartlite can be.
I solved this by changing the order of uartlite node and uartfull node, it seems that the node in the first position first registered.
This is a dirty way.
2. Memory configuration
The memory configuration of HLK-RM04 is in wrong. 16M SDRAM is on it but memory configuration is in 32M mode. I've mentioned this on wiki. Make the memory configuration to be right is recommended, it'll save much time.
Months ago we can use a memory node to force set the 16M SDRAM, but now it doesn't work, maybe it is caused by OpenWrt updating or Linux kernel updating. Not sure about this.
3. LEDs is not in their ways, this need a proper uboot first i think, only about the polarity.

Any idea is appreciated. If we solve these problem then we can send these patches to the OpenWrt trunk.

Many guys are interested in HLK-RM04 module, i've received some emails that ask info about this module.

Re: Hi-Link wireless module HLK-RM04

Sorry gaplee. I was taking about the fact that Sina bricked his module followed your instruction. I did the same thing but mine is working, except for the fact that it kept running out of memory.

I am new at openwrt and trying to figure how to solve the memory issue. Your post mentioned that there is an issue with the memory node in dts. (Which I don't how that work yet). So I thought that might be related to the memory issue I am having.

Here is what I encountered. If I compile the openwrt using your instruction, https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04 and set the mem=16M in kernel config. The module runs out of memory before the initialization completed, as experienced by jenshoej (post 54). Sometimes it works after I reboot or it works after I flash the module with the same bin again. It's very strange.

After hlk-rm04 initialized without memory error, I enabled wifi by changing /etc/config/wireless. It will run out of memory again if I restart. It works fine if the wifi is disable.

I started using your 'hlk-rm04-16m-luci-usb-mjpg.bin' and it works without any issue. (I am using trunk 38333)

The bottom line is that I intent to make changes to openwrt so I have to use the bin that I compile.

Back to memory issue

You said, (post 56)

A few days ago, someone sent me a mail said that the 16M version HLK-RM04 can't start up. After dig it, i found that the memory node in dts file doesn't work. Now i think there are two ways to solve this bug:
and then (post 58)

The dts file (the patch) is on my github https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04.

So, did you just updated it or it has been there for a while.

I am trying to figure out if I am using the correct dts. (I will google how to config memory node in dts )


you said
"The memory configuration of HLK-RM04 is in wrong. 16M SDRAM is on it but memory configuration is in 32M mode. I've mentioned this on wiki. Make the memory configuration to be right is recommended, it'll save much time.
....
Months ago we can use a memory node to force set the 16M SDRAM, but now it doesn't work,"

so the question is how to create a correct memory configuration?

1. cannot set 16M configuration in dts file? 
2. what about mem=16M in kernel menuconfig -- I don't have enough information yet. May be my memory issue is related to code rather then setting.

Re: Hi-Link wireless module HLK-RM04

1. About the patch on Github.
I have kept updating it for a while. If interested, see the commit log.

2. Memory things.
I think run out of memory and OpenWrt can't start are caused by two different reasons.
What @Sina said that the OpenWrt can't start should be fixed by add mem=16M in kernel menuconfig just as what you said in #p51.
Because OpenWrt keeps updating the Linux kernel, and i guess memory cost relates to Linux kernel closely. The kernel version used by the   'hlk-rm04-16m-luci-usb-mjpg.bin' is different with the r38333.

I am sorry, my English beat me down. Try my best to explain what i want to say, but ...
Hope you can understand.

Also, do you want to try r38025?
https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04 has two branches, one is called master, the other is called r38025, some drivers of ramips is changed from r38026. Some bugs maybe brought in.
If you want compile the r38025, please change the flash size settings of the patch and force set the memory to 16M.

jp

Re: Hi-Link wireless module HLK-RM04

I am experiencing the same issue as @Sina. 

Note that I changed to mem=16M in kernel menuconfig but still OpenWrt can't start.  I followed the exact instructions on Github using 3 different modules, and none of them start :-p

I'm not mad/worried, this is part of the development process.  It would be nice to know how to get them unbricked.  I will try changing the resistors later, and will report back here.

-Z

Re: Hi-Link wireless module HLK-RM04

X1sc0, It's too bad you bricked three modules.  I flashed mine by replacing the ubott128.img first by following http://wiki.openwrt.org/toh/hilink/hlk-rm04 and please ensure that you are using 57600,8,n,1.

Re: Hi-Link wireless module HLK-RM04

hope this helps save someone's time

I had some troubles with my stock opkg configuration file, because every time I tried the command opgk update it would always return  that the architecture was wrong. So I found this configiration for ramips in a Spanish forum and the opkg started to work again

Here is the code:
    src/gz barrier_breaker http://downloads.openwrt.org/snapshots/ … s/packages
    dest root /
    dest ram /tmp
    lists_dir ext /var/opkg-lists
    option overlay_root /overlay
    arch all 100
    arch ramips 200
    arch rt305x 300
    arch ramips_24kec 400

64 (edited by jenshoej 2013-11-04 15:52:05)

Re: Hi-Link wireless module HLK-RM04

x1sc0 wrote:

It would be nice to know how to get them unbricked.

I think you need to desolder the flash chip and then use an external programmer to upload uboot128.img.
I used flashrom and a RaspeberryPi and http://www.flashrom.org/RaspberryPi, which worked without any problems.

Re: Hi-Link wireless module HLK-RM04

Depends on what part of the boot process is dead.  If it's just OpenWRT, then you should be able to still use uboot to recover.

Re: Hi-Link wireless module HLK-RM04

From the git repo, I was trying this:

3. access http://192.168.16.254/HLK_RM04.asp, replace 192.168.16.254 with yours, if you've changed it once.

But I get a page not found.  All other pages are found.  Did I miss a step?  I did upgrade uboot successfully (I can see console messages).  I'm using the Wireless interface to access the module (that shouldn't matter?).  I can see two other locations to upgrade the firmware, but those URLs are quite different.

Re: Hi-Link wireless module HLK-RM04

Hi all,

I just succeeded putting OpenWRT on this little module. Didn't got the web upload feature to work, but I'm handy with a soldering iron and desoldered the flash rom and put the bootloader on it manually. (Trashing the factory and firmware partitions in the process... but that's a problem for another time.)

Now, I'm trying to connect the module to some electronics using the GPIO pins. The problem is that this doesn't seem to work:

root@OpenWrt:/sys/class/gpio# echo 14 > export 
[ 1379.770000] rt2880-pinmux pinctrl.1: pin 14 is not set to gpio mux
[ 1379.780000] rt2880-pinmux pinctrl.1: request() failed for pin 14
[ 1379.790000] rt2880-pinmux pinctrl.1: pin-14 (pio:14) status -22
ash: write error: Invalid argument
root@OpenWrt:/sys/class/gpio# 

This happens with all the pins (except gpio0, whicg gives a different error because it's already bound to the system activity LED). Any idea why this happens? Is there something I need to modify in the dts, or is there something wrong with the kernel code itself?

Re: Hi-Link wireless module HLK-RM04

Yes, I would suspect the dts file needs updating/correcting.  I need to look closer that this as well as I need to add a 1-wire device and an external switch to some GPIO pins shortly.

Re: Hi-Link wireless module HLK-RM04

I actually got it to work eventually (I think, this was the last step in an evening of hacking) by changing the uartf-mode in the dts from (iirc) 'gpio uart' to 'gpio'. The mux code seems to only set all the bits in the group to gpio when the string is 'gpio'; that may be a bug in the mux code itself; as is, I don't see how the 'gpio uart' mode would work.

Re: Hi-Link wireless module HLK-RM04

Hi, I got few HLK-RM04 devices and would like to have OpenWrt running on them, reading through this thread I'm not sure what best course of action to take.

Is HLK-RM04 supported in latest trunk version or does latest source code still need patching to get support for HLK-RM04 ?

How stable is OpenWrt on HLK-RM04? I see some of you have memory issues and crashes, this sounds really bad, did anybody get OpenWrt to run 100% stable for few days? How?

Re: Hi-Link wireless module HLK-RM04

I'm running trunk from a day ago.  No issues.  Still had to use patches, but they applied without much fuss.

Seems stable, but I haven't had them up for more than 24 hours thus far with all the development I've been doing.

Can't comment on memory issues, I've upgraded all my modules to 32MB.  Perhaps if you're good with command line uci and text file configurations, you can omit web luci and uhttpd to save space and memory usage.

Re: Hi-Link wireless module HLK-RM04

Has anybody pushed these patches to openwrt trunk to that they get integrated so there is no more need for patching?

Re: Hi-Link wireless module HLK-RM04

I managed to install OpenWrt trunk image without Luci but this seams completely unusable to me with only 16MB of ram. Device constantly has kernel crashes and reboots...

Is OpenWrt stable for you if you also have 16MB ?

Re: Hi-Link wireless module HLK-RM04

It was perfectly stable for me, but I've stripped OpenWRT down to what I really need, which isn't much... no LuCI, no uhttpd, no USB stuff, ..., everything to make it as light as possible. It unfortunately is 'stable' in a completely different way now because of a loose 12V cable which made some unfortunate connection, but I've got two new ones on their way.

Re: Hi-Link wireless module HLK-RM04

elaber wrote:

there is a firmware upgrade page from this module's router page. has anyone tried using it for openwrt upgrade?

I can't find firmware on manufacturers web pages, can you please share link to original firmware. I would like to revert back from openwrt to original firmware because of stability issues...