View Single Post
  #541 (permalink)  
Old 22nd Apr 2010, 1:10 pm
sig11 sig11 is offline
Junior Member
 
Join Date: Sep 2009
Posts: 31
Default

Quote:
Originally Posted by flasher86 View Post
oh maan. It works now!! It can access SDCard while being executed from flash! If only we had access to flash memory we could even transfer files between these two drives.

Also, it runs so much faster if run from flash! Awesome, you re good. Maybe you have some ideas about flash memory then?
I tried. I can read pages from the flash, but I do not know structure of the flash drive ( numeration of sectors , begin of the FAT , e.t.c).

This function is reading page from flash ( I have hy27uu08ag5m , but it is the common command for all NAND-flash ):

void readPage(unsigned int col,unsigned long row)
{
int i;
write_mem(FLASH0_CMD,0x0);
write_mem(FLASH0_ADDR,col & 0xFF);
write_mem(FLASH0_ADDR,(col >> 8) & 0x0F);
write_mem(FLASH0_ADDR,row & 0xFF );
write_mem(FLASH0_ADDR,(row >> 8) & 0xFF);
write_mem(FLASH0_ADDR,(row >> 16) & 0x03);
write_mem(FLASH0_CMD,0x30);
printf("\n");
for ( i = 0; i < 2112; i++ ) {
buff[i] = read_mem(FLASH0_DATA);
}
}

The first page that I have read from flash was a part of firmare with some offset.

Last edited by sig11; 23rd Apr 2010 at 1:42 am.
Reply With Quote