|
Post by jj0 on Feb 14, 2020 7:08:19 GMT
Is there anyone here with a Mini with a Toshiba NAND? I'm looking for a full raw dump of the NAND. You can get it with this nand_rw binary: Check if the NAND ID is 0x98 0xDA 0x90 0x15 0x76 # nand_rw 50 2176 read_id Raw ID data: 0x98 0xDA 0x90 0x15 0x76 Dump the NAND to a USB stick mounted at /mnt: # nand_rw 50 2176 read_full 0 131072 /mnt/c64mini-toshiba-nand.bin Ignore the page size etc displayed by nand_rw, determining that only works for some NAND's. Please also tell me if you have the EU or US Mini. And for those that are interested, here's the source. I didn't write this myself but found it on the web for Raspberry Pi and modified it a bit to work on the A20 BTW, you'd best do this from FEL mode, or at least with 'the64' killed. Thanks!
|
|
|
Post by spannernick on Feb 15, 2020 2:10:40 GMT
It from V1.0 of the Mini with the silver sticker,mine is EU,I do it for you later.
|
|
|
Post by darbyram on Feb 15, 2020 2:32:35 GMT
It from V1.0 of the Mini with the silver sticker,mine is EU,I do it for you later. The nand on my mini has been used and abused so no use to anyone. but intrigued to why jj0 wants it?
|
|
|
Post by jj0 on Feb 15, 2020 7:11:51 GMT
It from V1.0 of the Mini with the silver sticker,mine is EU,I do it for you later. The nand on my mini has been used and abused so no use to anyone. but intrigued to why jj0 wants it? Thanks in advance spannernick! darbyram, when I started out exploring the Mini I managed to semi-brick mine with an experimental u-boot that overwrote some areas of the nand, destroying the partition table. So the mini still boots into uboot but then can't find the nanda. To restore this part I need a copy of a working, same chip nand. So even your used and abused nand copy would still be useful. Especially if it is an US version as then I can also experiment with turning an EU version into an US version and vice versa.
|
|
|
Post by spannernick on Feb 15, 2020 21:19:19 GMT
what the line to mount the USB...I can't remember it..?? I am using C64 Mini FEL Mode..?
|
|
|
Post by spannernick on Feb 15, 2020 22:01:31 GMT
This will only work using UART and I can't do that on my first one..? UART don't work on it, I can only use C64 Mini FEL Mode or X Windows Mode..?
|
|
|
Post by jj0 on Feb 15, 2020 22:20:47 GMT
This will only work using uart and I can't do that on my first one..? I can only use C64 Mini FEL Mode or X Windows Mode..? It should work fine in FEL mode. To mount the USB do: mount /dev/sda1 /mnt Thanks!
|
|
|
Post by spannernick on Feb 15, 2020 22:38:46 GMT
I copied nand_rw to the bin folder so I can run it and getting a Segmentation fault when ii run nand_rw 50 2176 read_full 0 131072 /mnt/c64mini-toshiba-nand.bin..?
|
|
|
Post by jj0 on Feb 16, 2020 10:45:09 GMT
I copied nand_rw to the bin folder so I can run it and getting a Segmentation fault when ii run nand_rw 50 2176 read_full 0 131072 /mnt/c64mini-toshiba-nand.bin..? Weird. This is the classic 'It works for me' problem. Can you try with the attached version: nand_rw (461.47 KB) Thanks for trying.
|
|
|
Post by spannernick on Feb 16, 2020 12:56:15 GMT
its it coming up with "Illegal instruction" now..?
Would it be possible for you to test it with THEC64 Fel Mode and maybe put the file in the bin folder,I copy it to it using FTP. maybe thats why it don't work..? I don't know how to copy it to the bin folder by shell..??
Maybe I am running it in the wrong place,maybe run it on the USB...??
nandb is mounted could that be why,I got it to automount by the script on mnt2..?
|
|
|
Post by jj0 on Feb 16, 2020 15:08:33 GMT
I copy it to it using FTP. maybe thats why it don't work..? I don't know how to copy it to the bin folder by shell..?? Maybe I am running it in the wrong place,maybe run it on the USB...?? If you copy it using FTP, did set FTP to 'binary'? Otherwise it will garble the file. But easiest is to puit it on the USB driver and then unmount the nand (just to be sure) and run nand_rw from USB: root@c64mini (192.168.0.23):~# umount/mnt2 root@c64mini (192.168.0.23):~# /mnt/nand_rw 50 2176 read_full 0 131072 /mnt/c64mini-toshiba-nand.bin
|
|
|
Post by spannernick on Feb 16, 2020 15:20:22 GMT
Got it working it reading the nand now... i had to... This is like nanddump,nandwrite..? this is reading the page blocks off the nand. (I have a old device that uses a MTD nand from 2004, it's called a Amstrad E3 Superphone E-Mailer,I tried copying its nand with nanddump and tried to copy it back with nandwrite but it will not boot. If anyone is wondering it's this.. It uses Montavista Linux,it runs Linux in the background so it works the same way as THEC64 but you could use it as a house phone and send Emails and texts plus connect to the internet via dial up, It only worked in the UK. It could play ZX Spectrum games to via a emulator too, you can get something like it now but it has Android on it. The Amstrad E3 was the first house phone that could make video calls. These are collector items now,Sky TV who took over Amstrad, close the Amserve service down in 2011,there loads of them on eBay now. It just interesting what companies did with Linux and arm cpu's, it has a Text Instrument Arm CPU build in,the nand is only 32 mb.
|
|
|
Post by jj0 on Feb 16, 2020 16:03:32 GMT
Got it working it reading the nand now... i had to... This is like nanddump,nandwrite..? this is reading the page blocks off the nand. (I have a old device that uses a MTD nand from 2004, it's called a Amstrad E3 Superphone E-Mailer.I tried copying its nand with nanddump and tried to copy it back with nandwrite but it will not boot. If anyone is wondering its this.. I originally looked for ways to read the nand using a x360 clip and a Raspberry Pi, inspired by this post. Then I dug more into the Allwinner A20 stuff and adapted the nand_id from that post to use the A20 gpio so I didn't have to do it with the adapter anymore. The for writing I discovered that someone had already adapted the program so I used that and added A20 gpio support again. As it uses direct gpio access to the NAND chip it's different from nadddump/nandwrite as they require/use the MTD device which is not supported/available on Thec64. On your Amstrad E3 you probably have /dev/mtd*.
|
|
|
Post by spannernick on Feb 16, 2020 16:38:12 GMT
yep there's 5 of them MTD0,1,2,3,4,5.. Amstrad made their own firmware and used their own bootloader called PBL Primary Boot Loader, it has NOR Flash Chip too.. Here is some info of it... I did a big write up about the Emailer and even contacted the guy that made it for Amstrad Cliff Lawson.. I made a forum for it to store any data on the emailer.You might find it a interesting read.. amstrad-e3-hacking.freeforums.net/thread/15/amstrad-iler-mailerHow they put a Linux Shell on the Amstrad E3... www.earth.li/~noodles/hardware-e3.html
|
|
|
Post by spannernick on Feb 16, 2020 16:54:42 GMT
Right.. back on topic .. Here is the file you needed from my Toshiba nand, I hope it fixes your C64 Mini... Let me know,any help you ever need and I can,I be there.. Download Here
|
|
|
Post by jj0 on Feb 16, 2020 19:08:19 GMT
Right.. back on topic .. Here is the file you needed from my Toshiba nand, I hope it fixes your C64 Mini... Let me know,any help you ever need and I can,I be there.. Download HereThanks! I appreciate it. I hope it fixes my mini too!
|
|
|
Post by jj0 on Feb 17, 2020 14:24:06 GMT
Right.. back on topic .. Here is the file you needed from my Toshiba nand, I hope it fixes your C64 Mini... Let me know,any help you ever need and I can,I be there.. Download HereThanks! I appreciate it. I hope it fixes my mini too! Hmmm. No luck. Now it only boots via FEL. Oh well, it was worth a try...
|
|
|
Post by spannernick on Feb 17, 2020 22:35:47 GMT
Dam... It sounds like the same problem as I had with the Amstrad E3... Does Uboot come up..? Can't you get it to boot from USB instead and put the FW on the USB..??, couldn't you use nanda and nandb from the mini,I have them backed up from V2 if you need them, I backed them up before changing the games on the carousel. If you need V1.0 I can back them up using Fel Mode..? If you managed to put the FW on a Orange PI you can do anything, you have nothing to lose, you could use it as a test machine but I do know what's it like when things don't go the way you want them too.. I don't know if you could boot from the USB just a idea,it would be interesting.. You have The C64 Maxi now and thats way better, but not really potable.. oh I am enjoying THEC64 Frankcanmaxi btw..HAHA
|
|
|
Post by jj0 on Feb 18, 2020 6:38:55 GMT
Dam... It sounds like the same problem as I had with the Amstrad E3... Does Uboot come up..? Can't you get it to boot from USB instead and put the FW on the USB..??, couldn't you use nanda and nandb from the mini,I have them backed up from V2 if you need them, I backed them up before changing the games on the carousel. If you need V1.0 I can back them up using Fel Mode..? If you managed to put the FW on a Orange PI you can do anything, you have nothing to lose, you could use it as a test machine but I do know what's it like when things don't go the way you want them too.. I don't know if you could boot from the USB just a idea,it would be interesting.. You have The C64 Maxi now and thats way better, but not really potable.. oh I am enjoying THEC64 Frankcanmaxi btw..HAHA Thanks. I'm OK with it, I can still use it to experiment with it via FEL mode so it's not the end of the world. Just a bit mysterious on why this wouldn't work.
|
|
|
Post by spannernick on Feb 18, 2020 10:27:39 GMT
Does the nand get bad blocks and OOB data or is that just with a mtd nand only..? When it was copying the nand I did notice read error and nand rw says its retrying to read a page or block so maybe that why it didn't work.it was doing it at the beginning of reading of the nand blocks,I try and copy it again today so you can see the output, it might help diagnose it. How does the nand work in TheC64 Mini,it is split..? I thought it was just nanda and nandb device(in dev folder)is Uboot in nanda..? I guess Uboot is not working too..? that why it's a good idea to have 2 flash chips like Amstrad did with the E3, Nor Flash and Nand Flash,Nor flash has the bootloader on it so you can't go over it.When they put Linux on the Amstrad E3 they put Uboot on the Nand so it has 2 bootloaders,anyway.. This might help someone who has the same problem. Now I have THEC64 Maxi,I don't use THEC64 Mini anymore and I have 2 of them. Oh look your on Manic Miner... HAHA..
|
|
|
Post by jj0 on Feb 18, 2020 12:39:03 GMT
Does the nand get bad blocks and OOB data or is that just with a mtd nand only..? When it was copying the nand I did notice read error and nand rw says its retrying to read a page or block so maybe that why it didn't work.it was doing it at the beginning of reading of the nand blocks,I try and copy it again today so you can see the output, it might help diagnose it. How does the nand work in TheC64 Mini,it is split..? I thought it was just nanda and nandb device(in dev folder)is Uboot in nanda..? I guess Uboot is not working too..? that why it's a good idea to have 2 flash chips like Amstrad did with the E3, Nor Flash and Nand Flash,Nor flash has the bootloader on it so you can't go over it.When they put Linux on the Amstrad E3 they put Uboot on the Nand so it has 2 bootloaders,anyway.. This might help someone who has the same problem. Now I have THEC64 Maxi,I don't use THEC64 Mini anymore and I have 2 of them. Oh look your on Manic Miner... HAHA.. All nand can get bad blocks and has OOB data to store data to check this. The read errors you've seen probably don't matter unless it says it failed. So I don't need a new copy, thanks. The nand on TheC64 is divided into two areas: - The 1st area which is the bootloader part. This is where the SoC loads 'boot0' from which in turn loads uboot from that area, though 'older' implementations load boot1 which then loads uboot from a FAT16 partition in the 2nd. You cannot access this 1st area of the nand from TheC64 as the nand.ko driver doesn't expose it a s a device (e.g. /dev/nand). So you can't back it up/restore it other than by direct access to the nand chip which is what I tried to do. Other A20 / H3 linux distributions do expose /dev/nand, but those nand.ko's do not support the specific nand chips in TheC64.
- The 2nd area, the data partitions part. This has a partition table (Alwinner-specific MBR) and one or more partitions that are each exposed by the nand.ko driver as /dev/nanda, /dev/nandb, ... Each partition can contain an actual filesystem, like /dev/nandb on TheC64 does, or other data, like /dev/nanda on TheC64 which has the kernal image
My next step might be to use a newer kernel that allows to use the nand as an mtd device to recreate the partitions. Manic Miner rules!
|
|
|
Post by spannernick on Feb 18, 2020 19:27:50 GMT
Funny thing is, it looks like the Amstrad E3 is using the same Nand, it's made by Toshiba too but 14 years before the THEC64 Mini was made. Look at the bottom left corner of the Amstrad E3 board.. its similar TOSHIBA J30388 / TAIWAN 03349AD / TC58DVM82A1FT00 32M x 8bits 3volt NAND Flash Memory, just found the pdf for that Nand elinux.org/images/a/ab/Tc58dvm82a1ft.pdf
|
|
|
Post by jj0 on Feb 18, 2020 19:51:55 GMT
Funny thing is, it looks like the Amstrad E3 is using the same Nand, it's made by Toshiba too but 14 years before the THEC64 Mini was made. Look at the bottom left corner of the Amstrad E3 board.. its similar TOSHIBA J30388 / TAIWAN 03349AD / TC58DVM82A1FT00 32M x 8bits 3volt NAND Flash Memory, just found the pdf for that Nand elinux.org/images/a/ab/Tc58dvm82a1ft.pdf Ah yes. Similar but not the same, only 32MB.
|
|
|
Post by spannernick on Feb 18, 2020 20:03:47 GMT
|
|
|
Post by jj0 on Feb 27, 2020 21:08:32 GMT
Thanks! I appreciate it. I hope it fixes my mini too! Hmmm. No luck. Now it only boots via FEL. Oh well, it was worth a try... Just a brief follow-up. Using a current 2020 uboot with nand support enabled I was able to restore my Toshiba nand to a point where it would boot into uboot. But it still didn't see any nanda / nandb partitions. After a few more experiments I think I now have too many bad blocks in the area where it loads uboot from as it's now stuck in BOOT0. But I guess the nand_rw write routine is not functioning correctly as writing the same file via the new uboot did work. So don't use nand_rw for writing to nand....
|
|
|
Post by jj0 on Mar 3, 2020 17:51:57 GMT
Hmmm. No luck. Now it only boots via FEL. Oh well, it was worth a try... Just a brief follow-up. Using a current 2020 uboot with nand support enabled I was able to restore my Toshiba nand to a point where it would boot into uboot. But it still didn't see any nanda / nandb partitions. After a few more experiments I think I now have too many bad blocks in the area where it loads uboot from as it's now stuck in BOOT0. But I guess the nand_rw write routine is not functioning correctly as writing the same file via the new uboot did work. So don't use nand_rw for writing to nand.... Yes I know I'm mostly talking to myself here... But I've managed to restore my Mini back to normal operation thanks to spannernick. I'm a bit embarrassed to say that in using the nand_rw I thought it combined erasing and writing in a single step, but instead I needed to erase first and then write back the image: root@c64mini (10.0.0.111):/mnt#./nand_rw 50 2176 erase_blocks 0 2048 <lots of output> root@c64mini (10.0.0.111):/mnt#./nand_rw 50 2176 write_full 0 131072 /media/c64mini-toshiba-nand-Spannernick.bin <lots of output>
So I now have a fully functioning 'Spannernick special' C64Mini back
|
|
|
Post by spannernick on Mar 4, 2020 19:20:33 GMT
Just a brief follow-up. Using a current 2020 uboot with nand support enabled I was able to restore my Toshiba nand to a point where it would boot into uboot. But it still didn't see any nanda / nandb partitions. After a few more experiments I think I now have too many bad blocks in the area where it loads uboot from as it's now stuck in BOOT0. But I guess the nand_rw write routine is not functioning correctly as writing the same file via the new uboot did work. So don't use nand_rw for writing to nand.... Yes I know I'm mostly talking to myself here... But I've managed to restore my Mini back to normal operation thanks to spannernick. I'm a bit embarrassed to say that in using the nand_rw I thought it combined erasing and writing in a single step, but instead I needed to erase first and then write back the image: root@c64mini (10.0.0.111):/mnt#./nand_rw 50 2176 erase_blocks 0 2048 <lots of output> root@c64mini (10.0.0.111):/mnt#./nand_rw 50 2176 write_full 0 131072 /media/c64mini-toshiba-nand-Spannernick.bin <lots of output>
So I now have a fully functioning 'Spannernick special' C64Mini back No I am still watching this in the background.. Glad you got it working..
|
|