Author Topic: uTasker FileSystem with FTP  (Read 6252 times)

Offline frank

  • Jr. Member
  • **
  • Posts: 51
    • View Profile
uTasker FileSystem with FTP
« on: October 31, 2012, 01:00:02 PM »
Hi,

I have MCF52232 based custom board with STM25P16 SPI flash. 

In one of my earlier attempt, I built the uTasker v1.4.0 image with Codesourcery GNU tool chain.  The board was successfully brought-up with this image. Once it is done, I tried to upgrade newer image ( which was built using same codesourcery, with the size of 85KB), the upgrade never happened.

During my investigation, I tried to upload the HS.BIN image via FTP. I would expect this image will occupy location "H" and "I". in the file system. When I tried to get the FTP image using "GET" command of ftp, I can fetch only 64K of the image.

ftp> put H_Upload_Enc.bin
200 OK.
150 Data.
226 OK.
ftp: 88506 bytes sent in 0.35Seconds 252.15Kbytes/sec.
ftp> get H.BIN
200 OK.
150 Data.
226 OK.
ftp: 65531 bytes received in 0.18Seconds 362.05Kbytes/sec.

Could you please help me to understand this problem, why I couldn't fetch the entire file ?. I believe the bootloader is failed to load the entire file from the uTasker file system into the internal flash ( location 0x1000).

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: uTasker FileSystem with FTP
« Reply #1 on: October 31, 2012, 01:56:51 PM »
Hi Frank

Look at the size of the file that was saved, using DIR. I expect that it also shows as size of 65531. This is 64k minus the file header.
Such an effect is caused by the file system being smaller than the size of the file to be saved there (or there not being enough space available for a file from its save location to the end of the file system). What happens in this case is that the file is truncated; as much as possible is saved but the rest is lost and the file size then reflects the reduced content size that remains.

This means that you will presumably need to increase the file system size or post the file to a file location which starts at a lower address (dependig on the present dimensions and characteristics set). If you presently have 64k file sectors and post to 'H', it looks as though 'H' is the final sector and 'I' doesn't exist. If you post to 'G' instead there should be 128k place and so it should be OK.

Regards

Mark