Problem with FTPServer

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with FTPServer

782 Views
raulmoneo
Contributor II

Hi,

I'm working with a Kinetis K70F120M and I'm having problems with the FTPserver on the SDcard.

I call the function FTPd_init("FTP_server", 7, 5000 );

I can connect, list the files of the directory and even Delete files, but I'm not able to download (RETR) any file.

I have 3 tasks more working, Webserver, SDcard and one more for analog inputs and outputs that runs each 3,5ms with priority 8.

If I don't launch the analog I/O task, The FTP server download the files. I've set FTPserver priority to 7 but It don't solve the problem.

const TASK_TEMPLATE_STRUCT  MQX_template_list[] =

{

   /* Task Index,    Function,    Stack,  Priority, Name,       Attributes,           Param,  Time Slice */

    { INIT_TASK,        init_tasks,   2000,   8,      "Init",          MQX_AUTO_START_TASK,  0,      0 },

    { WEB_SERVER_TASK,  init_web_task,  7000,   10,   "Init_Webserver",  0,       0,      15 },

    { SDCARD_TASK,    sdcard_task,    2500,   9,     "SDcard",    0,       0,   10 },

    { ANALOG_TASK,  Algoritm_Task,  3000L,  8L,   "Analog task", MQX_FLOATING_POINT_TASK, 0,  5 },

    { HWTIMER_TASK,   hwtimer_task,  1500,   9,    "hwtimer",    0,       0,      2 },

    { 0 }

};

  I'd appreaciate any thought or idea.

Thanks in advance.

Raúl

0 Kudos
2 Replies

529 Views
santiago_gonzal
NXP Employee
NXP Employee

Hello Raul,

Have you checked that you don't run out of memory in the FTP Server when you launch also the Analog task?

Regards,

Santiago

0 Kudos

529 Views
mjbcswitzerland
Specialist V

Hi Raul

I have attached a SW package from the uTasker project for the TWR-K70F120M.

- uTaskerV1.4.8_TWR-K70F120M.bin is a binary that can be loaded to the tower kit (with TWR-SER)

- uTaskerV1-4.8_TWR-K70F120M.exe is a (approx.) real-time simulation of the K70 and the TWR board (doesn't need to be installed - just double click on the .exe file) and will run the same code.

In case of requirements for low memory footprint you may be impressed by its speed and size.

I set it up for SD card operation (supports FAT16/FAT32 with LFN write support using Linux copyright workaround), a web server, FTP server (both use the SD card if available - create a web server directory called "dir1" with a start page index.htm for it to work with it). FTP has full SD card access.

If the SD card is not present it works with an internal file system in spare Flash and also includes a parameter system for configuration etc..

In addition, it has a few other things like Telnet, IGMP, SNMPv1/v2c, IPv4 and IPv6 and USB (the SD card can also be used via USB as USB-MSD).

On Telnet or UART is a command line shell with many further operations.

It occupies about 110k Flash and uses about 30k SRAM but allows many parallel web server connections.

The simulator allows the same things to be tested (it requires WinPCap to be installed to emulate Ethernet) so the complete Ethernet, TCP/IP operation can be tested in real-time.

It emulates internal Flash and also SD cards and allows USB enumeration to be verified so you can work with real data which will be saved to the storage media. On first use of the simulation the NIC to be used needs to be setup in the LAN menu (this is saved so only needs to be set once).

All operation (peripherals, interrupts, DMA are being emulated) and it also supports ADCs.

In case you hit limits with your existing platform this alternative may help improve resource efficiency and generally allow faster development. It operates out-of-the-box on most KE, KL and K processors (and most Freescale boards) and can be build with CW, KDS, IAR, Keil, Atollic, Rowley, CooCox, standalone GCC and VisualStudio.

Below is a screen shot of the simulator running this setup.

Rtegards

Mark

http://www.utasker.com/kinetis.html

pastedImage_0.png

0 Kudos