VS1005G – VSOS driver for Nand flash K9F1G08U0E

Discussion about writing software for VS1005 and the VSOS Operating System. Also posts about VS1005-related hardware design and device drivers should be posted here.
Post Reply
sfatt
User
Posts: 2
Joined: Mon 2018-09-10 14:33

VS1005G – VSOS driver for Nand flash K9F1G08U0E

Post by sfatt » Mon 2018-09-10 14:58

Hello.

I need to use vs1005g with nand flash K9F1G08U0E and I did the following steps:

1. I edited the file startextflash.nan in vs1005g-firmware-preparations.zip:
a) changed byte 5 to 0x01 (NandFlash type == 1)
b) changed byte 7 to 0x12 (FlashSizeBits 2^18*512 = 128 MiB)
c) changed byte 9 to 0x53 (NandWaitNs = 100)
and executed script initnand.bat.

2. I adapted k9f4g driver for K9F1G08U0E:
a) NF_TOTAL_ERASE_BLOCKS == 1024
b) NF_ERASEBLOCKS == 940
c) NF_RESERVED_AREA_START == 960

3. I ran an adapted driver for my flash and got message "Failed. Maybe you need to low level format the nand flash.” This message is issued every time I run my driver.
When I tried to format the flash in the VSOS, I received a lot of messages "META ERR SSN xxx”.

==========================================

I reduced the driver code to a small test, which illustrates the problem (it is in the attachment):
a) The test shows that reading with the Read function immediately after erasing is working correctly. And reading with the Read function immediately after writing Write generates an error (it returns 0 and buffer contains incorrect values).
b) If I use LongPageRead/LongPageWrite functions, it work correct with the same sequence of actions.


My questions:

1. When I run the test (or adapted driver), I get information about my flash (data from sector 0):
Nand ph:
Eraseblocks: 1024
Eraseblock size: 256
Page size: 256
Nand type: 1
Nand waitns: 100

Here I see that PageSize == 256, although Nand type = 1 and the page size should be 1024 words.


2. Why does not the Read/Write functions work correctly, but does the LargePageRead/LargePageWrite functions works as it should?
Attachments
k9f1g.zip
(34.66 KiB) Downloaded 9 times

User avatar
Panu
VLSI Staff
Posts: 2585
Joined: Tue 2010-06-22 13:43

Re: VS1005G – VSOS driver for Nand flash K9F1G08U0E

Post by Panu » Tue 2018-09-11 14:53

Hi!

NandType must be 3. Otherwise it looks like it might work! But who knows... :)

-Panu
Info: Line In and Line Out, VS1000 User interface, Overlay howto, Latest VSIDE, MCU Howto, Youtube
Panu-Kristian Poiksalo, VLSI Solution Oy

sfatt
User
Posts: 2
Joined: Mon 2018-09-10 14:33

Re: VS1005G – VSOS driver for Nand flash K9F1G08U0E

Post by sfatt » Tue 2018-09-11 15:32

Thank you for the answer

Choosing the type of flash I followed the datasheet of VS1005g (vs1005ds.pdf).
It says (part 10.2) that the NandType should be 1 for the 2048+64 B large-page flash with 2-byte block address (≤ 128 MiB).

I also tried my test for the NandType 3 and got all the same.

Post Reply