SAM7SE-EK NAND Flash Not Working

Discussion about SAM7 Series and ARM7TDMI based products.

Moderator: nferre

Alec
Posts: 8
Joined: Thu Jan 10, 2013 11:00 pm

SAM7SE-EK NAND Flash Not Working

Thu Jun 06, 2013 11:10 pm

Has anyone gotten the NAND flash on the SAM7SE-EK to work? When I run the "Basic NAND Flash" project in the software package found on this site's SAM7SE product page, it freezes trying to execute the RawNandFlash_Reset(...) function. Stepping through the function I discovered that it has to do with the WRITE_COMMAND16(...) macro that is used by it. It seems that it casts the "command address" value for the flash from an integer into a pointer, then dereferences it and stores a value where it points. My conclusion is that the address in the "command address" field is incorrect, although I have no way of testing that due to minor technical difficulties. If anyone has gotten this to work, how? If not, any ideas?
mjbcswitzerland
Contact:
Location: Switzerland
Posts: 132
Joined: Thu Mar 02, 2006 1:32 pm

Re: SAM7SE-EK NAND Flash Not Working

Fri Jun 07, 2013 2:18 pm

Hi

I wrote a NAND Flash driver with FAT and level wear for this device and the EK. It was several years ago now though so I don't remember if there were problems with any reference code at the time.

The work is documented here: [url]www.utasker.com/docs/uTasker/uTasker_NAND.pdf[/url] and is included in the uTasker project for SAM7. It allows the SAM7 and NAND Flash to be simulated which also simplifies project developments and is completely free for non-commercial work. Latest versions available at [url]www.utasker.com/forum/index.php?topic=1476.0[/url]

Regards

Mark

[url]www.uTasker.com[/url]
Alec
Posts: 8
Joined: Thu Jan 10, 2013 11:00 pm

Re: SAM7SE-EK NAND Flash Not Working

Fri Jun 07, 2013 7:12 pm

Thanks, I just sent in a request for the password to the files. Will this be able to read individual bits/blocks from the NAND flash without tying them to a file system? I don't actually need a file system, all I need to do is store about 1MB of arbitrary bits to the flash, then have the SAM7 read them and transfer them into another external chip. Also, while I wait for the password, how does the demo binary work? There's one for the SAM7X-EK (I assume 'X' is a stand-in for S or SE) that is programmed using SAM-BA, but I don't get any output over the COM port.
mjbcswitzerland
Contact:
Location: Switzerland
Posts: 132
Joined: Thu Mar 02, 2006 1:32 pm

Re: SAM7SE-EK NAND Flash Not Working

Fri Jun 07, 2013 7:54 pm

Hi

The file NAND_driver.h contains the interface to the NAND flash - it is for the SAM7SE with K9F5608U0D-P in 8 bit mode and you may need to make some changes for different parts.
The functions in the file are mostly "static" functions, used normally by the FAT layer but by making these "extern" they can also be called directly.

Note however that NAND flash can not always be used as simple linear memory due to the fact that devices are often delivered with bad blocks - that means that the manufacturer tested the chips and guaranty a certain number of functional blocks while marking blocks that fail accordingly.
With use, and over the NAND flash life time, blocks will fail (that is, bit errors accumulate and can no longer be corrected using ECC techniques) and the block then has to be marked as bad and data moved to a new one.
At some point the number of bad blocks will reach a limit value where the chips has reached its 'end-of-life'. Level-wear techniques are used to maximise this life time by not reusing the same block but by distributing block use across the physical area.
Due to blocks failing it is not really possible to store data in an area of contiguous blocks since the development of a bad block (or one that was already there when the chip was delivered) would mean that there would be a "hole" in the data.
Even when using the storage without FAT you should really have a layer of block management that handles the mapping of physical blocks to virual blocks as seen by the user. This is what makes NAND Flash a bit tricker to use - you get a lot of memory for little money but it is of 'low quality' and SW help needs to be used to make its use reliable.

The binary files with SAM7X are for the SAM7X devices [with Ethernet controller] and these binaries can not run on SAM7SE devices.

Regards

Mark
Alec
Posts: 8
Joined: Thu Jan 10, 2013 11:00 pm

Re: SAM7SE-EK NAND Flash Not Working

Fri Jun 07, 2013 8:36 pm

Oh, I see. That makes sense...especially since my project would cause acceleration in the rate at which errors occur. If I transfer 1MB of data into the flash using SAM-BA, would it skip the bad blocks or would it just put data into them? Judging from the interface, I fear it's the latter, but I could be wrong.
nikdaf
Posts: 2
Joined: Mon May 11, 2015 6:39 pm

Re: SAM7SE-EK NAND Flash Not Working

Thu Apr 14, 2016 5:48 pm

Hi,

I tried accessing the Flash the same way OP did and ran into exactly the same problem. Program gets stuck at the WRITE_COMMAND16(...) macro.

Did you eventually find a reason why the example program did not work?
Or did you follow the approach of mjbcswitzerland?

Regards,
nikdaf

Return to “SAM7 ARM7TDMI MCU”

Who is online

Users browsing this forum: No registered users and 1 guest