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.

Hi all! I want to use in your project OpenWrt on HLK-RM04, but I have the following problems arise. I can not set up a wireless network, if I turn it and then reboot the system at the next startup everything hangs, and then the message "out of memory"
Log:

[    0.290000] io scheduler deadline registered (default)
[    0.310000] gpio-export gpio_export.5: 2 gpio(s) exported
[    0.330000] Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
[    0.330000] 10000c00.uartlite: ttyS0 at MMIO 0x10000c00 (irq = 20) is a 16550A
[    0.360000] console [ttyS0] enabled, bootconsole disabled
[    0.360000] console [ttyS0] enabled, bootconsole disabled
[    0.380000] 10000500.uart: ttyS1 at MMIO 0x10000500 (irq = 13) is a 16550A
[    0.400000] m25p80 spi32766.0: found w25q32, expected s25fl064k
[    0.420000] m25p80 spi32766.0: w25q32 (4096 Kbytes)
[    0.420000] 4 ofpart partitions found on MTD device spi32766.0
[    0.440000] Creating 4 MTD partitions on "spi32766.0":
[    0.440000] 0x000000000000-0x000000030000 : "u-boot"
[    0.460000] 0x000000030000-0x000000040000 : "u-boot-env"
[    0.470000] 0x000000040000-0x000000050000 : "factory"
[    0.490000] 0x000000050000-0x000000400000 : "firmware"
[    0.500000] 0x00000013af7a-0x000000400000 : "rootfs"
[    0.510000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
[    0.540000] mtd: partition "rootfs" set to be root filesystem
[    0.550000] mtd: partition "rootfs_data" created automatically, ofs=0x3a0000, len=0x60000
[    0.570000] 0x0000003a0000-0x000000400000 : "rootfs_data"
[    0.590000] eth0: done loading
[    0.600000] rt3xxx-usbphy ubsphy.2: loaded
[    0.610000] rt2880_wdt 10000120.watchdog: Initialized
[    0.620000] TCP: cubic registered
[    0.630000] NET: Registered protocol family 17
[    0.640000] 8021q: 802.1Q VLAN Support v1.8
[    0.670000] VFS: Mounted root (squashfs filesystem) readonly on device 31:4.
[    0.690000] Freeing unused kernel memory: 184K (80292000 - 802c0000)
procd: Console is alive
procd: - watchdog -
[    7.000000] usbcore: registered new interface driver usbfs
[    7.000000] usbcore: registered new interface driver hub
[    7.020000] usbcore: registered new device driver usb
[    7.040000] Button Hotplug driver version 0.4.1
[    7.050000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    7.070000] ehci-platform: EHCI generic platform driver
[    7.410000] rt3xxx-usbphy ubsphy.2: remote usb device wakeup disabled
[    7.410000] rt3xxx-usbphy ubsphy.2: UTMI 16bit 30MHz
[    7.410000] ehci-platform 101c0000.ehci: EHCI Host Controller
[    7.410000] ehci-platform 101c0000.ehci: new USB bus registered, assigned bus number 1
[    7.410000] ehci-platform 101c0000.ehci: irq 26, io mem 0x101c0000
[    7.730000] ehci-platform 101c0000.ehci: USB 2.0 started, EHCI 1.00
[    7.750000] hub 1-0:1.0: USB hub found
[    7.750000] hub 1-0:1.0: 1 port detected
[    7.770000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    7.770000] ohci-platform 101c1000.ohci: Generic Platform OHCI Controller
[    7.790000] ohci-platform 101c1000.ohci: new USB bus registered, assigned bus number 2
[    7.810000] ohci-platform 101c1000.ohci: irq 26, io mem 0x101c1000
[    7.890000] hub 2-0:1.0: USB hub found
[    7.890000] hub 2-0:1.0: 1 port detected
[    7.910000] input: gpio-keys-polled.3 as /devices/gpio-keys-polled.3/input/input0
kmod: ran 20 iterations
procd: - preinit -
[    8.720000] rt305x-esw 10110000.esw: link changed 0x00
Press the [f] key and hit [enter] to enter failsafe mode
mount_root: jffs2 is ready
[   12.640000] jffs2: notice: (291) jffs2_build_xattr_subsystem: complete building xattr subsystem, 1 of xdatum (0 unchecked, 0 orphan) and 8 of xref (0 dead, 0 orphan) found.
procd: - early -
procd: - watchdog -
procd: - init -
/sbin/hotplug-call: /etc/hotplug.d/usb/20-usb_mode: line 1: service_triggers: not found
Please press Enter to activate this console.
glob failed on /etc/init.d/usbmode
glob failed on /etc/init.d/usbmode
[   17.570000] NET: Registered protocol family 10
[   17.600000] nf_conntrack version 0.5.0 (208 buckets, 832 max)
[   17.630000] ip6_tables: (C) 2000-2006 Netfilter Core Team
[   17.680000] usbcore: registered new interface driver cdc_acm
[   17.700000] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[   17.700000] Loading modules backported from Linux version master-2013-06-27-0-gdcfa6d5
[   17.730000] Backport generated by backports.git backports-20130617-4-ge3220f5
[   17.750000] ip_tables: (C) 2000-2006 Netfilter Core Team
[   17.810000] usbcore: registered new interface driver usbserial
[   17.830000] usbcore: registered new interface driver usbserial_generic
[   17.850000] usbserial: USB Serial support registered for generic
[   17.890000] xt_time: kernel timezone is -0000
[   17.900000] usbcore: registered new interface driver asix
[   17.900000] usbcore: registered new interface driver cdc_ether
[   18.310000] cfg80211: Calling CRDA to update world regulatory domain
[   18.340000] cfg80211: World regulatory domain updated:
[   18.350000] cfg80211:   (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
[   18.370000] cfg80211:   (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   18.390000] cfg80211:   (2457000 KHz - 2482000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   18.390000] cfg80211:   (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
[   18.420000] cfg80211:   (5170000 KHz - 5250000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   18.420000] cfg80211:   (5735000 KHz - 5835000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
[   19.940000] usbcore: registered new interface driver ch341
[   19.960000] usbserial: USB Serial support registered for ch341-uart
[   20.520000] usbcore: registered new interface driver ftdi_sio
[   20.520000] usbserial: USB Serial support registered for FTDI USB Serial Device
[   24.310000] usbcore: registered new interface driver mos7720
[   24.310000] usbserial: USB Serial support registered for Moschip 2 port adapter
[   25.050000] usbcore: registered new interface driver pl2303
[   25.050000] usbserial: USB Serial support registered for pl2303
[   25.070000] PPP generic driver version 2.4.2
[   25.090000] NET: Registered protocol family 24
[   25.760000] usbcore: registered new interface driver rndis_host
[   25.760000] usbcore: registered new interface driver option
[   25.760000] usbserial: USB Serial support registered for GSM modem (1-port)
[   26.160000] rt2800_wmac 10180000.wmac: failed to load eeprom property
[   26.180000] ieee80211 phy0: rt2x00lib_request_eeprom_file: Info - Loading EEPROM data from 'soc_wmac.eeprom'.
[   26.200000] ieee80211 phy0: rt2x00_set_rt: Info - RT chipset 5350, rev 0500 detected
[   26.220000] ieee80211 phy0: rt2x00_set_rf: Info - RF chipset 5350 detected
[   40.730000] device eth0.1 entered promiscuous mode
[   40.750000] device eth0 entered promiscuous mode
[   40.770000] br-lan: port 1(eth0.1) entered forwarding state
[   40.770000] br-lan: port 1(eth0.1) entered forwarding state
[   40.970000] IPv6: ADDRCONF(NETDEV_CHANGE): eth0.1: link becomes ready
[   42.770000] br-lan: port 1(eth0.1) entered forwarding state

[  146.350000] askfirst invoked oom-killer: gfp_mask=0x200da, order=0, oom_score_adj=0
[  146.350000] CPU: 0 PID: 339 Comm: askfirst Not tainted 3.10.12 #10
[  146.350000] Stack : 00000006 00000000 00000000 00000000 00000000 00000000 802e2b16 00000036
          80873818 80238544 802c2a8c 802811fb 00000153 000200da 00000000 00000000
          802812d0 8001ba10 80280000 80019428 00000000 00000000 80239dec 80519a7c
          80519a00 00000000 00000000 00000000 00000000 00000000 00000000 00000000
          00000000 00000000 00000000 00000000 00000000 00000000 00000000 80519a08
          ...
[  146.730000] Call Trace:
[  146.730000] [<80010670>] show_stack+0x48/0x70
[  146.750000] [<80059e6c>] dump_header.isra.16+0x4c/0x138
[  146.750000] [<8005a1b8>] oom_kill_process+0xd4/0x3b0
[  146.770000] [<8005a8f8>] out_of_memory+0x290/0x2ec
[  146.770000] [<8005d970>] __alloc_pages_nodemask+0x558/0x63c
[  146.790000] [<80072c4c>] handle_pte_fault+0x1d4/0x918
[  146.790000] [<80073440>] handle_mm_fault+0xb0/0xdc
[  146.810000] [<80013da0>] do_page_fault+0x148/0x38c
[  146.810000] [<80004820>] ret_from_exception+0x0/0xc
[  146.830000] [<80135640>] n_tty_read+0x4d0/0x6ec
[  146.830000] [<80130604>] tty_read+0x9c/0x100
[  146.850000] [<80087380>] vfs_read+0xb4/0x14c
[  146.850000] [<80087588>] SyS_read+0x60/0xa4
[  146.850000] [<80006544>] stack_done+0x20/0x40
[  146.870000]
[  146.870000] Mem-Info:
[  146.880000] Normal per-cpu:
[  146.880000] CPU    0: hi:    0, btch:   1 usd:   0
[  146.890000] active_anon:742 inactive_anon:7 isolated_anon:0
[  146.890000]  active_file:3 inactive_file:39 isolated_file:0
[  146.890000]  unevictable:0 dirty:0 writeback:0 unstable:0
[  146.890000]  free:114 slab_reclaimable:240 slab_unreclaimable:843
[  146.890000]  mapped:1 shmem:13 pagetables:110 bounce:0
[  146.890000]  free_cma:0
[  146.950000] Normal free:456kB min:456kB low:568kB high:684kB active_anon:2968kB inactive_anon:28kB active_file:12kB inactive_file:156kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:16384kB managed:13180kB mlocked:0kB dirty:0kB writeback:0kB mapped:4kB shmem:52kB slab_reclaimable:960kB slab_unreclaimable:3372kB kernel_stack:408kB pagetables:440kB unstable:0kB bounce:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:84 all_unreclaimable? yes
[  147.030000] lowmem_reserve[]: 0 0
[  147.040000] Normal: 0*4kB 3*8kB (U) 1*16kB (U) 1*32kB (U) 0*64kB 1*128kB (U) 1*256kB (U) 0*512kB 0*1024kB 0*2048kB 0*4096kB = 456kB
[  147.060000] 65 total pagecache pages
[  147.070000] 0 pages in swap cache
[  147.080000] Swap cache stats: add 0, delete 0, find 0/0
[  147.080000] Free swap  = 0kB
[  147.100000] Total swap = 0kB
[  147.100000] 4096 pages RAM
[  147.100000] 756 pages reserved
[  147.100000] 264181 pages shared
[  147.120000] 2956 pages non-shared
[  147.120000] [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[  147.140000] [  336]     0   336      219       15       4        0             0 ubusd
[  147.160000] [  339]     0   339      191       13       3        0             0 askfirst
[  147.170000] [  544]     0   544      372       49       4        0             0 netifd
[  147.190000] [  545]     0   545      397       44       3        0             0 network
[  147.210000] [  582]     0   582      288       18       4        0             0 dropbear
[  147.210000] [  598]     0   598      371       15       3        0             0 telnetd
[  147.240000] [  610]     0   610      285       18       5        0             0 uhttpd
[  147.250000] [  659] 65534   659      240       22       4        0             0 dnsmasq
[  147.270000] [  691]     0   691      211       20       4        0             0 ser2net
[  147.290000] [  703]     0   703      384       30       3        0             0 hotplug-call
[  147.300000] [  732]     0   732      384       30       3        0             0 hotplug-call
[  147.320000] [  734]     0   734      373       19       3        0             0 udhcpc
[  147.340000] [  741]     0   741      415       62       5        0             0 wifi
[  147.350000] [  745]     0   745      444       45       4        0             0 fw3
[  147.370000] [  746]     0   746      395       42       5        0             0 dhcp.script
[  147.390000] [  760]     0   760      415       63       5        0             0 wifi
[  147.390000] [  761]     0   761      415       64       5        0             0 wifi
[  147.420000] [  766]     0   766      384       29       4        0             0 hotplug-call
[  147.430000] [  768]     0   768      204       20       4        0             0 6relayd
[  147.450000] [  770]     0   770      387       32       4        0             0 S95done
[  147.470000] [  773]     0   773      372       17       4        0             0 6relayd-update
[  147.470000] [  777]     0   777      371       15       4        0             0 killall
[  147.500000] [  779]     0   779      371       16       3        0             0 sh
[  147.520000] [  780]     0   780      384       29       4        0             0 hotplug-call
[  147.520000] [  781]     0   781      277       15       3        0             0 ubus
[  147.550000] [  782]     0   782      370       13       4        0             0 sed
[  147.560000] [  783]     0   783      370       13       3        0             0 sysctl
[  147.580000] [  784]     0   784      370       13       3        0             0 logger
[  147.600000] Out of memory: Kill process 659 (dnsmasq) score 7 or sacrifice child
[  147.600000] Killed process 659 (dnsmasq) total-vm:960kB, anon-rss:88kB, file-rss:0kB

>the message "out of memory"

What release?  It has been reported that low-memory devices work best with AA (if at all, depending on what you're doing), not with BB or trunk.

Hello,
I followed "Jeff Kent" installation for OpenWRT on my module (https://github.com/JiapengLi/OpenWrt-Hi … /README.md). After the flashing, the module seem to be quite dead - only the power LED ligths, WAN port LED are also ligth. When I connect ethernet to LAN, its LED starts flashing like the connection was established, however my PC can't connect - both dynamic, and static IP (192.168.16.100).  When I connect the cable to WAN port the LEDs start synchronously blinking - but slowly 3 timers per second, perhaps - like it was some kind of error message. Also the green LED on module lights up. There are some data on serial port, however I can't read them, since I am not able to determine the baudrate - according LA it seems like boudrate 1M, however I am not able to decode the data.

What did I wrong? How can I unbrick the module?

Hi Guys,

same thing,

I'm trying to install openWRT without success, I've bricked 3 modules already.

I've followed those instructions too

http://wiki.openwrt.org/toh/hilink/hlk-rm04

I'm using the dev board Kit-V2.3 of the HLK-RM04. any help would be greatfull. My main aim is to get it to work as Wi-Fi client with a device connected to the HLK-RM04 ethernet port, ATM it seem that the client Wi-Fi workes only for RS232 connection

as well, a question, I've used the bootloader uboot128.img but there is as well uboot256.img.... is this an updated one or is it for diferent memory setup?

Hello everybody,

If you are interested in freeing GPIO like I was and you can't find out how, like me, perhaps this helps. I managed to free six GPIOs.

First I freed GPIO0 (pin10) and GPIO14 (pin 25) by removing:

>     gpio-keys-polled {
>         compatible = "gpio-keys-polled";
>         #address-cells = <1>;
>         #size-cells = <0>;
>         poll-interval = <20>;
>         wps {
>             label = "reset";
>             gpios = <&gpio0 14 1>;
>             linux,code = <0x198>;
>         };
>     };
>
>     gpio-leds {
>         compatible = "gpio-leds";
>         power {
>             label = "hlk-rm04:red:power";
>             gpios = <&gpio0 0 1>;
>         };
>     };


from target/linux/ramips/dts/HLKRM04.dts. Then I freed GPIO7 (pin19), GPIO8 (pin26), GPIO9 (pin24) and GPIO10 (pin22) by modifying target/linux/ramips/dts/rt5350.dtsi. I changed:

ralink,function = "uartf"
into
ralink,function = "gpio"

Still unresolved how to turn both i2c pins into GPIO. The trivial modification of rt5350.dtsi doesn't work.

@wpagnon:
I replaced uboot first as described by https://github.com/JiapengLi/OpenWrt-HiLink-HLK-RM04 under "This method is out of date".

To build the new firmware:
svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker
make menuconfig
Target System: Ralink RT288x/RT3xxx Subtarget: RT3x5x based boards Target Profile: HILINK HLK-RM04

Add functions to busybox like httpd, remove firewall and things you don't need.

make kernel_menuconfig
add 16M to kernel command line as described by JiapengLi.

Now make and hope for the best.
The result is in bin/ramips/ and is called openwrt-ramips-rt305x-hlk-rm04-squashfs-sysupgrade.bin

If you use Ubuntu, copy this file to /var/lib/tftpboot and start tfpd:
sudo /usr/sbin/in.tftpd -u tftp --address 0.0.0.0:69 -s -l /var/lib/tftpboot

Now connect PC (fixed IP=192.168.16.100) to LAN interface of development board, connect serial port of PC to development board (57600,8,n,1), start GtkTerm if you use Ubuntu:

sudo gtkterm -p /dev/ttyUSB0 -s 57600 &

Power up development board, e.g. from USB port of PC. This is all you need to flash: http://uip.nl.eu.org/HLKRM04/

Press 2.
Press Y.
Input device IP (10.10.10.123) ==:192.168.16.1
Input server IP (10.10.10.3) ==:192.168.16.100
Input Linux Kernel filename (tim_uImage) ==:openwrt-ramips-rt305x-hlk-rm04-squashfs-sysupgrade.bin

And there you go. Good luck!

suso wrote:

Then I freed GPIO7 (pin19), GPIO8 (pin26), GPIO9 (pin24) and GPIO10 (pin22) by modifying target/linux/ramips/dts/rt5350.dtsi. I changed:

ralink,function = "uartf"
into
ralink,function = "gpio"

Still unresolved how to turn both i2c pins into GPIO. The trivial modification of rt5350.dtsi doesn't work.

It's not a good idea to modify rt5350.dtsi, since not only HLK-RM04 depends on it.

The following changes to HLKRM04.dts enable most GPIO pins

        palmbus@10000000 {
                uart@500 {
                        status = "disabled";
                };
                        
                gpio1: gpio@660 {
                        status = "okay";
                };

                        
.......................


        pinctrl {
                state_default: pinctrl0 {
                        gpio {
                                ralink,group = "i2c", "jtag", "uartf", "led";
                                ralink,function = "gpio";
                        };
                };
        };

And the result in /sys/class/gpio:

root@OpenWrt:/sys/class/gpio# ls -v
export      gpio7       gpio11      gpio17      gpio21      gpio25      unexport
gpio0       gpio8       gpio12      gpio18      gpio22      gpio26
gpio1       gpio9       gpio13      gpio19      gpio23      gpiochip0
gpio2       gpio10      gpio14      gpio20      gpio24      gpiochip22
root@OpenWrt:/sys/class/gpio# 

Thank you smarpl, you nailed it. I left the uart enabled:

        palmbus@10000000 {
                uart@500 {
                        status = "okay";
                };

to configure the network at first boot through the development board console.

Even though, I now have 10 GPIOs:

GPIO0 (pin10)
GPIO1 (pin8)
GPIO2 (pin9)
GPIO7 (pin19)
GPIO8 (pin26)
GPIO9 (pin24)
GPIO10 (pin22)
GPIO14 (pin 25)
GPIO25 (pin 5)
GPIO26 (pin 23)

More than enough. Thanks again smile.

suso wrote:

I left the uart enabled:

        palmbus@10000000 {
                uart@500 {
                        status = "okay";
                };

to configure the network at first boot through the development board console.

There are two UART interfaces on HLK-RM04 board. When uart@500 is disabled, the second one - uart lite (Pin20 - RX, Pin21 - TX) still can be used for console.
One more change to HLKRM04.dts required (forgot to paste in my previous message)

        chosen {
                bootargs = "console=ttyS0,57600";
        };

But if you prefer to use uart@500 for console, you can disable uartlite and get 2 more gpios - (GPIO16) Pin20 and GPIO15(Pin21).

        chosen {
                bootargs = "console=ttyS0,57600";
        };

         palmbus@10000000 {
                uartlite@c00 {
                        status = "disabled";
                };
suso wrote:

Thank you smarpl, you nailed it. I left the uart enabled:

        palmbus@10000000 {
                uart@500 {
                        status = "okay";
                };

to configure the network at first boot through the development board console.

Even though, I now have 10 GPIOs:

GPIO0 (pin10)
GPIO1 (pin8)
GPIO2 (pin9)
GPIO7 (pin19)
GPIO8 (pin26)
GPIO9 (pin24)
GPIO10 (pin22)
GPIO14 (pin 25)
GPIO25 (pin 5)
GPIO26 (pin 23)

More than enough. Thanks again smile.

Can you upload your image file?

Hi folks,

If you are having trouble with the unit rebooting after bringing WiFi up, try using a higher current {and regulated) power supply.

I was having lots of spontaneous reboots when powering the unit from a USB->TTL adapter, but it was stable when using a plug pack.

Anyone using this module? I have been using it as a WIFI dumb AP for about 10 months now and it's been great (With upgraded ram/flash) But now I've moved and Im coming into config problems.

Basically I want to use it as a dumb AP, so no firewall or dhcp, and I want its WAN port to connect to my network, then have the LAN port available and the wifi. I have it working now but I am not able  to SSH back into it from my network UNLESS I am on the WIFI of that machine, which is tough because I have two wifi routers to make sure I have good signal throughout my house.

In the stock /etc/config/network
there are a few lines for "switch". Is there a switch of this router? How can I set up my interfaces so I still will have access to Luci/ssh from within my network?

Thanks for any help.

forsakenrider wrote:

Anyone using this module? I have been using it as a WIFI dumb AP for about 10 months now and it's been great (With upgraded ram/flash) But now I've moved and Im coming into config problems.

Basically I want to use it as a dumb AP, so no firewall or dhcp, and I want its WAN port to connect to my network, then have the LAN port available and the wifi. I have it working now but I am not able  to SSH back into it from my network UNLESS I am on the WIFI of that machine, which is tough because I have two wifi routers to make sure I have good signal throughout my house.

In the stock /etc/config/network
there are a few lines for "switch". Is there a switch of this router? How can I set up my interfaces so I still will have access to Luci/ssh from within my network?

Thanks for any help.

My second usage option is the same way as you want to do smile First is as a classical router - but I need port forwarding plus some extra goodies which usually come with openwrt and others. It's pity that stock FW is that bad and almost no possibility for future upgrade sad

I know this does not help you but it helps this topic to be more alive.

I was reading here and there that going from stock to OpenWrt is not so straightforward ... or is it? I bought only one module for my DIY project and don't want to waste it on experimenting.

Hi folks,

Just a heads up, trunk seems to break WiFi for this module. The tip of Barrier Breaker does work though.

Hi,

I have been struggling with this for a while (I'm no Linux guru - lol) and after gathering information from many threads was able to successfully compile OpenWrt trunk 44152 for HLK-RM04. The HLK-RM04 was upgraded to 32M using ELPIDA DS2516APTA-75 SDRAM but the module is still only 4M Flash.

- This was all done in VirtualBox 4.3.20

Install Ubuntu Desktop 14.10 (32bit)

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install subversion git-core build-essential libssl-dev libncurses5-dev gawk texinfo

sudo apt-get autoremove

mkdir openwrt

cd openwrt

svn co svn://svn.openwrt.org/openwrt/trunk

cd trunk

./scripts/feeds update -a

./scripts/feeds install -a

mkdir dl

Download this file http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz and save it to openwrt > trunk > dl

rm -rf tmp

make kernel_menuconfig

> Kernel hacking
      > rootfstype=squashfs,jffs2 Default kernel command string
change to rootfstype=squashfs,jffs2 mem=32M
Save and Exit

make menuconfig

> Target System: Ralink RT288x/RT3xxx
> Subtarget: RT3x5x/RT5350 based boards
> Target Profile: HILINK HLK-RM04


> LuCI
       > Collections: luci (press <Space> until you get a *)
       > Protocols: luci-proto-3g (press <Space> until you get a *)
Save and Exit

Open folder Openwrt > trunk > target > linux > ramips > dts
Open file HLKRM04.dts in gedit
Change the line near the top from - reg = <0x0 0x1000000>; to reg = <0x0 0x2000000>; **this to configure 32M SDRAM
Save and Exit

make

The firmware file openwrt-ramips-rt305x-hlk-rm04-squashfs-sysupgrade.bin is in openwrt > trunk > bin > ramips

I used the "Installation (This method is out of date)" from JiapengLi/OpenWrt-HiLink-HLK-RM04 page to upload the uboot256.img and openwrt-ramips-rt305x-hlk-rm04-squashfs-sysupgrade.bin firmware.

So I hope this is able to help someone else...

Next task is to minimize the number of packages.

(Last edited by Brutus_NZ on 10 Feb 2015, 01:21)

One question before starting flashing smile

What is the main shortage running openwrt with 16Mb memory? Is it usable for a simple router with or without wireless AP. Last thing what I want to do is some soldering.

This is just my short experience as I'm no expert on this.
My first compile was with Luci but my mistake was not changing kernel and .dts to 32M.
With Luci and just 16M it ran very slowly and crashed frequently, basically unusable.

My suggestion -
Don't compile with Luci if only 16M
If you want Luci, upgrade the SDRAM to 32M or buy one of the newer HLK-RM04E with 32M SDRAM and 8M Flash

(Last edited by Brutus_NZ on 10 Feb 2015, 01:22)

OK, thanks! I didn't know that 32M version exists until now. I'll try with 16M and if I brick it than I go for 32M module smile

Anyway I can survive without Luci. Idea is to setup things and leave it alone.

ok sounds like you're on the right track.

You can follow my example but instead -

1/ Change rootfstype=squashfs,jffs2 mem=32M to rootfstype=squashfs,jffs2 mem=16M

2 /Don't add Luci in the make menuconfig

3/ Don't change the HLKRM04.dts file

4/ Use uboot128.img instead of uboot256.img

That should work fine with a 16M SDRAM, 4M Flash HLK-RM04

(Last edited by Brutus_NZ on 10 Feb 2015, 01:22)

smarpl wrote:

It's not a good idea to modify rt5350.dtsi, since not only HLK-RM04 depends on it.

The following changes to HLKRM04.dts enable most GPIO pins

        palmbus@10000000 {
                uart@500 {
                        status = "disabled";
                };
                        
                gpio1: gpio@660 {
                        status = "okay";
                };

                        
.......................


        pinctrl {
                state_default: pinctrl0 {
                        gpio {
                                ralink,group = "i2c", "jtag", "uartf", "led";
                                ralink,function = "gpio";
                        };
                };
        };

And the result in /sys/class/gpio:

root@OpenWrt:/sys/class/gpio# ls -v
export      gpio7       gpio11      gpio17      gpio21      gpio25      unexport
gpio0       gpio8       gpio12      gpio18      gpio22      gpio26
gpio1       gpio9       gpio13      gpio19      gpio23      gpiochip0
gpio2       gpio10      gpio14      gpio20      gpio24      gpiochip22
root@OpenWrt:/sys/class/gpio# 

Needing a bit of help with this.
I followed the above but I just get the 2 gpio's -

root@OpenWrt:/sys/class/gpio# ls -v
export      gpiochip0   gpiochip22  unexport

My HLKRM04.dts is

/dts-v1/;

/include/ "rt5350.dtsi"

/ {
    compatible = "HLKRM04", "ralink,rt5350-soc";
    model = "HILINK HLK-RM04";

    memory@0 {
        device_type = "memory";
        reg = <0x0 0x2000000>;
    };

    chosen {
        bootargs = "console=ttyS0,57600";
    };

    palmbus@10000000 {
        uart@500 {
            status = "disabled";
        };

    gpio1: gpio@660 {
                        status = "okay";
        };

        spi@b00 {
            status = "okay";
            m25p80@0 {
                #address-cells = <1>;
                #size-cells = <1>;
                compatible = "gd25q64";
                reg = <0 0>;
                linux,modalias = "m25p80", "s25fl064k";
                spi-max-frequency = <10000000>;

                partition@0 {
                    label = "u-boot";
                    reg = <0x0 0x30000>;
                    read-only;
                };

                partition@30000 {
                    label = "u-boot-env";
                    reg = <0x30000 0x10000>;
                    read-only;
                };

                factory: partition@40000 {
                    label = "factory";
                    reg = <0x40000 0x10000>;
                    read-only;
                };

                partition@50000 {
                    label = "firmware";
                    reg = <0x50000 0x3b0000>;
                };
            };
        };
    };

    pinctrl {
        state_default: pinctrl0 {
            gpio {
                ralink,group = "i2c", "jtag", "uartf", "led";
                ralink,function = "gpio";
            };
        };
    };

    ethernet@10100000 {
        mtd-mac-address = <&factory 0x4>;
    };

    wmac@10180000 {
        ralink,mtd-eeprom = <&factory 0>;
    };

    ehci@101c0000 {
        status = "okay";
    };

    ohci@101c1000 {
        status = "okay";
    };

    gpio-keys-polled {
        compatible = "gpio-keys-polled";
        #address-cells = <1>;
        #size-cells = <0>;
        poll-interval = <20>;
        wps {
            label = "reset";
            gpios = <&gpio0 14 1>;
            linux,code = <0x198>;
        };
    };

    gpio-leds {
        compatible = "gpio-leds";
        power {
            label = "hlk-rm04:red:power";
            gpios = <&gpio0 0 1>;
        };
    };
};

Hello everybody!

My news:

Successfully changed the RAM chip, from 16MB to 32MB.
(Samsung K4S561632D-TC1L memory DIMM computer)
PunBB bbcode test


Now I have 4MB flash and 32MB RAM smile

The Luci worked fine now !!!

--------------------------------------------------

I tried setting the wifi to client with encryption and static IP, but do not work yet sad

--------------------------------------------------

I tried using the OpenWRT-HLK-rm04-4m-32m-luci-usb-mjpg.bin firmware but I found a bug, and I sent a question:
https://github.com/JiapengLi/OpenWrt-RT5350/issues/3
PunBB bbcode test

--------------------------------------------------

I've had success with firmware version to 32 MB:
https://code.google.com/p/rcc/source/br … r%2Fimg_32

There are great and different functions:

audio_streamer.bin
default.bin
dlna_server.bin
internet_radio.bin [need USB Audio Device]
internet_radio_wifi.bin [need USB Audio Device]
mini.bin
mini_luci_web.bin
mini_luci_web_wifi.bin
mqtt_server.bin
serial_server.bin [many drivers: CH341, PL2303 & others]
uboot256.img
video_streamer.bin

But I need one with ser2net + wifi + LuCI with 32MB
to send any bytes for TCP server and communicate with the microcontroller via serial port.
[And if possible, in the future, I want to implement an automated program that controls some GPIO]

--------------------------------------------------

I would like to 'cook' my firmware version (or perhaps find an already compiled), but I do not know much about OpenWrt.

I wrote apps for Android, Visual Studio, Python, Arduino and PIC (microcontroller), but for OpenWrt I have not learned!

I use kubuntu, I noticed that I will need to compile the Linux firmware.

Where can I find a tutorial on how to build a firmware to HLK-RM04 ???
(step-by-step, please!)

--------------------------------------------------

@hot-dog thanks for you answer! (post # 169)

Then I saw you found changing RAM size from 16MB to 32MB in firmware, you (or others) may explain in detail how to do this?

What do I need to edit the file HLKRM04.dts?

I found many tips, but do not help me to 'cook'.

Thanks for all the guys that help us!

rtek1000 wrote:

<<Snip>>

Where can I find a tutorial on how to build a firmware to HLK-RM04 ???
(step-by-step, please!)

<<Snip>>

A step-by-step method is shown 7 Posts above ^

I'm not sure what more you could need!

(Last edited by Brutus_NZ on 4 Feb 2015, 07:43)

@Brutus_NZ

That's great !!!

Sorry not to see this!

Thank U!

I was thinking that you may want to install the stable release of OpenWrt which is Barrier_Breaker.
My method above installs Chaos_Calmer which is the dev version and is missing quite a few packages.

To install Barrier_Breaker 14.07

Change the following steps -

From
svn co svn://svn.openwrt.org/openwrt/trunk
to
svn co svn://svn.openwrt.org/openwrt/branches/barrier_breaker

and

From
cd trunk
to
cd barrier_breaker

The firmware file openwrt-ramips-rt305x-hlk-rm04-squashfs-sysupgrade.bin will be in openwrt > barrier_breaker > bin > ramips

the rest should be the same.

Has someone got a second device running on the hardware SPI?