RCM3365 : Copy NAND Flash to XD


In my application I want to duplicate all the data stored in the soldered NAND flash memory to the socketed XD card, but the nf_writePage() function to write the XD card returns an error ( -3 ,bad block). When I run the nflash_inspect sample program provided by Rabbit, the XD card writes & reads just fine.

My code is quite simple, and I thought it would be enough to do the trick, but alas.

                 nf_readPage(&nandFlash,myMainBuffer,k);  // read page k from NAND to xmem

                 status=nf_writePage(&xdkaart,myMainBuffer,k); //write page k from xmem to XD

Is there any information that I have missed regarding the two memory modules?