[En-Nut-Discussion] What is my error ??

rutger eng1 at breematic.nl
Sat Oct 30 19:48:41 CEST 2010


Hello Remi,

I think you must use UFlashFormat before (trying) to attach

kind reards,

Rutger


Op 30-10-2010 0:28, Remi Bilodeau schreef:
> Maybe some configuration (nutconf) I don't understand, help me if you can, I
> continue to search for solution. The chip is AT45DB161 on SPI of a
> AT91SAM7S256 and CS is 0 (hardware NPCS0 on PA11)
>
> This code work:
>
>      /* 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",(unsigned int)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);
> };
>
>
> This code don't work:
>      if (UFlashAttach(&devUFlash0,&flashAt45dib0,&spiBus0At91)) {
>          puts("Attaching serial flash failed, formating...");
> if(UFlashFormat(&devUFlash0,&flashAt45dib0,&spiBus0At91)) puts("Format
> fail.");
>      } else puts("Attaching serial flash: OK!");
>
>      if (NutRegisterDevice(&devUFlash0, 0, 0)) {
>          puts("Mounting UFLASH0 failed");
>      } else {
>          puts("Mounting UFLASH0: OK!");
>      }
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>
>
>
> Geen virus gevonden in het binnenkomende-bericht.
> Gecontroleerd door AVG - www.avg.com
> Versie: 9.0.864 / Virusdatabase: 271.1.1/3225 - datum van uitgifte: 10/28/10 20:34:00
>




More information about the En-Nut-Discussion mailing list