Quotebodhi hmartin is right, tt seems this u-boot does not bring up the USB drive, does not have power! How many USB ports this box has? did you try other USB port? It has two USB 3 ports on the backside: https://www.allround-pc.com/wp-content/uploads/2016/04/WD-MyCloud-Mirror-R%C3%BCckseite.jpg I doubt the other port will make any difference. Let me take a look at the u-boot patch you posby hmartin - Debian
Quotebodhi On this WD Mirror Gen 2, you need to boot the same way as the WD My Cloud EX4100. That isn't the problem here. u-boot is not picking up the USB stick: (Re)start USB... USB0: Port (usbActive) : 0 Interface (usbType = 3) : USB XHCI 1.00 scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found scanninby hmartin - Debian
@bodhi: could you please explain your changes to u-boot sources so it does not overwrite bootcmd? If you could provide a diff of the modifications it would be very helpful. I am working on u-boot for MCM Gen 2 over here. I already built u-boot for MCM Gen 2 from WD GPL, and mcmg2 tested it with kwboot, so we know it's valid for the hardware. The u-boot build includes the correct u-bootby hmartin - Debian
Quotemcmg2 finally... Yeah, welcome to the club! kwboot isn't predictable sadly. Okay, so this proves at least that the WD u-boot sources are correct and you can kwboot the My Cloud Mirror Gen 2 (so you have an unbrick option if you manage to corrupt u-boot on nand). Both good news. I'm not entirely up on why the MCM Gen 2 can't boot Debian. Is it because u-boot is missingby hmartin - Debian
As a follow up from this post could a My Cloud Mirror Gen2 user please try to kwboot the attached u-boot? You will need to decompress it first using gzip: $ gunzip u-boot-a38x-GrandTeton_2014T3_PQ-nand-uart.bin.gz You will also need to use a patched kwboot binary (amd64 / arm): ./kwboot -f -t -B 115200 /dev/ttyUSB0 -b u-boot-a38x-GrandTeton_2014T3_PQ-nand-uart.bin -s 0 -q 1 The timinby hmartin - Debian
Quotemcmg2 so if it is possible to boot with modified uboot, it is possible to boot with debian? It should be possible to build u-boot from the Western Digital sources and kwboot it (for testing). Once we've confirmed that it can boot successfully and you can modify the u-boot environment, it should be safe to flash to nand. Booting Debian should be possible with the correct kernel/dtb. Aby hmartin - Debian
@bodhi: Did you have any luck trying to kwboot NAS326 using the modified kwboot? Wondering if/when there is any progress on newer u-boot for mvebu.by hmartin - uBoot
Quotesaschadd Do you mean that i should never turn of power in u-boot? That would mean booting all the time into stock firmware when trying to kwboot. Or is there a way to interrupt u-boot and do a shutdown from there? The u-boot command 'reset' can be used to restart the unit. Quotesaschadd As i do plug power off while trying kwboot i did that all the time and not used the pby hmartin - Debian
Quotehmartin Stock WD u-boot cannot see these variables, and cannot write to them, but if you flash the nand version of this u-boot to mtd0, you should be fine. (I have not tested this yet) Tested and working on EX2100. Do not follow these instructions for EX4100! You must boot with the new DTB (attached) which unlocks mtd0 for writing: # mtd_debug info /dev/mtd0 mtd.type = MTD_NANDFLAby hmartin - Debian
Quotebodhi It is a bug (or perhaps a feature) in this stock u-boot version. They disabled the saveenv command because it would overwrite the kernel image (i.e. bug), or they just don't want users to to be abe to update it (i e. feature), and therefore there is no need to define it correctly. It is OK to have envs in code only, if you want to do so. Unbelievably lame. If you want to stoby hmartin - Debian
Quotebodhi I think I know the reason. Very possible that the envs were never flashed to NAND! That's why we found nothing. Interesting. It's possible, but that would limit WD pretty severely in being able to update the bootcmd if they ever needed to do that for a firmware update. Another thought occurred to me: The EX2100 is different in some ways to the EX4100, but at least it sby hmartin - Debian
Quotebodhi 2. Does stock u-boot use only internal envs? the GPL code should say so if it is true. /* Boot from NAND settings */ #if defined(MV_NAND_BOOT) #define CONFIG_ENV_IS_IN_NAND #define CONFIG_ENV_SIZE 0x80000 /* environment takes one erase block */ #define CONFIG_ENV_OFFSET nandby hmartin - Debian
Hey bodhi, if the desire is just to change env variables to boot into Debian, then I found a way. Add #define CONFIG_CMD_SAVEENV to include/configs/armada_38x.h in the WD u-boot source. Build, kwboot. You will have a working saveenv command. I just tested it on my EX2100 to change serverip=192.168.11.114 to serverip=192.168.11.110 $ kwboot -f -t -B 115200 /dev/ttyUSB0 -b /tmp/u-boot-a3by hmartin - Debian
So unless I am totally misreading this, the ubootenv should start around 0xb0000.by hmartin - Debian
Quotesaschadd grep -i bootcmd mtd0 gives me matches in binary file mtd0. Could you please try the following: hexdump -C mtd0 | grep -A 5 -i bootcmd Because hexdump might cut the lines, could you also try: hexdump -C mtd0 | grep -A 5 -i 115200by hmartin - Debian
Quotebodhi The idea is to have a generic solution that works for everybody. Not about a specific individual, or type of box. I understand your desire to have a generic solution. However, if reflashing u-boot is necessary to enable the features we need (saveenv, usb boot) then I would also prefer that we invest time to get mainline support for u-boot. Working toward mainline u-boot support hby hmartin - Debian
@bodhi: Perhaps a stupid question, but couldn't we have saschadd dump mtd0 and then we grep through it to find a known u-boot variable? It seems this would at least allow us to narrow down where the appropriate region is.by hmartin - Debian
Quotebodhi 3. can you repeat this? and describe the sequence. This could take a while ;-) I suspect the successful sequence will be: Quotesaschadd So everytime if there is no handshake ctrl-c to end kwboot power off nas start kwboot power on nas The timing parameters are still not right. I don't know if there is a better way, I have not found more reliable delay parametersby hmartin - Debian
Quotesaschadd UPDATE: Could it be that the BootROM version 1.73 is not compatible with kwboot? @hmartin: could you check your BootROM version? I have BootROM version 1.73, kwboot does work. Your log shows that the device booted normally, meaning kwboot did not succeed with the right timing. This happens a lot. I need to try maybe 10 times before it works correctly. When it does work, yby hmartin - Debian
> This is expected. We need to find the location of the env on mtd0. I don't know if you can blindly trust Western Digital, but these are the u-boot defaults on my unit: mtdparts=orion_nand:1M(u-boot),512K(uboot_env),512K(key_store),512K(info),10M(etc),10M(kernel_1),48896K(rootfs1),10M(kernel_2),-(rootfs2) This also matches the DTB for the EX2U and what was populated on my EX2100:by hmartin - Debian
> @hmartin: have you had a look at this thread already? I know of the thread, I read it myself, but I have not looked at any of the software from fox_exe yet. > Here is the stock u-boot build for UART booting. This binary should be used in testing kwboot the box. Edit: derp. You were presenting a u-boot for EX4100... so disregard my gibberish below. My mistake! I thought I postby hmartin - Debian
Quotebodhi You're just be impatient :) You're right. I'll try more to get a more recent u-boot working via kwboot. Maybe I can put my impatience to some good use.by hmartin - Debian
Quotebodhi So, now if you put the rootfs on this SATA disk, it will boot into Debian and you'll get a running system. I'll need to write a new set of u-boot envs for you to do that. Maybe I'm being stupid, but what is the point of this? We have a proof of concept that Debian boots on the EX2100. The only issue with the EX4100 is USB power control, which I believe can be solved wby hmartin - Debian
Quotesaschadd One thing i noticed when the box booted to stock rom. The stock rom wants to have a sata drive inserted before you can do anything with the box. Well, this is an information the webgui gives when you try to open the webgui. This might be useless info for our problem but maybe a sata drive is needed somehow?! My EX2100 does exactly the same thing. I've never had a WD NAby hmartin - Debian
Quotebodhi And then use the rest of envs as same as before to boot. I am unable to successfully boot with your DTB as the EX2100 only has one SATA controller and the kernel hangs (gets stuck indefinitely?) on initializing the second SATA controller which doesn't exist on this model. Edit: Nevermind, I built the EX2U DTB (which works, albeit with only one Gigabit eth on the EX2100) fromby hmartin - Debian
Quotebodhi So this box works the same way the Armada XP does. Maybe, I can't be sure. As I said, it's pretty hit and miss on the timing to kwboot. I think there may be more ideal timings to improve the success. So don't take '-s 0 -q 1' as the correct timings for the 385. I did previously try 440 timing combinations with kwboot (before discovering and applying theby hmartin - Debian
Holy shit. It works! Apply the attached patch to kwboot.c in v2017.05 u-boot source. The patch is originally from https://lists.denx.de/pipermail/u-boot/2015-August/226105.html But it seems the patch was never applied to kwboot in the u-boot mainline (or at least, I cannot find it in the git log kwboot.c). The timing isn't perfect, I have to try a few times (edit: maybe 1 in 6 attemby hmartin - Debian
Ignore this post unless you are using a patched version of kwboot. See below post Quotebodhi There are new delay parameters in latest kwboot, specifcally for Armada XP BootROM. We have not figured out what they are for Armada 38x BootROM. I don't think there are any delay values for kwboot that work with this product. I automated testing different delay lengths with kwboot. $ ./kwboby hmartin - Debian
Quotebodhi We've beaten this kwboot subject to death on the NAS326 thread :) I was hoping the WD setting is different. But it seems they followed the same approach, and show the same behavior. I'm only 3 pages into the thread. So then the only way is to buy a chip clip and flash it directly to NAND...by hmartin - Debian
Quotebodhi When you do kwboot, what do you see? can you post the log? Sure: ./kwboot -t -B 115200 /dev/ttyUSB0 -b u-boot-a38x-Yosemite_2014T3_PQ-nand-uart.bin Sending boot message. Please reboot the target.../ Sending boot image... 0 % [+++++++++++++++++xmodem: Bad message Trying to kwboot *any* other u-boot image just sits with Sending boot message. Please reboot the target.../ forby hmartin - Debian