Atmel website | ARM Community | AVR freaks | Technical Support
Banner
 FAQ •  Search •  Register •  Login 

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: at91sam7x256-ek serial data flash access problems
PostPosted: Wed Mar 03, 2010 10:25 am 
Offline

Joined: Wed Feb 24, 2010 12:47 pm
Posts: 1
hi all,

Im developing with the AT91Sam7x256-ek and the GNU toolchain with SAMBA. I want to access the spi dataflash on the board.

At first i tried to adept the spi-flash example from the at91lib from AT26 to AT45 flash.

I can read the JEDEC Id successful, but when i want to write and read data (AT45D_Write, AT45D_Read), i dont get any valid results. Meaning if i write "Hello World" and try to read from the equal adress, i only get bytes like 0xFF. I know that most dataflashes contain FF in the erased state. Thats why i assume that the read works, but the write still causes problems.

After that i tried to go on myself using the periphals/spi functions to access the flash. But i didnt make it work so far.

Here is my initialisation: (i think its correct because i get the right JEDEC id)

static Pin pins[] = {BOARD_AT45_B_SPI_PINS, BOARD_AT45_B_NPCS_PIN};

unsigned int csr = (0x0F<<16) | (0x60<<8) | /* AT91C_SPI_NCPHA | */ AT91C_SPI_CPOL;

// Initialize the SPI and serial flash
PIO_Configure(pins, PIO_LISTSIZE(pins));

AIC_DisableIT(BOARD_AT45_B_SPI_ID);
AIC_ConfigureIT(BOARD_AT45_B_SPI_ID, AT91C_AIC_PRIOR_LOWEST, ISR_Spi);

SPID_Configure(&spid, BOARD_AT45_B_SPI_BASE, BOARD_AT45_B_SPI_ID);

SPID_ConfigureCS(&spid, BOARD_AT45_B_NPCS, csr );

AT45_Configure(&at45, &spid, BOARD_AT45_B_NPCS);

AIC_EnableIT(BOARD_AT45_B_SPI_ID);

jedecId = AT45D_GetStatus(&at45);

printf("SPI and AT45 drivers initialized\n\r");

if ( AT45_FindDevice(&at45, jedecId))
{
printf("%s serial flash(0x%x) detected\n\n\r", at45.pDesc->name, jedecId);
}
else
{
printf("No Device(0x%x) found!...\n\n\r",jedecId); while (1);
}

**************************************

My question is if anyone else has problems with the AT45D from the at91lib, or even better, a working solution ;).

I hope gave enough information.

Thanks in advance,

Sam


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: