Is it possible to read a file from FTP as blocks

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Is it possible to read a file from FTP as blocks

跳至解决方案
1,472 次查看
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

标签 (1)
0 项奖励
回复
1 解答
1,301 次查看
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 项奖励
回复
2 回复数
1,302 次查看
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 项奖励
回复
1,301 次查看
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 项奖励
回复