MikroTik rb450gx4 support

Its UBI which will reserve 20 PEB-s for bad block management as that is the kernel default setting.
My partition was 10MB so kernel would fit nicely.

I am using the same -c as for UBI, I can try reducing it to 50 or whatever was used for ROS kernel.

@johnth This thing is kind of driving me nuts now.
I used the exact args used for ROS UBIFS: -m 2048 -e 126976 -c 58 -x none

And still the same thing, not an ELF header.

Something weird also is that if I ubiformat the kernel partition then it won't find the kernel at all.

I have a bug that if rootfs UBI is not detached it will fail miserably trying to detach it as it tries to detach completely wrong volume, how this happens I have no idea as the script simply calls umount -a.

[   85.884761] ubi1: attaching mtd0
[   86.012440] ubi1: scanning is finished
[   86.032560] ubi1: attached mtd0 (name "ubikernel", size 10 MiB)
[   86.032633] ubi1: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes
[   86.037329] ubi1: min./max. I/O unit sizes: 2048/2048, sub-page size 2048
[   86.044295] ubi1: VID header offset: 2048 (aligned 2048), data offset: 4096
[   86.051141] ubi1: good PEBs: 80, bad PEBs: 0, corrupted PEBs: 0
[   86.057881] ubi1: user volume: 1, internal volumes: 1, max. volumes count: 128
[   86.063832] ubi1: max/mean erase counter: 14/10, WL threshold: 4096, image sequence number: 412354248
[   86.071108] ubi1: available PEBs: 21, total reserved PEBs: 59, PEBs reserved for bad PEB handling: 20
[   86.080429] ubi1: background thread "ubi_bgt1d" started, PID 3249
UBI device number 1, total 80 LEBs (10158080 bytes, 9.6 MiB), available 21 LEBs (2666496 bytes, 2.5 MiB), LEB size 126976 bytes (124.0 KiB)
removing ubiblock0_0
[   86.241319] block ubiblock0_0: released
Volume ID 0, size 35 LEBs (4444160 bytes, 4.2 MiB), LEB size 126976 bytes (124.0 KiB), dynamic, name "ubikernel", alignment 1
removing ubiblock0_0
ubiblock: error!: cannot remove block device
          error 19 (No such device)
cannot remove /dev/ubiblock0_0
sysupgrade successful

And figured out the stupidity I was doing, I copied the logic from the generic UBI prepare, that would remove all of the volumes.
But in reality I was doing it twice, in the kernel UBI prepare and rootfs one, hence the kernel volume would get removed.

Now its booting fine after flashing.

Is there any timeline to merge to official support?

1 Like

Hello,
Good day to everyone.
I got a really good deal on a RB450Gx4 and I was wondering, if can I take it for a ride?

Is there any chance that it will be officially supported?
hAP 2 is officially supported (21.0.2) and it has a very similar IPQ4018 chip. Same family, same frequency but only 128MB RAM instead of 1024MB and 16MB flash instead of 512MB.

I was looking for Load-balancing and decent throughput with OpenVPN.

I would really appreciate any feedback and suggestions.

Likely, but not soon.
There are now 4 ipq40xx add Mikrotik device PRs open.
The hapac3 PR includes the logic for ipq40xx Mikrotik NAND, so that one need to be merged before 450gx4 can be.

I have a branch here for 450gx4 based on @robimarko's hapac3 PR. There are two different devicesā€”one for 128k and another for 256k NAND blocksize devices. I have only tested 128k. sysupgrade should stop, and you get an error message if you try to sysupgrade to the wrong blocksize.

hAP ac3 has PR has been dragging on for a while now.
Hopefully it will get merged soon.

@johnth
What options are required to create netboot image for rb450gx4 ?

Currently I'm using:

CONFIG_TARGET_ipq40xx=y
CONFIG_TARGET_ipq40xx_mikrotik=y
CONFIG_TARGET_ipq40xx_mikrotik_DEVICE_mikrotik_rb450gx4-128k=y

In results I'm getting images:

 4,4M  openwrt-ipq40xx-mikrotik-mikrotik_rb450gx4-128k-initramfs-kernel.bin
 6,5M  openwrt-ipq40xx-mikrotik-mikrotik_rb450gx4-128k-squashfs-nand-sysupgrade.bin

Unfortunately I cannot boot (no reponse for ping 192.168.1.1) rb450gx4 using netboot. (I'll have access to console in a few days). I'm missing something in image configuration?

The netboot image from @robimarko boots fine however since I've different NAND (128K) I cannot sysupgrade from that image.

Hi @adam-kulagowski,

That config should be fine.
Last time I tested my device it worked as expected.
I will build and test again.

I had one major difference to Robi's device tree:
I did set the first ethernet port (has PoE in, netboot, beside console port) to WAN (DHCP) in OpenWrt, so you would need to swap the ethernet cable to another port (after netboot) to access 192.168.1.1. If that works, and you don't like it, you could change this with a uci-defaults script.

Otherwise, console output would be best.
Some time after the device fetches the netboot image, one of the device LEDs blinks to show it is waiting for OpenWrt failsafe trigger. When OpenWrt is running, both the green and blue LEDs will be on. If you can see this happening at least we know OpenWrt is booting.

Cheers

@johnth

Thanks!

I swear I was checking different ports... Anyway You were right - reconnecting cable to second port did the trick. Did an sysupgrade as well - went OKish (disconnected SSH session in the middle) but booted up properly.

Is DSA supported? If not - is it on roadmap :slight_smile: ?

Regards,
Adam

Terrific.

Yes, that is expected.

ipq40xx DSA is being built out and tested at the moment. There is still much to do. Follow along at https://github.com/openwrt/openwrt/pull/4721

Subscribed - thanks.

My idea is to add docker, then put (via SD) VyOS ARM image on RB450Gx4. This will give us nice router w/ excellent CLI.

MY build failed ,based on your branch .

  1. git clone -b 450gx4 --single-branch https://github.com/john-tho/openwrt.git

  2. ./scripts/feeds update -a
    
  3. ./scripts/feeds install -a
    

make menucofnig

# make with -j1 V=s
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/busybox/Makefile' has a build dependency on 'libpam', which does not exist
WARNING: Makefile 'package/boot/kexec-tools/Makefile' has a dependency on 'liblzma', which does not exist
WARNING: Makefile 'package/network/services/lldpd/Makefile' has a dependency on 'libnetsnmp', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a dependency on 'libpam', which does not exist
WARNING: Makefile 'package/utils/policycoreutils/Makefile' has a build dependency on 'libpam', which does not exist
make[2]: Entering directory '/root/2/openwrt/scripts/config'
cc -O2   -c -o conf.o conf.c
cc   conf.o confdata.o expr.o lexer.lex.o parser.tab.o preprocess.o symbol.o util.o   -o conf
make[2]: Leaving directory '/root/2/openwrt/scripts/config'
time: target/linux/prereq#0.14#0.06#0.18
make[1]: Entering directory '/root/2/openwrt'
make[1]: *** No rule to make target 'with'.  Stop.
make[1]: Leaving directory '/root/2/openwrt'
/root/2/openwrt/include/toplevel.mk:228: recipe for target 'with' failed
make: *** [with] Error 2

does this RB450GX4 support dropped at all?
or is there any update with this?

thank you in advance,
Regards
Zsolt

@bm42 hello...
My RB450Gx4 is broken.

loading kernel... kernel not found or data is corrupted

netinstall fail. Is it possible to use hardware programmer to refresh Winbond flash to fix the problem?

Thanks!

  • arktos

This is a message from RouterBOOT, so your bootloader should be fine, and flashing the NOR will not help anything.

Keep trying with netinstall. Make sure you read the manual so you can get the timing right and confirm with the LEDs. Can also try the backup bootloader.

Thanks Johnth.
I tried netinstall. But after netinstall pass, my RB450Gx4 still show me "kernel not found or data is corrupted"
screenshoot for netinstall is as below:
11q

Is there anything I lost?

Sorry... I also found my RB450Gx4 will start from backup ROM in normal boot. I don't press the reset button.

No need for sorry.

Okay, to confirm, boot works and all okay from primary booter, but fails with backup booter?

Console shows the difference like this (ignore my version numbers):

  • After QCOM booter, RouterBoot backup booter starts first, but jumps straight to primary booter unless:
    • reset button held before power applied
    • soft config force backup booter setting set
  • If one or both of these is true, backup booter loads: RouterBOOT backup booter 6.45.9
  • otherwise, code jumps to primary (upgradable in RouterOS) booter: RouterBOOT booter 7.1beta6

If you cannot boot with the primary booter, upgrade it from RouterOS.

If you cannot boot with the backup booter, live with it (you should not need to ever see it), or you can take the risk of overwriting just this backup booter from OpenWrt, or with a programmer. Should be at 0x80000 to 0x8e000 on NOR. Backup whole NOR first. Get it wrong and the board will not boot at all. You should only replace it with the same or later backup booter version (shown in a hard cfg tag), in case of hardware changes.

Hi Johnth:
After review previous Uart Log for RB450Gx4.
I think my device will boot from backup booter always.
Is there any setting I can change it boot from primary booter?

Here is uart log for my rb450gx4 when I short "reset jumper hole".

Format: Log Type - Time(microsec) - Message - Optional Info
Log Type: B - Since Boot(Power On Reset),  D - Delta,  S - Statistic
S - QC_IMAGE_VERSION_STRING=BOOT.BF.3.1.1-00096
S - IMAGE_VARIANT_STRING=DAABANAZA
S - OEM_IMAGE_VERSION_STRING=CRM
S - Boot Config, 0x00000021
S - Core 0 Frequency, 0 MHz
B -       261 - PBL, Start
B -      1338 - bootable_media_detect_entry, Start
B -      1678 - bootable_media_detect_success, Start
B -      1692 - elf_loader_entry, Start
B -      5068 - auth_hash_seg_entry, Start
B -      7209 - auth_hash_seg_exit, Start
B -    572125 - elf_segs_hash_verify_entry, Start
B -    686835 - PBL, End
B -    686859 - SBL1, Start
B -    775231 - pm_device_init, Start
D -         6 - pm_device_init, Delta
B -    776742 - boot_flash_init, Start
D -     45685 - boot_flash_init, Delta
B -    826616 - boot_config_data_table_init, Start
D -      3835 - boot_config_data_table_init, Delta - (419 Bytes)
B -    833825 - clock_init, Start
D -      7576 - clock_init, Delta
B -    845923 - CDT version:2,Platform ID:8,Major ID:1,Minor ID:0,Subtype:0
B -    849412 - sbl1_ddr_set_params, Start
B -    854400 - cpr_init, Start
D -         2 - cpr_init, Delta
B -    858892 - Pre_DDR_clock_init, Start
D -         4 - Pre_DDR_clock_init, Delta
D -     13147 - sbl1_ddr_set_params, Delta
B -    873966 - pm_driver_init, Start
D -         2 - pm_driver_init, Delta
B -    941961 - sbl1_wait_for_ddr_training, Start
D -        29 - sbl1_wait_for_ddr_training, Delta
B -    962831 - Image Load, Start
D -    140575 - QSEE Image Loaded, Delta - (262104 Bytes)
B -   1103905 - Image Load, Start
D -      1441 - SEC Image Loaded, Delta - (2048 Bytes)
B -   1114148 - Image Load, Start
D -     17191 - APPSBL Image Loaded, Delta - (30420 Bytes)
B -   1131755 - QSEE Execution, Start
D -        58 - QSEE Execution, Delta
B -   1137863 - SBL1, End
D -    453113 - SBL1, Delta
S - Flash Throughput, 1854 KB/s  (294991 Bytes,  159107 us)
S - DDR Frequency, 672 MHz


RouterBOOT backup booter 6.42

RB450Gx4

CPU frequency: 716 MHz
  Memory size: 1024 MiB
    NAND size: 512 MiB

Boot configuration reset, applying defaults
writing settings to flash... OK

Press any key within 2 seconds to enter setup..
trying bootp protocol............... failed
kernel loading failed

loading kernel... kernel not found or data is corrupted
trying bootp protocol.................................

I also try to upgrade the firmware by XMODEM.
not sure why it will tell me "invalid upgrade file id" ? Can I just upgrade the firmware by the npk file?

your choice: g - upgrade firmware

Upgrade firmware options:
   e - upgrade firmware over ethernet
   s - upgrade firmware over serial port
your choice: s - upgrade firmware over serial port


xmodem receiver ready, waiting for data...
press <Ctrl>+X several times to cancel transfer

press any key to continue...
press any key to continue...
press any key to continue...
file transfer ok
invalid upgrade file id

Upgrade firmware options:
   e - upgrade firmware over ethernet
   s - upgrade firmware over serial port
your choice: 

Thanks!

  • arktos

b - booter options
will let you check (and select) that the regular booter option is used for the soft config setting.

Select which booter you want to load:
 * 1 - load regular booter
   2 - force backup-booter loading

This is shown in the RouterBOOT manualā€¦
Otherwise, you can reset the soft config settings with reset button (see manual).

Do it work with the primary booter (if you do not touch reset)?

Here, you need an FWF file ipq4000-*fwf (the L- fwf are for no-nand devices) (extract from /etc, from squashfs, from NPK: binwalk -Me routeros-*arm*npk). But, again, this will only upgrade the regular / primary booter.