RCM4000 brdInit() and FTP_FAT conflict


I am trying to write a simple program with a RCM4000 and Dynamic C 10.60, which takes a number of samples using the A/D converter and stores them on the soldered nand flash device. At the same time, the program runs an FTP server through which users can access all the files stored in the nand flash device with FAT filesystem.

The program is mainly divided into three parts:

A) It samples the analog input and stores the samples in a buffer

B) Stores the buffer in nand flash using FAT (blocking mode)

C) FTP server which shows the contents of the nand flash device.

The all work correctly when the execute alone. A and B work correctly together. B also works with C just fine. Even if I run A and B together, I can access the files through FTP running C alone.

Now, after running the brdInit() for being able to use the A/D converter at the same time I am running the FTP server, the fat_write() returns the EBADBLOCK (307) error. This does not happen if I am not running the server (i.e just storing the samples in the nand flash device using FAT filesystem).

I hope I was clear enough. Any advice would be great!

Thank you for your time.

I´ve found the problem!! Rookie mistake, as I imagined.

The problem was that I called brdInit() after initializing the FTP sspec instead of doing it before.

I do not know the exact reason why the prototyping board must be initialize before the FTP sspecs. I can just say it works now!!