Author Topic: file system  (Read 9151 times)

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
file system
« on: June 04, 2008, 05:43:16 PM »
Hi Mark,
  I am about to use an Atmel SPI memory chip for remote program updates. I plan to keep aside the 256KB (for future plans), and use the rest. Is it possible to have a file system that starts after the 256 KB?  I also plan to have a second Atmel SPI chip, and is it possible to have the second chip (full 1MB) file system too?

Thanks
Neil

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: file system
« Reply #1 on: June 05, 2008, 11:33:53 PM »
Hi Neil

Yes, if you specify the start of the file system at an address corresponding to the end of FLASH plus 256k bytes it will be possible to reserve 256k for firmware uploads. This is however not addressable in the file system and requires 'forcing' the firmware upload to be written here. (Once you are ready to do this we can discuss it per Skype - it is not difficult but may require a slight adjustment somewhere).

If you have then 1.75Meg left (assuming 2 x 1Meg chips) you can specify its length accordingly. Since there are up to 62 addressable files (assuming you are using the uFileSystem) it is probably appropriate to set up the file granularity to 32k for max. 56 files.
Alternatively a 16k granularity will give 62 files, where the last can be up to 816k in length.

A final thought would be to simply declare the entire 2M content as file system with 32k file granularity.
The last file ('z') will have 86k size. You could then use 56 files in the file system for normal file use and the rest for SW uploads (I think file 't' - 278k  maximum size). This allows you to still use the file upload space for files (bearing in mind that they will however be lost when a firmware upload is performed, but can be reloaded afterwards...) This will then avoid having to specify a hole that can not be accessed via standard file system calls.

Regards

Mark

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
Re: file system
« Reply #2 on: June 06, 2008, 11:25:18 AM »
Hi Mark,
  Thanks for the reply.

At the moment, I am about to try the bootloader sequence using the external memory, then onto file systems. At this point I will go through the details on Skype  with yourself, which is greatly appreciated,thanks.

Our project will be using GPRS modules to communicate, through serial port. There will be times when we wish to upload new firmware remotely, and was thinking of simply sending the new code using our own protocol, in chunks of 264 bytes, then saving to relevant pages in external memory. After all pages sent, then simply remotely force a processor reset, which in turn will load in new code to processor. Will this work okay? And is it possible to use encryption this way?

Regards
Neil


Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: file system
« Reply #3 on: June 06, 2008, 03:59:06 PM »
Hi Neil

As long as the new code is positioned at the correct location (corresponding to boot loader setting) and in the correct format (again corresponding to the boot loader setting - including encrypton if required) it doesn't matter how it gets there. Therefore your method is certainly possible.

Regards

Mark