Is it possible to read a file from FTP as blocks

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

Is it possible to read a file from FTP as blocks

Jump to solution
746 Views
sumishgeorgeche
Contributor II

I wanted to read a file from ftp. Currently it fetches the whole file from ftp and then stores it in RAM and then write it to the flash memory. I wanted to try reading a particular number of bytes of the file at a time store it in the RAM then write it to the flash, continue this action till the whole file is read. I'm using codewarrior MCF54416

Labels (1)
0 Kudos
1 Solution
575 Views
scottm
Senior Contributor II

Sure you can.  How hard it is to get there from here depends on what protocol stack you're using and how much control it gives you.

For starters, it's going to be easier to do if the flash memory you're writing to isn't the flash memory you're executing code from.  I've had an MCF51JM128 update itself via USB (including the USB stack) with no intermediate storage to work with and it was not fun.

Are you running an RTOS?  Which one?  What FTP implementation are you using?  Worst case, you can write your own FTP client, but that's probably a little excessive.

If you're using an RTOS it might be easier to approach it from the file system side.  Your RTOS might already have a suitable driver, but you could make one that writes directly to flash and use that as the destination for the FTP client.

Scott

View solution in original post

0 Kudos
2 Replies
576 Views
scottm
Senior Contributor II

Sure you can.  How hard it is to get there from here depends on what protocol stack you're using and how much control it gives you.

For starters, it's going to be easier to do if the flash memory you're writing to isn't the flash memory you're executing code from.  I've had an MCF51JM128 update itself via USB (including the USB stack) with no intermediate storage to work with and it was not fun.

Are you running an RTOS?  Which one?  What FTP implementation are you using?  Worst case, you can write your own FTP client, but that's probably a little excessive.

If you're using an RTOS it might be easier to approach it from the file system side.  Your RTOS might already have a suitable driver, but you could make one that writes directly to flash and use that as the destination for the FTP client.

Scott

0 Kudos
575 Views
Carlos_Mendoza
NXP Employee
NXP Employee

Hi George,

is this question related to this other thread?

I am using codewarrior MCF54416. How can I write a file read from FTP directly into the flash memory...

Thanks in advance!

Best Regards,

Carlos Mendoza

Technical Support Engineer

0 Kudos