Rockbox Technical Forums

Installation / Removal => Manual Installation => Other - Installation/Removal => Topic started by: SelectOkay on May 16, 2022, 05:21:35 PM

Title: Surfans F20 "NAND open error"
Post by: SelectOkay on May 16, 2022, 05:21:35 PM
I'm new to the forums and Rockbox, but I've installed it on a Sandisk Clip Zip without much issue. The problem is  I bought a Surfans F20 and I can't install Rockbox on it.
I've tried using the Rockbox Utility but after using the firmware from the company itself, the utility constantly crashes.
SO I tried to use the native port and got farther, but now it's telling me "NAND open error (5)" I tried using two different mircoSD cards and even changing the partition from GPT to MBR but it's not working. Does anyone have any advice or help? I'm kinda stumped here.
Title: Re: Surfans F20 "NAND open error"
Post by: SelectOkay on May 16, 2022, 08:41:47 PM
Update: I manually installed the bootloader and that fixed all my problems. I guess I'm newer to all this than I thought. Whoops!
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on May 17, 2022, 07:08:52 AM
I'm not sure if the native port has been tested on the Surfans F20. The NAND open error is a bit odd. Usually this would mean your flash chip is not supported, but since it worked eventually... meh. It's good you got it working, though!
Title: Re: Surfans F20 "NAND open error"
Post by: dconrad on May 17, 2022, 11:02:24 AM
Nevermind, ignore
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on May 29, 2022, 11:48:13 AM
Update: I manually installed the bootloader and that fixed all my problems. I guess I'm newer to all this than I thought. Whoops!
Did you manage to install the native port, or are you running the hosted port now? If you installed the native port, I'd love to hear how you did it, as I'm having the exact same issue.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on May 29, 2022, 12:57:15 PM
kaas - The F20 may have a different flash chip that isn't recognized. I'm happy to assist, but we need to figure out is what flash chip is used. If you are willing and able to take apart the player, that's the fastest way to find out. The other option is probing the flash in software, but that'll require a modified bootloader.
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on May 29, 2022, 01:49:29 PM
kaas - The F20 may have a different flash chip that isn't recognized. I'm happy to assist, but we need to figure out is what flash chip is used. If you are willing and able to take apart the player, that's the fastest way to find out. The other option is probing the flash in software, but that'll require a modified bootloader.
Thanks very much, I would prefer to go the software route as I'm not very comfortable taking it apart (don't even see any screws so it would probably involve at least some amount of breakage..). I assume in that case you can send me the required bootloader, and I'll run it with jztool?

Edit: I've since resolved my issue with the hosted port (see this bug (https://www.rockbox.org/tracker/task/13353)), which was why I wanted to try the native port in the first place. So from my end, there's no particular hurry to get the native port working on my specific player. I'd still be glad to assist, though.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on May 31, 2022, 01:30:07 PM
kaas - The F20 may have a different flash chip that isn't recognized. I'm happy to assist, but we need to figure out is what flash chip is used. If you are willing and able to take apart the player, that's the fastest way to find out. The other option is probing the flash in software, but that'll require a modified bootloader.
Thanks very much, I would prefer to go the software route as I'm not very comfortable taking it apart (don't even see any screws so it would probably involve at least some amount of breakage..). I assume in that case you can send me the required bootloader, and I'll run it with jztool?

Edit: I've since resolved my issue with the hosted port (see this bug (https://www.rockbox.org/tracker/task/13353)), which was why I wanted to try the native port in the first place. So from my end, there's no particular hurry to get the native port working on my specific player. I'd still be glad to assist, though.

Okay, I added a flash info command to the bootloader, download link here: https://drive.google.com/file/d/1BgvDvGBKBSnWTDBHfE_uii3fjpSARqxt/view
(which is patch g#4566 (https://gerrit.rockbox.org/r/c/rockbox/+/4566))

If you load that with jztool and select Debug tools > Flash info from the menu, it will dump some info to a file called flash_info.txt on the SD card. Copy & paste the file contents here. It'll show the ID bytes and some additional info - whether the chip is NAND or NOR and the page and block sizes. The probing method is basically the same as what the CPU does on boot to identify the flash, and it's read-only, so it should be safe. I also tested it on my players as a sanity check and it's working as expected.
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on June 07, 2022, 07:15:29 AM
Here you go :)

Quote
readID opcode  = FF EF AA 21
readID address = EF AA 21 00
readID dummy   = EF AA 21 00
sfc params0  = 06 05 04 03
sfc params1  = 02 55 AA 55
sfc params2  = 00 63 02 02
sfc params3  = A4 2F 00 00
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on June 08, 2022, 06:10:45 AM
Thanks, it appears to be a Winbond W25N01GV (https://datasheet.lcsc.com/lcsc/1809200036_Winbond-Elec-W25N01GVZEIG_C88868.pdf) based on the ID bytes.

Here's an updated bootloader which supports that chip: https://drive.google.com/file/d/1zj8gq1G8DK-9581uVWq-9FmKXLlPuw5w/view?usp=sharing

This one has a "Flash ONFI info" option which you can run, paste the flash_onfi_info.txt file here. If the info matches up with the datasheet (8.2.27 Parameter Page Data Definitions) then we can be pretty confident the chip is correct. If you also take a normal bootloader backup and upload it somewhere, I can check that out to make sure it looks sane.
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on June 13, 2022, 03:46:57 AM
Quote from: flash_onfi_info.txt
signature = 2222AAAA
revision = AAAA
manufacturer = "ÿÿÿÿÿÿÿÿÿÿÿÿ"
device model = "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"
JEDEC mf. id = FF
data bytes per page = 4294967295
spare bytes per page = 65535
pages per block = 4294967295
blocks per lun = 4294967295
number of luns = 255
bits per cell = 255
max bad blocks = 65535
block endurance = 65535
programs per page = 255
page program time = 65535
block erase time = 65535
page read time = 65535
And here (https://drive.google.com/file/d/13WP-95MVuDDSRIp92lKA9Sy2v_oXukZz/view?usp=sharing) is the bootloader backup. Although using the bootloader went fine I did not go ahead flashing it, since the datasheet values don't seem to match up (e.g. spare bytes per page is 4x higher in the txt than in the datasheet), I may be misinterpreting it however.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on June 13, 2022, 06:54:28 AM
It's not reading data off the chip properly, the data is mostly 0xff, so yeah flashing it would be a really bad idea. Not sure what's wrong. I'll try reducing the clock speed & disable quad I/O, and double check for any mistakes I might've made.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on June 20, 2022, 04:16:21 PM
Here's another build, try dumping the ONFI info and take a bootloader backup again. I wouldn't advise flashing it.
https://drive.google.com/file/d/1IJjG_zZxdSxNZK3XM-nAeaJzVnR2oHcK/view?usp=sharing
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on June 22, 2022, 06:19:40 AM
Quote from: flash_onfi_info.txt
probed chip ID = EF AA 21
signature = FFFFFFFF
revision = FFFF
manufacturer = "ÿÿÿÿÿÿÿÿÿÿÿÿ"
device model = "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"
JEDEC mf. id = FF
data bytes per page = 4294967295
spare bytes per page = 65535
pages per block = 4294967295
blocks per lun = 4294967295
number of luns = 255
bits per cell = 255
max bad blocks = 65535
block endurance = 65535
programs per page = 255
page program time = 65535
block erase time = 65535
page read time = 65535
Bootloader backup. (https://drive.google.com/file/d/1eyJ7T-9eUjFSse5ZQ-5mdAIVKwmSyBB0/view?usp=sharing) Thanks again for your continued efforts.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on June 23, 2022, 12:16:02 PM
That last dump was almost good but shifted by one byte. This build should fix it.
https://drive.google.com/file/d/1LQtakDKCNTGvXU-u9QVYc056nN78CkDl/view?usp=sharing

Try another bootloader backup. No need to bother with the ONFI info this time.

Also, could you unzip a daily build to your SD and run rockbox directly from the bootloader? You don't need to install the bootloader, just select the Rockbox boot option while you're in the bootloader. EDIT: I forgot to mention, this is so you can check if rockbox actually works. If they changed the flash there's no guarantee the rest of the hardware is the same as older units.
Title: Re: Surfans F20 "NAND open error"
Post by: twotoneblue on June 26, 2022, 06:57:04 AM
Dear amachronic and kaas,

I hope I am not interrupting your exchange, but if it helps, here is a backup of the native bootloader taken after loading amachronic's bootloader v4 with jztool (https://drive.google.com/file/d/1xvTcsPqMgWUUic_VzPFrYSAAqe117ugT/view?usp=sharing (https://drive.google.com/file/d/1xvTcsPqMgWUUic_VzPFrYSAAqe117ugT/view?usp=sharing)). Albeit not requested at this point, I also made a zip archive of (all) the available debug dumps (https://drive.google.com/file/d/17irOvVhWSZW18bn6DYpiDMTG0yMFHyEo/view?usp=sharing (https://drive.google.com/file/d/17irOvVhWSZW18bn6DYpiDMTG0yMFHyEo/view?usp=sharing)).

As for running Rockbox from the bootloader menu; I extracted the zip of the native Rockbox (should it have been a daily hosted build?) onto the SD card and started it from the bootloader menu. It runs and plays a FLAC file with no noticeable problems. The only thing I saw was the message: "error accessing playlist control file" as I unplugged the USB connection to the computer.

Notably, while some tiny pops can be heard when plugging into the Line Out, no sound comes out of it during playback.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on June 26, 2022, 12:04:21 PM
...
Thanks, you did everything right. Aside from line out not working, it sounds like Rockbox runs fine. But isn't that the same as the hosted build?

The ONFI info is okay and matches up with the Winbond datasheet. The raw values are correct but I got the endianness wrong in the dumper, so the text dump appears wrong. It seems there's still something wrong with the flash read, some pages are being read as 0xff intermittently and some are getting zeros prepended to them. So we're not quite there yet, but getting closer.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on June 26, 2022, 02:25:41 PM
Turns out I didn't put the chip into buffered read mode. That's fixed, also fixed the ONFI dumper. Maybe this build will actually work? Either a full flash dump or bootloader backup should be enough to confirm.

https://drive.google.com/file/d/1a5GbTZWmyxsgglfdRjHJ4EfXoyEZBCZD/view?usp=sharing
Title: Re: Surfans F20 "NAND open error"
Post by: twotoneblue on June 27, 2022, 06:08:13 AM
Hi,

Interesting! It seems that this time the readable text (e.g. "Winbond") in the ONFI dump is gone again. Debug files and bootloader backup at https://drive.google.com/file/d/11mzSyUDyyRi6DGnfWFrtbZQOpWC43cwo/view?usp=sharing (https://drive.google.com/file/d/11mzSyUDyyRi6DGnfWFrtbZQOpWC43cwo/view?usp=sharing).

Rockbox runs and plays fine apparently. No USB-related error message this time. No sound in Line Out.

My sincerest thanks for your continued efforts, amachronic!
Title: Re: Surfans F20 "NAND open error"
Post by: twotoneblue on June 28, 2022, 06:13:53 PM
But isn't that the same as the hosted build?

Btw, sorry I forgot to answer this; yes, it is the same functionality as observed with the hosted build :-)
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on July 04, 2022, 01:10:20 PM
Turns out I didn't put the chip into buffered read mode. That's fixed, also fixed the ONFI dumper. Maybe this build will actually work? Either a full flash dump or bootloader backup should be enough to confirm.

https://drive.google.com/file/d/1a5GbTZWmyxsgglfdRjHJ4EfXoyEZBCZD/view?usp=sharing
Hi, would it still help if I do this as well (or the one you posted previously), or is twotoneblue's backup enough for now?
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on July 06, 2022, 06:38:30 AM
You're welcome to try another backup, but unfortunately twotoneblue's backup is showing the same issue as before and it's safe to assume yours would too. I haven't had time to investigate further.

In case anyone is interested the bootloader sources are on Gerrit (https://gerrit.rockbox.org/r/c/rockbox/+/4577), and Linux (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/mtd/nand/spi/winbond.c) also supports this flash, so maybe that's useful as a reference.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on July 09, 2022, 06:23:41 AM
Looks like I left all the timing parameters at the minimum defaults, so I think commands were being sent to the flash too quickly and that's why the read data was all wrong. Now I've increased the timings so the delay between commands is longer. Here's a new bootloader (https://drive.google.com/file/d/1cnL8L_XqhzjZzDtpLE2iTVCo9iu5O6_s/view?usp=sharing) to try. Fingers crossed...
Title: Re: Surfans F20 "NAND open error"
Post by: twotoneblue on July 09, 2022, 10:06:10 AM
The output from this version looks very reasonable to my untrained eyes!  ;D

https://drive.google.com/file/d/1jorB9t9JSbcazm8ZPJwVyVw5aecDNvrK/view?usp=sharing (https://drive.google.com/file/d/1jorB9t9JSbcazm8ZPJwVyVw5aecDNvrK/view?usp=sharing)
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on July 09, 2022, 04:02:09 PM
Looks good to me! The dump matches up with the v2.7 firmware images.

All that's left to do is try installing the v6 bootloader build and see if it can boot Rockbox and the original firmware.
Title: Re: Surfans F20 "NAND open error"
Post by: twotoneblue on July 09, 2022, 08:27:44 PM
Great!

First, for good measure; a corrected zip with the bootloader backup - I forgot this file in the previous one: https://drive.google.com/file/d/1-zqsdh3BWI4Q0mxOGWuB8L2nor_43X7W/view?usp=sharing (https://drive.google.com/file/d/1-zqsdh3BWI4Q0mxOGWuB8L2nor_43X7W/view?usp=sharing)

I ran the install and update from the bootloader menu with success (having renamed the bootloader-v6 file to "bootloader.erosq" on the SD-card, else the installation gives a file not found error, naturally), and the latest native rockbox seems to start fine. Dual boot also works, so this looks good.


Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on July 10, 2022, 08:55:25 AM
Cool! ;D

I'll update the official bootloader builds and wiki soon. I think it's pretty safe to say newer Surfans F20 units with FW v2.7 are now supported.
Title: Re: Surfans F20 "NAND open error"
Post by: twotoneblue on July 11, 2022, 05:32:46 AM
Nice work, amachronic - many thanks! :D 8)

The native dual boot setup is a good one to have, providing the rockbox goodness for headphones, but also catering for the occasional need for the line out or the bluetooth function throught the aigo player.

Speaking of which, now that the status of Surfans F20 v2.7 will be moved to supported, should I open a separate thread/issue (or even bug report) about the silence of the line out? And, would you have any ideas on how one can proceed to investigate this problem?

My sincerest thanks again for your efforts!
Title: Re: Surfans F20 "NAND open error"
Post by: JosephM on July 18, 2022, 11:16:41 PM
Cool! ;D

I'll update the official bootloader builds and wiki soon. I think it's pretty safe to say newer Surfans F20 units with FW v2.7 are now supported.

I hate to revive the thread, but I don't think that's the case. I got a new unit today with the 2.7 FW and it seems like it has yet another flash chip. (Or at least I'm hitting the same nand read error, even with the v6 bootloader.) Using the debug code provided, I got

Code: [Select]
readID opcode  = FF C8 D1 C8
readID address = C8 D1 C8 D1
readID dummy   = D1 C8 D1 C8
sfc params0  = 06 05 04 03
sfc params1  = 02 55 AA 55
sfc params2  = 00 63 02 02
sfc params3  = A4 2F 00 00
which from looking at the Linux SPI Nand identification code makes me think it's the GigaDevice GD5F1GQ4UExxG. https://www.gigadevice.com/datasheet/gd5f1gq4xexxg/ (https://www.gigadevice.com/datasheet/gd5f1gq4xexxg/)
Title: Re: Surfans F20 "NAND open error"
Post by: Falco98 on July 19, 2022, 11:59:16 AM
I think it's pretty safe to say newer Surfans F20 units with FW v2.7 are now supported.

That's good news.  The unit I bought a couple months ago came with 2.7 and I felt a little "dirty" forcing a downgraded FW version (2.5) onto it, even though that worked about as well as we expect any builds to work at present (AFAIK).  Can you advise me whether I should try upgrading soon?  I've enjoyed following the tech discussion here, but must admit it's somewhat over my head.

Also, purely as an aside: this unit is eventually intended for my FIL to be his car music player (hardwired, since we already know BT is off the table for the foreseeable future), but the one thing that'll need to be working before that is for USB charging to function correctly (just fwiw); since it boots to USB now instead of to the player, i'm afraid it won't work for him since I'd be telling him to just leave it plugged in in his car.  Just mentioning this here in case anyone has any insight as to whether i should expect this to ever be fixed.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on July 19, 2022, 03:45:16 PM
I hate to revive the thread, but I don't think that's the case. I got a new unit today with the 2.7 FW and it seems like it has yet another flash chip. [...]

Here's an updated bootloader (v7) (https://drive.google.com/file/d/1eRNxn0B_V36kNtH8oHJkmDKnuuxaZZJ2/view?usp=sharing) with support for the GD5F1GQ4xExxG. Upload a full dump (debug tools > dump entire flash, zip the resulting flash.img). Or check it yourself by comparing against uboot.bin in the OF image.

kaas, twotoneblue - could either of you provide another dump with the v7 bootloader to ensure it still works with the Winbond flash? I made a couple tweaks, which shouldn't have broken anything but it's a good idea to test again just in case. Thanks.

Title: Re: Surfans F20 "NAND open error"
Post by: JosephM on July 19, 2022, 07:56:25 PM
I hate to revive the thread, but I don't think that's the case. I got a new unit today with the 2.7 FW and it seems like it has yet another flash chip. [...]

Here's an updated bootloader (v7) (https://drive.google.com/file/d/1eRNxn0B_V36kNtH8oHJkmDKnuuxaZZJ2/view?usp=sharing) with support for the GD5F1GQ4xExxG. Upload a full dump (debug tools > dump entire flash, zip the resulting flash.img). Or check it yourself by comparing against uboot.bin in the OF image.

kaas, twotoneblue - could either of you provide another dump with the v7 bootloader to ensure it still works with the Winbond flash? I made a couple tweaks, which shouldn't have broken anything but it's a good idea to test again just in case. Thanks.

Wow, that was fast, thanks so much!!

I'm not sure how to compare it against the uboot.bin, they're wildly different sizes, so I assume I would need to extract the bootloader. But here's the link https://drive.google.com/file/d/1OzyUtGlceIe7iKbYWZ-6JZ3-h2MjnyMJ/view?usp=sharing (https://drive.google.com/file/d/1OzyUtGlceIe7iKbYWZ-6JZ3-h2MjnyMJ/view?usp=sharing).


I should add, I'm also able to take a bootloader backup and there are some strings in it that make be think it's not total gibberish. And I'm able to boot the native firmware.

I also checked the dump of of_player.img against the one posted earlier in this thread and they hash the same. Compared to the whole flash image shown earlier in this thread, the binwalk output is identical (though the files do differ), so I'm pretty much convinced that it is working, so I'm going to install the bootloader.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on July 20, 2022, 10:24:21 AM
Your dump is mostly OK and matches up with twotoneblue's dump and the vanilla FW images, except the first 4 pages (up to offset 0x1fff) are zeroed, and that's definitely a problem. Could you check if the bootloader backup is zeroed in the same way? The first bytes should be 06 05 04 03 02 55 aa 55 in a good dump (the same as what is shown in the SFC params).
Title: Re: Surfans F20 "NAND open error"
Post by: JosephM on July 20, 2022, 06:53:12 PM
The bootloader doesn't appear to be zeroed in the same way, but those aren't the first few bytes. https://drive.google.com/file/d/16PQF--F50bQDUA247X2nKnnlN6_DvHpC/view?usp=sharing (https://drive.google.com/file/d/16PQF--F50bQDUA247X2nKnnlN6_DvHpC/view?usp=sharing)

Code: [Select]
0000000 0506 0304 5502 55aa 6300 0202 2fa4 0000
0000010 0000 0000 0000 0000 0000 0000 0000 0000
*
0000800 8007 4002 0000 0000 0002 3442 8007 4082

I also tested installing the rockbox bootloader last night. That worked. I just tried restoring from my bootloader backup and that worked perfectly too.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on July 20, 2022, 08:49:34 PM
The bootloader doesn't appear to be zeroed in the same way, but those aren't the first few bytes.
Code: [Select]
0000000 0506 0304 5502 55aa 6300 0202 2fa4 0000
0000010 0000 0000 0000 0000 0000 0000 0000 0000
*
0000800 8007 4002 0000 0000 0002 3442 8007 4082
That's good, and the bytes are the same; you're looking at 16-bit little endian values, effectively swapping every pair of bytes.

Quote
I also tested installing the rockbox bootloader last night. That worked. I just tried restoring from my bootloader backup and that worked perfectly too.
Did you do the bootloader backup or the full dump first? If you don't mind, could you also try a few bootloader backups from USB boot and inspect each one, and see if any of them get zeroed? (to check if this a transient error that pops up "randomly" or does it occur predictably on the first dump.)
Title: Re: Surfans F20 "NAND open error"
Post by: JosephM on July 20, 2022, 09:14:10 PM
Lol, whoops, don't know how I missed that it was just little endianed.

As for the dumps I did the full dump first. But I also did subsequent bootloader dumps on fresh boots and they were all the same. And now I can't recreate the problematic full-flash dump (I tried four or five times).

When checking all the files, I noticed that the OFNI flash info file from that same boot was also zeroed. So maybe in the shuffle of files between devices and unplugging without unmounting, etc, the filesystem got corrupted? (I have since wiped and reformatted the drive since b/c I was getting weird errors.)
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on July 21, 2022, 05:54:24 AM
So it's probably a filesystem error and nothing wrong with the flash, thank you for investigating.
Title: Re: Surfans F20 "NAND open error"
Post by: twotoneblue on August 01, 2022, 03:11:49 PM
kaas, twotoneblue - could either of you provide another dump with the v7 bootloader to ensure it still works with the Winbond flash? I made a couple tweaks, which shouldn't have broken anything but it's a good idea to test again just in case. Thanks.

Dear all,

Apologies for not seeing the updates here - for some reason the notification didn't reach me. Here is the usual package with the v7 bootloader: https://drive.google.com/file/d/15Tw912xBi0yB0LDxorQVqi4igAxwtAQg/view?usp=sharing (https://drive.google.com/file/d/15Tw912xBi0yB0LDxorQVqi4igAxwtAQg/view?usp=sharing)

There are a few differences - I believe you can make more sense of them than me.

Thanks for your continued investigations, everyone!
Title: Re: Surfans F20 "NAND open error"
Post by: Ren on August 04, 2022, 03:10:03 AM
I bought a Surfans F20 Player as well and I want to install the native port on it.
I wasn't able to make a backup of the original bootloader with the bootloader provided from the wiki => "NAND open error (5).
 
I read through this thread that i stumbled upon when I searched for the error above.
I booted into bootloader-v7.erosq (from linux) and made a flash.img dump, flash_info.txt and a flash_onfi_info.txt using the debug tools of the v7 bootloader.
Here are the fileshttps://mega.nz/file/GCoF2DzS#KPCE35PTVlo6Twy3H3Qa5tdvrd1DiP4syjynI1O22LU (https://mega.nz/file/GCoF2DzS#KPCE35PTVlo6Twy3H3Qa5tdvrd1DiP4syjynI1O22LU).
I hope this helps in getting the natitve build stable on the SURFANS F20?!
Is it save to proceed with the installation of the native port with the latest (v7) bootloader from this thread?

Flash info:
readID opcode  = FF C8 D1 C8
readID address = C8 D1 C8 D1
readID dummy   = D1 C8 D1 C8
sfc params0  = 06 05 04 03
sfc params1  = 02 55 AA 55
sfc params2  = 00 63 02 02
sfc params3  = A4 2F 00 00

flash_onfi_info:
signature = FFFFFFFF
revision = FFFF
manufacturer = "ÿÿÿÿÿÿÿÿÿÿÿÿ"
device model = "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"
JEDEC mf. id = FF
data bytes per page = 4294967295
spare bytes per page = 65535
pages per block = 4294967295
blocks per lun = 4294967295
number of luns = 255
bits per cell = 255
max bad blocks = 65535
block endurance = 65535
programs per page = 255
page program time = 65535
block erase time = 65535
page read time = 65535

edit:
I installed the ROCKbox native port from the v7 bootloader, after a success message I first booted into ROCKbox from the BOOT Menue, this worked.
Then I rebooted and I just got a flickering screen.
So I powered the device off by long pressing power.
A new press on power just gives me the flickering screen again...
So I loaded the v7 bootloader from command promt again...
I reinstalled ROCKbox and powered off after.
I pressed power again and all I got is a flickering screen again.
So I started the bootloader again and created a Flashdump and the info files again.
here are they https://mega.nz/file/jTQS1K6Y#2OMx0mlbN7KqH24NBsz7AEeZqBCtWyXwTirj_9ecDxM

Then I restored the original bootloader. Now the player is working again with its original Firmware (not with ROCKbox sadly). I hope you will have success in getting the thing working with ROCKbox! If you need something else from me I try to provide it to you.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on August 07, 2022, 10:06:01 AM
I bought a Surfans F20 Player as well and I want to install the native port on it.
[...]
Is it save to proceed with the installation of the native port with the latest (v7) bootloader from this thread?
[...]
Flash info:
readID opcode  = FF C8 D1 C8
readID address = C8 D1 C8 D1
readID dummy   = D1 C8 D1 C8
[...]

This shows you have the GigaDevice flash (same as JosephM's) so yes it's safe to install with the v7 bootloader.

Quote
I installed the ROCKbox native port from the v7 bootloader, after a success message I first booted into ROCKbox from the BOOT Menue, this worked.
Then I rebooted and I just got a flickering screen.
So I powered the device off by long pressing power.
A new press on power just gives me the flickering screen again...
So I loaded the v7 bootloader from command promt again...
I reinstalled ROCKbox and powered off after.
I pressed power again and all I got is a flickering screen again.
So I started the bootloader again and created a Flashdump and the info files again.
here are they https://mega.nz/file/jTQS1K6Y#2OMx0mlbN7KqH24NBsz7AEeZqBCtWyXwTirj_9ecDxM

Then I restored the original bootloader. Now the player is working again with its original Firmware (not with ROCKbox sadly). I hope you will have success in getting the thing working with ROCKbox! If you need something else from me I try to provide it to you.

I don't know what the issue is, but if you try a few things it might help narrow things down:
Also if you could explain what you mean by the screen "flickering" that would help. Can you see the Rockbox logo or menus? Do they look corrupted? Or do you see randomly colored "noise"? Better yet, post a video of the problem if you can. It doesn't have to be great, as long as the problem is visible.
Title: Re: Surfans F20 "NAND open error"
Post by: Abscissa on August 09, 2022, 01:48:22 AM
I bought a Surfans F20 Player as well and I want to install the native port on it.
[...]
Is it save to proceed with the installation of the native port with the latest (v7) bootloader from this thread?
[...]
Flash info:
readID opcode  = FF C8 D1 C8
readID address = C8 D1 C8 D1
readID dummy   = D1 C8 D1 C8
[...]

This shows you have the GigaDevice flash (same as JosephM's) so yes it's safe to install with the v7 bootloader.

FWIW, it appears that I have the same one, too. (Also a v2.7 Surfans F20.)

In my case, I installed the v2.5-based hosted (not native) version of rockbox. (See my second post over here: https://forums.rockbox.org/index.php/topic,54280.msg250792.html ) Seems to work as expected for me. As expected, the line-out no longer works (in either rockbox or the original player), but other than that rockbox seems to work fine. That said, I HAVE been experiencing some occasional quirks, maybe bugs, here and there, but nothing that seems likely (IMHO) to be related to the minor hardware/software mismatch between v2.5 and v2.7 (more likely related to my large, chaotic song collection, and maybe my settings preferences, pushing some of rockbox's limits the wrong way). I *am* taking notes though, so that I can narrow them down and file any issues as appropriate.

NOTE: Everything that follows in the rest of this post is most likely ENTIRELY UNimportant! I'm only making note of it here just because I happen to find it interesting...

Ok, so, as I mentioned here ( https://forums.rockbox.org/index.php/topic,54280.0.html ), I did a diff between the bootloader image that was pre-installed on my device (backed up via jztool before I flashed ANYTHING), versus the bootloader image in the official (non-rockbox) v2.7 .upt update file.

I can post links to my actual backed-up pre-installed bootloader image, and/or the output of radiff2's comparison, if anyone happens to be interested (and if it's kosher here - I don't want to open up any potential "legality" cans-o-worms I might not know about)

I got hold of radiff2 and looked at the diff it gave me. The way it shows things isn't really how I'm accustomed to looking at differences, so fwiw, I just stuck with my usual tool, Beyond Compare, and did a hex comparison in that.

Not really knowing what in hell I'm looking at, but having been told that *some* differences are apparently expected, I'm sufficiently convinced (99%-ish) that my dump was succesful and without error. It seems mostly the same as the official distributed image, and there's a fair amount of pattern to the differences that do exist. It's these patterns in the differences that I find interesting (albiet, unlikely to actually be significantly important for rockbox, I would imagine).

The differences, FWIW:

- Whatever kind of header this uses had a couple of bytes different: At addresses 0x0009 and 0x000C. Header stuff, so probably no big alarm.

- After that, everything up through address 0x0900 is identical.

- Between addresses 0x0900 to 0x2C88, it's all peppered with occasional single-byte differences. But what's interesting is that the vast majority (all?) of the bytes which are different, have values that are EXACTLY +0x10 greater in my dump as compared to the "official". Seems likely a changed offset?

- In the 48 bytes from 0x2CA0 to 0x2CD0, there are several bytes different. Mostly very close to their alternate values, within a difference of about +/-6 for most of them. Maybe some kind of sub-header?

- Very shortly after that, my dump has the following 16 bytes *inserted* (in comparison to the official image) at address 0x2D08:

C8 51 00 00 18 00 00 00 C8 51 00 00 18 00 00 00

This insertion of 16 bytes in my dump (vs "official") would seem to (likely?) explain all the earlier, presumable "offset" values being EXACTLY 0x10 greater in my dump (vs "official"). Maybe those values were (either directly or indirectly) referencing things within the chunk that begins here.

- After that, there's some identical data, and then a block of all-0xFF on both images starting at 0x2FB4. But the all-0xFF block is longer on the "official" image. The last, roughly quarter, of this all-0xFF block in the "official" image is replaced in my dump with various data (Maybe about a third or so of them are zeroes, though.)

- Then there's a big block of identical data from addresses 0x4004 to about 0x6004.

- From 0x6004 to the end of my dump (at 0x1FFFF), the data is mostly identical, but peppered throughout with occasional single byte differences, and also some two-byte words that are different. But even these differences seem to have some patterns:

For the single-byte differences: These mostly (maybe entirely?) have the exact same low 4-bits between both versions. It seems to mainly be the upper 4-bits that are different. There might be further pattern to that too, but I'm not sure yet.

For the two-byte words that are different (these are notably less numerous than the single-byte differences, but there's still a lot of them): For the first byte of the pair (the byte with the lower address), the low (less-significant) 4-bits tend to match and the upper (more significant) 4-bytes tend to differ. For the second byte of the pair (the byte with the higher address), it's reversed: The high 4-bits tend to match, and the low 4-bits tend to differ.


Title: Re: Surfans F20 "NAND open error"
Post by: Ren on August 09, 2022, 03:39:35 PM
I don't know what the issue is, but if you try a few things it might help narrow things down:
  • Go into the bootloader menu (hold volume up when powering on) and boot Rockbox - see if the LCD flickers
  • Boot the original firmware from the bootloader menu - check if the LCD works
  • Boot the original firmware by holding PLAY when powering on
Also if you could explain what you mean by the screen "flickering" that would help. Can you see the Rockbox logo or menus? Do they look corrupted? Or do you see randomly colored "noise"? Better yet, post a video of the problem if you can. It doesn't have to be great, as long as the problem is visible.

I made 2 videos (https://mega.nz/folder/aKgCRDBJ#wk3aP5xb8gIRiHlPxxs8nQ) of the issue as requested. Maybe seeing it yourself says more than me making a lot of words trying to describe the flickering.

Greetings Ren
Title: Re: Surfans F20 "NAND open error"
Post by: Oscar on August 09, 2022, 04:54:21 PM
I made 2 videos (https://mega.nz/folder/aKgCRDBJ#wk3aP5xb8gIRiHlPxxs8nQ) of the issue as requested. Maybe seeing it yourself says more than me making a lot of words trying to describe the flickering.
Just a wild guess. Could it be, that you have installed the original "bootloader.erosq". When you install the bootloader from the Rockbox recovery menu (the bootloader which you have started with jztool), you will actually install the file "bootloader.erosq" from your SD-card. This file has as well to be the version 7 bootloader. So you have to copy the file "bootloader-v7.erosq" to the SD-card and rename it to "bootloader.erosq" before installing the bootloader. As said this is just a wild guess.
Title: Re: Surfans F20 "NAND open error"
Post by: Ren on August 09, 2022, 05:29:26 PM
I made 2 videos (https://mega.nz/folder/aKgCRDBJ#wk3aP5xb8gIRiHlPxxs8nQ) of the issue as requested. Maybe seeing it yourself says more than me making a lot of words trying to describe the flickering.
Just a wild guess. Could it be, that you have installed the original "bootloader.erosq". When you install the bootloader from the Rockbox recovery menu (the bootloader which you have started with jztool), you will actually install the file "bootloader.erosq" from your SD-card. This file has as well to be the version 7 bootloader. So you have to copy the file "bootloader-v7.erosq" to the SD-card and rename it to "bootloader.erosq" before installing the bootloader. As said this is just a wild guess.
Thanks, that was really a lucky wild guess! I thought the v7 bootloader would install the v7 when the player booted into it. I still had 3 different versions of the bootloader on the sd. I didn't expected that to be a problem.... But it turned out to be one. Thankfully the problem is resolved now!
Thanks again! :)
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on October 25, 2022, 10:06:23 AM
I hate to revive the thread, but I don't think that's the case. I got a new unit today with the 2.7 FW and it seems like it has yet another flash chip. [...]

Here's an updated bootloader (v7) (https://drive.google.com/file/d/1eRNxn0B_V36kNtH8oHJkmDKnuuxaZZJ2/view?usp=sharing) with support for the GD5F1GQ4xExxG. Upload a full dump (debug tools > dump entire flash, zip the resulting flash.img). Or check it yourself by comparing against uboot.bin in the OF image.

kaas, twotoneblue - could either of you provide another dump with the v7 bootloader to ensure it still works with the Winbond flash? I made a couple tweaks, which shouldn't have broken anything but it's a good idea to test again just in case. Thanks.
I just installed native rb using this bootloader (the same as currently in the wiki), the bootloader backup looked good (first few bytes are as you describe in your other posts, after that it is zeroed up to about 0x800 but I checked against the original firmware and it's the same there), then I booted rockbox successfully from the recovery menu, then installed, moved over all my settings/themes etc from the hosted port, and presto, works like a charm. Many many thanks Amachronic and everyone else who worked on this! :) It solved my main problem with the hosted port, namely that the device would hang for a few seconds when opening the file browser for the first time since booting, and dare I say that everything feels just a tad snappier?
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on October 31, 2022, 06:48:33 AM
I've made a new bootloader release which includes the changes in the "v7" bootloader. Now both old and new Surfans/Hifiwalker variants are supported by the same bootloader.

The new version is linked on the wiki, or download here (http://download.rockbox.org/bootloader/aigo/native/20221029-b4e7c60c6d/bootloader.erosq).
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on October 31, 2022, 08:53:12 AM
Getting a 404 on that link.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on October 31, 2022, 05:34:21 PM
Thanks, the links are fixed now.
Title: Re: Surfans F20 "NAND open error"
Post by: Richard42 on November 29, 2022, 03:34:11 PM
Hello all. I just bought a Surfans F20 on amazon and a 512GB sandisk ultra card to store my whole music collection to take on trips.  The default player is okay for me except I found that whenever I jump to another song it makes 2 very loud clicks in between the songs. That's not a very good feature for a "hi-fi" music player. I contacted Surfans tech support and they suggested it is a problem with the microsd card. I tested with the 32GB card that came with the player, and what do you know it doesn't make the clicks when switching between songs. So they're going to blame my 512GB card and say it's not compatible, but I'm a computer engineer and I understand that this card is really just uncovering some latent defect in their crappy software and it's not really incompatible.

So this is how I discovered RockBox. The OEM player says that it's version number is "2.3" which is interesting because this number is not mentioned anywhere in the RockBox documentation regarding the F20. I used the RockBox Utility software and tried to do a hosted installation, but the firmware update never worked. Each time I tried, it just switched between a black screen and the Surfans logo screen a couple of times and then booted back into the OEM player. I tried with the patched UPT files from the RockBox Utility program, and also with the unpatched UPT files for the F20 v2.2, v2.5, and v2.7 firmware files linked on the rockbox wiki, and none of them worked.

So then I went the native route. I can run the boot loader with the jztool program in USB boot mode, and I can run the rockbox software directly from the bootloader, so if I could flash the boot loader I think I would be good to go.  But whenever I try to make a backup of the OEM bootloader, I get the dreaded NAND open error.  Apparently the player that I bought has yet another different flash chip. Here is the output of the debug flash_info.txt that I get from the bootloader tool:

readID opcode  = FF E5 71 E5
readID address = E5 71 E5 71
readID dummy   = E5 71 E5 71
sfc params0  = 06 05 04 03
sfc params1  = 02 55 AA 55
sfc params2  = 00 44 02 02
sfc params3  = A4 2F 00 00


I tried the flash_onfi_info as well but that failed.  Can somebody help me get this working?
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on November 29, 2022, 05:47:04 PM
That's supposedly a Dosilicon DS35x1GAxxx. Test bootloader with support for it available here:
https://drive.google.com/drive/folders/1lxDGJD1XobsJtSd8Ajnh4MT8tXAJ8lpW

Try ONFI info & bootloader backup and post them here, I can sanity check them. If you're confident that it's working you can go ahead and do an install, but I'd advise taking a full flash dump beforehand (and make sure it looks reasonable...) in case things go wrong.

EDIT: I updated the wiki (https://www.rockbox.org/wiki/IngenicX1000) with some info on what the flash contents should look like. Should be helpful if you're inclined to check the dumps yourself.
Title: Re: Surfans F20 "NAND open error"
Post by: Richard42 on November 29, 2022, 07:23:48 PM
That is awesome, thank you very much.  It worked, I was able to get the flash dump (attached), and the flash_onfi_info:

signature = 03040506
revision = 5502
manufacturer = ""
device model = ""
JEDEC mf. id = 00
data bytes per page = 0
spare bytes per page = 0
pages per block = 0
blocks per lun = 0
number of luns = 0
bits per cell = 0
max bad blocks = 0
block endurance = 0
programs per page = 0
page program time = 0
block erase time = 0
page read time = 0


The dumped ROM looks reasonable to me.  From your description on the wiki, the SPL header looks good.  The partition table looks different from your example but it doesn't appear corrupted. I ought to be more familiar than I am with MIPS assembly language, as I've been working on this N64 emulator for many years (though not recently).  The reverse engineering that you and other RockBox devs have done with these little music players is really impressive.

Let me know if you agree that the dump looks good and I'll attempt to flash it with the boot room you gave above.
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on November 30, 2022, 06:33:38 PM
Looks good to me. Should be safe to flash that bootloader.

The ONFI dump didn't work but that's not a problem - it has no use except debugging.

The partition table looks like an expanded version that includes a list of supported flash chips. Maybe it's worth tracking them down and adding support ahead of time.
Title: Re: Surfans F20 "NAND open error"
Post by: Richard42 on December 01, 2022, 12:15:52 AM
Alright, I flashed the boot loader and it works! Thanks; you saved me from returning this player to Amazon. The RockBox player has no problems with the 512GB card and boots faster. This is a very cool project.
Title: Re: Surfans F20 "NAND open error"
Post by: kaas on January 12, 2023, 07:11:57 AM
Some bad news and some good: had to go back from the native port to the hosted because the native was unstable (it would regularly stop playing, display "unkwn artist" "unkwn track" instead of the correct file, and I think also corrupt files on the SD card (at least, after it had crashed on a file it would then likely crash again on that same file)). I was otherwise happy with the native port because it didn't have the issue I have with the hosted port, where loading the file browser for the first time after boot takes about 10 seconds (I think this is related to using a 80% full 512gb sd card).
So I did a clean install of the hosted port with the latest 2.7 pre-patched image from the wiki, and now line out works! Many thanks to all who worked on supporting the v2.7 players.
Title: Re: Surfans F20 "NAND open error"
Post by: Octso on November 30, 2023, 03:09:35 PM
Hey there, new owner of a Surfans F20 (fw 2.7). I am having the same issues that have been described here by other users previously, where I can't backup the bootloader during the native port install. Host port has been working fine, but I'd want to give the native port a go due to some issues in the host port with lastfm scrobbler and panic modes.

I am unable to create a flash_onfi_info dump, but the contents of flash_info are the following in case they can be of any help

Code: [Select]
readID opcode  = FF C9 51 C8
readID address = C8 51 C8 51
readID dummy   = C8 51 C8 51
sfc params0  = 06 05 04 03
sfc params1  = 02 55 AA 55
sfc params2  = 00 2B 02 02
sfc params3  = B4 2F 00 00

I was wondering if this is another instance of a device with a different chip. I have tried the bootloader in the wiki and all (if not most) of the bootloaders shared in this thread and I always get the NAND error during the bootloader backup...

Anyone got any pointers for how to get this working?
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on November 30, 2023, 04:58:00 PM
It's a new NAND device (GD5F1GQ5xExx). It's nearly identical to the GD5F1GQ4xExx which is already supported. Try this bootloader, you should be able to get a backup with it. Either check the backup with hexdump yourself, or post it here and I'll check it, just to make sure it looks sane before you go doing any destructive operations.

bootloader-erosq-GD5F1GQ5xExx.zip (https://drive.google.com/file/d/1S5HsTPbqPpBoyJExfhBcXRpEUkh86xGk/view?usp=sharing)
Title: Re: Surfans F20 "NAND open error"
Post by: Octso on November 30, 2023, 06:45:38 PM
It's a new NAND device (GD5F1GQ5xExx). It's nearly identical to the GD5F1GQ4xExx which is already supported. Try this bootloader, you should be able to get a backup with it. Either check the backup with hexdump yourself, or post it here and I'll check it, just to make sure it looks sane before you go doing any destructive operations.

bootloader-erosq-GD5F1GQ5xExx.zip (https://drive.google.com/file/d/1S5HsTPbqPpBoyJExfhBcXRpEUkh86xGk/view?usp=sharing)

Thank you for answering so swiftly!

I am now able to make the backup and get the flash_onfi_info dump, which looks identical to one in the previous page of this thread
Code: [Select]
signature = FFFFFFFF
revision = FFFF
manufacturer = "ÿÿÿÿÿÿÿÿÿÿÿÿ"
device model = "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"
JEDEC mf. id = FF
data bytes per page = 4294967295
spare bytes per page = 65535
pages per block = 4294967295
blocks per lun = 4294967295
number of luns = 255
bits per cell = 255
max bad blocks = 65535
block endurance = 65535
programs per page = 255
page program time = 65535
block erase time = 65535
page read time = 65535

I have checked the .bin hexdump and it does resemble what is mentioned in the Ingenic X1000 wiki, but if you could double check just to be sure, that would be amazing
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on December 01, 2023, 03:16:27 AM
It looks good to me, you should be safe to flash the Rockbox bootloader.
Title: Re: Surfans F20 "NAND open error"
Post by: mxl on December 17, 2023, 11:13:39 PM
Hey! Looks like I've got yet another different flash chip. Would someone be willing to help me?

Info: Surfans F20, firmware version 2.7. Using the provided bootloader (version 221029) with jztool succeeds but the flash is unreadable ("NAND open error"). Running RockBox without flashing the bootloader works fine.

Here's the flash_info.txt:

Code: [Select]
readID opcode  = FF C8 51 C8
readID address = C8 51 C8 51
readID dummy   = C8 51 C8 51
sfc params0  = 06 05 04 03
sfc params1  = 02 55 AA 55
sfc params2  = 00 2B 02 02
sfc params3  = B4 2F 00 00

This looks nearly identical to the result from #54 (https://forums.rockbox.org/index.php/topic,54228.msg253028.html#msg253028) except for the second byte in "readID opcode" so I went ahead and tried the GD5F1GQ5xExx bootloader. Indeed I can get the flash_onfi_info.txt from that:

Code: [Select]
signature = FFFFFFFF
revision = FFFF
manufacturer = "ÿÿÿÿÿÿÿÿÿÿÿÿ"
device model = "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"
JEDEC mf. id = FF
data bytes per page = 4294967295
spare bytes per page = 65535
pages per block = 4294967295
blocks per lun = 4294967295
number of luns = 255
bits per cell = 255
max bad blocks = 65535
block endurance = 65535
programs per page = 255
page program time = 65535
block erase time = 65535
page read time = 65535

And a dump of the bootloader is uploaded here: https://drive.google.com/file/d/1SJYx_1-k-rohSZB975wPYFB99gObhx-B/view?usp=sharing , does it look reasonable?
Title: Re: Surfans F20 "NAND open error"
Post by: amachronic on December 18, 2023, 06:08:39 AM
And a dump of the bootloader is uploaded here: https://drive.google.com/file/d/1SJYx_1-k-rohSZB975wPYFB99gObhx-B/view?usp=sharing , does it look reasonable?

Yep, it seems ok.
Title: Re: Surfans F20 "NAND open error"
Post by: mxl on December 18, 2023, 08:32:23 AM
Thanks for the quick reply :)