2018-03-24 07:27 AM
my register set around 0xa0000080 was below
and fmc clock was enable
but i still couldn't reset nand flash and read a error nand id as below
my reset nand code as below
#define READ_ID 0x90 #define NAND_RESET 0xFF #define NAND_READSTA 0x70 #define NAND_READY 0x40 static unsigned char reset_stm32nand(void) { volatile unsigned char data = 0; int ret = 0; debug(''iysheng nand reseting\n''); *(volatile unsigned char *)(0x80000000 | 1 << 16) = NAND_RESET; do { ret++; *(volatile unsigned char *)(0x80000000 | 1 << 16) = NAND_READSTA; udelay(100); data = *(volatile unsigned char *)(0x80000000); } while((data != NAND_READY) && (ret < 0x1ffff)); return data; }
and my dts file relate fmc nand control pin as below
what's wrong maybe happen???besides these point,is there sth i couldn't get attention cause the problem???
Solved! Go to Solution.
2018-03-25 08:29 AM
After I compare my code with some others code,I found it's maybe i didn't set mpu config relate nand flash (address 0x80000000:256Mbytes).And after i add mpu config code,then it maybe right now.my mpu config as below
now i could get nand id right,
thanks for
Turvey.Clive.002
2018-03-24 07:40 AM
NAND acts more like a mass storage device than a random access memory, so dumping content is not going to be a good plan. There are only a handful of address pins connected to the NAND device, you are basically reading out of a FIFO, every read to the memory range returns a different value from the array.
If you wanted to dump out a sector you'd need to memcpy() the whole thing in one step to a buffer, and then dump the buffer.
2018-03-25 08:29 AM
After I compare my code with some others code,I found it's maybe i didn't set mpu config relate nand flash (address 0x80000000:256Mbytes).And after i add mpu config code,then it maybe right now.my mpu config as below
now i could get nand id right,
thanks for
Turvey.Clive.002