Probably it's required that you have to make a separate partition for the loader. I don't remember any example where this isn't done. However you might just have to skip the space with the loader
try this along with the 4k pad and LOADER_FLASH_OFFS := 0x51000
OK, but I think you're saying ... for now, as none of the rest of that is written out, just skip that 0x1000, and offset the firmware partition - right?
But I'm not seeing the padding really working, at least based on binwalk. I do have the pad-to in there, but binwalk isn't showing nice boundaries?
Figured it out ... padding needs to come after lzma, as that is what actually gets written to flash. Agreed? binwalk sort of shows me this ... LOL. Uncompressed size is 4k, not compressed.
uImage lzma adds the header, with the information that the following data is lzma compressed. Otherwise the bootloader wouldn't know what it is or how to use it
And ... so close . Built, loaded -> and again the stuck at "Starting kernel ...". Seems that wasn't just the clean and line shortening. Something to it. Not sure why it's freezing on boot. Hmmm.
Let me add a print statement or two (temporary! ), to see if the loader is at least getting launched.
BTW, something else to fix later perhaps - as @xabolcs pointed out, to rebuild the loader you manually need to, rm build_dir/target-*/linux-*/loader-*
I really don't know why that's happening to you, do you ever use git diff to take a look at your current changes? You didnt alter the loader source code right?
I did modify AR71XX_FLASH_START and AR71XX_FLASH_END (other than that, just some prints to show me info for now). But we posted almost the same time - I'm not even gettign to loader_main.
OK, having to shut it down for tonight, thanks so much for all the pointers and ideas. Complete rebuild, same thing - just hangs starting the loader. Not quite sure what's causing it . But I am optimistic that we are very close, just need to get over this hurdle.
One last thing I just noticed, tftp programming of the device - should the erase be rounded down (like it is), or up? This seems the wrong way to me ... corrupting part of the image?
Digging. Seeing a bunch of this error ... do you see this? I admit, not sure what is causing it - I just copied the loader-okli recipes over from ath79.
Makefile:214: warning: overriding recipe for target '/mnt/ProgSSD/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/loader-ravpower_wd03.bin'
Makefile:214: warning: ignoring old recipe for target '/mnt/ProgSSD/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/loader-ravpower_wd03.bin'
I've never had a problem compiling the loader. I always make clean between builds. But then again, I only have done this for 1 board.
I would run git diff (space to continue, q to exit)
Look through everything very carefully, and revert all your changes to loader.c, no need to test it anymore.
another random thing to try
touch all makefiles before you make clean for file in `find . | grep Makefile`; do touch $file; done;