[En-Nut-Discussion] Bug in beta 4.9.9 and uder (nut/dev/at45db.c)

Remi Bilodeau remi.bilodeau at gmail.com
Fri Oct 29 20:55:47 CEST 2010


Cannot use AT45DB161 dataflash  with AT91SAM7S256....

VERSION: Nut/OS Veta 4.9.9
FILE: nut/dev/at45db.c
LINE:  373

This line:
#if defined(MCU_AT91SAM7X) || defined(MCU_AT91SAM7SE) ||
defined(MCU_AT91SAM9260) || defined(MCU_AT91SAM9XE)

Must be replaced by this:
#if defined(MCU_AT91SAM7S) || defined(MCU_AT91SAM7X) ||
defined(MCU_AT91SAM7SE) || defined(MCU_AT91SAM9260) ||
defined(MCU_AT91SAM9XE)


Cannot use AT45 flash with a AT91SAM7S256 without this modification.

Here my test code:
    /* INITIALIZE DATAFLASH */
    if ((at45db = At45dbInit(SPI0_BASE, 0)) == -1) {
     puts("Dataflash init FAIL.");

    } else {
     printf("Dataflash init OK.\n");
printf("Page size is %u bytes\n",At45dbPageSize(at45db));
printf("Page number: %u\n",At45dbPages(at45db));
    }

while(1) {
if(At45dbPageRead(at45db, 0, Buf, At45dbPageSize(at45db))) printf("Error
reading page 0\n"); else printf("Succesfully read page 0.\n");
        NutSleep(125);
};

Please add this mod to next release (or beta)

Thank!



More information about the En-Nut-Discussion mailing list