u-boot on M5329evb

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

u-boot on M5329evb

1,436 Views
cfernandez
Contributor I

Hi everyone, 

 

Some time ago I had NAND problems on u-boot over my M5329 freescale EVB. We solve it using the last u-boot (U-Boot 2008.10) compiling it with an M5329BFEE_config.

I though everything was going well, but some problems have appeared now. When I try to write on NAND device blocks of 512 bytes (the nand is and 16KiB pages of 512 bytes) everything seems OK, any error message.

But when I try to read the block, an error (-74) occurs in any block except the first one I've written on. If I take a look on the information written on every page I can see that ONLY the first page I wrote is written correctly. The other pages have wrong information inside them.

It doesn't matter if I write every page separately or in bigger blocks. U-boot only write correctly the first page that I attempt to write. Until I erase the whole memory.

Anybody knows anything about it? Could be my Flash memory chip be broken? I don't thing so, because I can manage it correctly from ucLinux.

Labels (1)
0 Kudos
3 Replies

403 Views
cfernandez
Contributor I

For further information I'm still workin on It with no results:

 

 U-boot reads and writes from NAND but only ONCE.
The problem appears when I write from other origin than the first one. Then, when I try to read form NAND I've got an -74 error, and this error still appears until NAND is erased.

For example if I execute

->nand write 30000 0 200

NAND write: device 0 offset 0x0, size 0x200
 512 bytes written: OK

NAND read: device 0 offset 0x0, size 0x200
 512 bytes read: OK

->nand write 30000 200 200

NAND write: device 0 offset 0x200, size 0x200
 512 bytes written: OK

NAND read: device 0 offset 0x200, size 0x200
 512 bytes read: OK


You can see that there's no problem but the original address is the same in both instructions. But If I chanche this address:

->nand write 30000 0 200

NAND write: device 0 offset 0x0, size 0x200
 512 bytes written: OK

NAND read: device 0 offset 0x0, size 0x200
 512 bytes read: OK

->nand write 30400 200 200

NAND write: device 0 offset 0x200, size 0x200
 512 bytes written: OK

NAND read from offset 200 failed -74
 0 bytes read: ERROR

It's the same If I do the second writting on any address, trying the 0 addres or also over the erasing block (every 0x4000) with no result. I've been taking a look at the source code, but just befor the "write byte to memory" instruction every data is correct. And after "read byte from memory" this bytes are wrong!

I thougth that NAND was broken but managing it from uClinux I can create a jffs2 file system, write and read without any problem.

I would appreciate any help.

Thanks in advance.

0 Kudos

403 Views
J2MEJediMaster
Specialist I

I have checked with an engineer here and the BSP documentation indicates the Linux supports NAND memory (which is what you are seeing). However, it does not specify that U-boot supports this memory type. The BSP does not support what you are trying to do with U-boot. Sorry.

 

---Tom

 

Message Edited by J2MEJediMaster on 2009-02-24 10:43 AM
0 Kudos

403 Views
cfernandez
Contributor I

Problem solved. For anyone who can have this problem: The acces time to nand have to be increased for a better access ( nand->chip_delay = 60:smileywink:.

 

An changing the GPIO flags will do.

 

static void nand_hwcontrol()
{
...
        ulong IO_ADDR_W = (ulong) this->IO_ADDR_W;
 
        IO_ADDR_W &= ~(SET_CLE | SET_ALE);
 
        if (ctrl & NAND_NCE)
            *nCE &= 0xFFFB;
        else
            *nCE |= 0x0004;

 

0 Kudos