<peterm6881>
which of these steps do I need to repeat to apply the changes?
<peterm6881>
for p in /path/to/buildroot-speedsaver-mangopi/buildroot-patches/*.patch; do patch -p1 < $p; done
<peterm6881>
make BR2_EXTERNAL=/path/to/buildroot-speedsaver-mangopi speedsaver_defconfig O=output/speedsaver
<peterm6881>
cd output/speedsaver
<peterm6881>
make
<Xogium>
all of them except the first one
<peterm6881>
make clean && make i mean
<peterm6881>
ok
<Xogium>
you need a distclean
<Xogium>
I touched the defconfig
<peterm6881>
let me check my notes
<peterm6881>
ok got it
<Xogium>
but your buildroot was already patched so that part is fine
<peterm6881>
distclean running now
<peterm6881>
make distclean i mean, obvs
<Xogium>
yes
<peterm6881>
stand by
<peterm6881>
by the way i think if you insert spacer lines between the steps in github, the copy button only copies the line you want. Otherwise it copies all the lines to the clipboard
<peterm6881>
ok building now
<Xogium>
hmm not sure about copying lines. I never used that lol I just select the line with shift+end then copy with ctrl+c
<peterm6881>
have you tried this on a board?
<Xogium>
yes
<peterm6881>
i cant type run dfu_nand at the u-boot command prompt
<Xogium>
why not ?
<Xogium>
hmm
<peterm6881>
i have the prompt , but it wont let me type anything
<Xogium>
huh… weird
<Xogium>
did you try unplugging and replugging ?
<peterm6881>
the whole process is very hit and miss
<Xogium>
hmm
<peterm6881>
gonna try that now. If I installed u-boot, it should boot to that prompt right?
<peterm6881>
it doesnt, putty is blank
<Xogium>
you might be in FEL mode ?
<peterm6881>
so if im in fel mode. i should be able to just run sudo sunxi-fel -p uboot images/u-boot-sunxi-with-spl.bin right?
<peterm6881>
ERROR: Allwinner USB FEL device not found!
<peterm6881>
the fucking usual
<Xogium>
hrmm
<Xogium>
this is so weird
<Xogium>
I've never hit this
<Xogium>
not sure how you hit that to reproduce
<peterm6881>
Booting from FEL...
<peterm6881>
## Error: "bootcmd_dfu" not defined
<peterm6881>
=>
<Xogium>
right
<Xogium>
so you're in u-boot now
<Xogium>
so you have to erase the flash then use run_dfu_nand
<Xogium>
er
<Xogium>
run dfu_nand
<peterm6881>
now the fucker is letting me type. Its a tricky little shit
<Xogium>
weird
<Xogium>
I never had this either
<peterm6881>
by the way, whats the difference between our mtd erase spi-nand0 0x0 0x8000000 and mtd erase spi-nand0 in the dfrobot wiki
<Xogium>
none
<peterm6881>
is there a reason we specify those locations?
<peterm6881>
ok nand erased
<peterm6881>
downloading now
<Xogium>
just to be sure
<peterm6881>
shame we could get rid of these, the OPi0 has a similar audio one
<Xogium>
you could do that later it's not an emergency
<Xogium>
it just fixes a tiny problem in u-boot and removes some unused env variables from it
<Xogium>
nothing too vital
<peterm6881>
ok lets go through flashing
<peterm6881>
ive putty running and im in peter@peter-powermatemlxxx:~/buildroot-2022.02-mango/output/speedsaver$
<Xogium>
alright so
<Xogium>
switch it into FEL mode
<Xogium>
then run sunxi-fel… stuff
<peterm6881>
wait
<peterm6881>
explain putting it into fel mode
<Xogium>
pressing the buttons, I mean
<peterm6881>
just press both and release both?
<Xogium>
yes, but not at the same time for releasing
<peterm6881>
what the correct order
<Xogium>
reset first, then boot, with a slight delay like half a sec
<Xogium>
then once you have done that, run the sunxi-fel thing
<peterm6881>
ok wait
<Xogium>
once you get to the u-boot prompt in putty, you erase the nand with mtd erase spi-nand0
<Xogium>
then you can do the run dfu_nand thing, then each of the 2 dfu-util commands
<peterm6881>
ERROR: Allwinner USB FEL device not found!
<peterm6881>
its officially shit
<Xogium>
but how the hell do you run into this
<peterm6881>
getting the stupid fucker successfully into FEL mode is simply too hard
<peterm6881>
its not me, im a technician, its simply too fucking hard
<Xogium>
so when did you see this
<Xogium>
when you ran sunxi-fel ? After in the putty console ?
<peterm6881>
right after i did those inital steps to put it into fel mode and run the first command
<Xogium>
but you get to a u-boot prompt ?
<Xogium>
I mean, if sunxi-fel ran without any complain then you definitely were in FEL mode
<peterm6881>
no its prozen at the speedsaver login, it wont even let me type anything in putty
<peterm6881>
frozen
<Xogium>
this is crazy weird
<Xogium>
you sure you have good quality usb cables ?
<peterm6881>
no i got the error when i ran sunxi-fel
<peterm6881>
its heartbreaking
<Xogium>
hmm
<Xogium>
what I do here is press both buttons, release the left button first, the noe nearest to the edge of the board, then release the right button
<Xogium>
the one
<peterm6881>
at least its consistently bad. Bacially i have to fuck with it till it randomly decides to work. We should explain that in the readme
<Xogium>
honestly I have put mine into FEL mode at least 80 times by now, and I never had this… so I really don't understand
<peterm6881>
thats right, left button would be rst
<Xogium>
is there any way I could log in in your NEC via the alarm box and try and see what might be going on ?
<peterm6881>
ok it did it that time, i made a slightly longer delay between releasing RST and then BOOT
<Xogium>
yes like I said the delay part is very tricky
<peterm6881>
the sunxi-fel ran that time
<Xogium>
good good !
<peterm6881>
so whats next
<Xogium>
so then you can erase the nand
<peterm6881>
do we really need that longer erase command?
<Xogium>
nah you c9ould just type the spi-nand0 and finish it like that
<Xogium>
its just that I personally felt like being aware of where it began and where it ended was a good thing
<Xogium>
I think my midle finger is too long and typed that 9
<peterm6881>
ok nand erased
<peterm6881>
next step
<Xogium>
woohoo
<Xogium>
next step is you run
<Xogium>
run dfu_nand
<peterm6881>
sorry for slow replaies, im making a mango flash note for myself
<Xogium>
then you get to you other terminal and give it the 2 dfu-util commands
<peterm6881>
success
<Xogium>
yay
<Xogium>
and when we can turn off logins for good, it will in theory save us another 9 to 10 seconds
<peterm6881>
Assumes existing data on the nand flash and that you are in the buildroot-2022.02-mango/output/speedsaver directory. Connect to device via CH340 on /dev/ttyUSB0 (or as appropriate). Note both USB cables must be connected.
<peterm6881>
Place device into FEL mode by pressing BOOT and RST buttons, then release RST first then BOOT (with a half second delay or so). Then in the Terminal run
<peterm6881>
In putty you should have a => u-boot command prompt, at this prompt erase the nand by typing
<peterm6881>
mtd erase spi-nand0
<peterm6881>
When completed, at the u-boot prompt type
<peterm6881>
run dfu_nand
<peterm6881>
then run the following 2 commands in the Terminal within 15 seconds:
<peterm6881>
sudo dfu-util -a u-boot -D images/u-boot-sunxi-with-nand-spl.bin
<peterm6881>
sudo dfu-util -R -a rom -D images/rootfs.ubi
<Xogium>
sounds good
<Xogium>
I might reword this for the readme
<Xogium>
so, did it improve at least the boot ?
<peterm6881>
the readme isnt bad perse, im just dumber than it assumes, so i have to make it REALLY clear for myself, so its consistent
<peterm6881>
let me check lol
<peterm6881>
which was kinda the whole point
<peterm6881>
hmm... i counted off 43 seconds till stuff appeared on the screen, so i timed it with a stopwatch. I made it 46 seconds
<Xogium>
hmm
<peterm6881>
remind me why we need the login?
<peterm6881>
let me recheck it, and also check against the previous image
<peterm6881>
wait
<Xogium>
because otherwise you can't run commands like to update with rauc eventually. Once the updates are all handled in the background, independent of us having to log in and run the rauc install command, we can turn login off
<peterm6881>
oh yeah
<peterm6881>
u said :)
<peterm6881>
the last one was actually 46.9s, this time i got 47.01, let me try the previous build now, with the stopwatch
<peterm6881>
1 minute and 1.83 seconds
<Xogium>
woah
<Xogium>
definitely an improvement then
<peterm6881>
so yeah, around 15s faster as predicted, well done
<peterm6881>
interestingly, the login prompt appears about 3 seconds after version stamp writes to the screen
<Xogium>
yeah logind is really slow
<peterm6881>
just if you were comparing timings
<Xogium>
ah yes, comparing oled vs login prompt
<peterm6881>
so for any timings you do, if you're going by the login prompt, subtract 3 seconds
<Xogium>
sounds good
<peterm6881>
ok i guess thats as good as it gets for now
<Xogium>
the cool thing is that we could even boot a different image via FEL not just u-boot
<Xogium>
we could boot a debug image that has more functionality that way, like login support
<peterm6881>
itll be good when we can ditch login eventually. Pity Busybox isnt an option
<Xogium>
yeah honestly its way too basic and I'm not comfortable with using it properly
<peterm6881>
but i understand it fucks everything up we worked on
<Xogium>
especially for things like rauc, the idea is that rauc signals to the bootloader that the boot went good once every service run rpoperly. So, only once navit is started, only once gpsd runs
<peterm6881>
yeah thats fine. To be honest, on a cold start the GNSS would be lucky to get a fix in that time
<Xogium>
you need ordering and dependency handling for this, none of which busybox has
<peterm6881>
in ideal conditions, they usually state TTFF is around 29-31 seconds
<Xogium>
right
<peterm6881>
on a cold start, way less on a warm start
<Xogium>
so the 9 seconds we could get if we disable login should be good enough
<peterm6881>
oh yeah. It is what it is. Im surprised nand is as slow as it is, i never thought of micro sd as being exactly fast :)
<peterm6881>
i guess all that OPi0 quad core and 512 MB RAM goodness helped more than I thought!
<Xogium>
yeah spi is slower than sdio
<peterm6881>
its all good knowledge
<peterm6881>
so any more commits before I do a final pull?
<peterm6881>
better stick a version number in there
<Xogium>
SPI is a bit simpler to implement, but is significantly slower than SD, as SD supports multi-bit IO (similar to QSPI), and can run at higher clock rates.
<Xogium>
spi does only 1-byte io
<Xogium>
qspi does, well… 4, you guessed it
<peterm6881>
:)
<Xogium>
there's also octa-spi but I've seen it just once
<peterm6881>
Place device into FEL mode by pressing BOOT and RST buttons, then release RST first then BOOT (with a half second delay or so). Then in the Terminal run
<peterm6881>
Assumes existing data on the nand flash and that you are in the buildroot-2022.02-mango/output/speedsaver directory. Connect to device via CH340 on /dev/ttyUSB0 (or as appropriate). Note both USB cables must be connected.
<peterm6881>
In putty you should have a => u-boot command prompt, at this prompt erase the nand by typing