Author Topic: Parameter Storage  (Read 9540 times)

Offline Pursuit20

  • Newbie
  • *
  • Posts: 11
    • View Profile
Parameter Storage
« on: September 14, 2008, 06:19:03 PM »
Hi,
I am needing to setup the project to store 1K of parameters but do not need to use the file system.  It looks like they are one in the same.  Is this is true?  What values do I need to change in order to set this up so my code space is maximized and my parameters can be stored in internal flash at the very end.

Thanks,

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Parameter Storage
« Reply #1 on: September 14, 2008, 08:58:58 PM »
Hi

The file system and parameter system have been very connected due to the fact that the parameter system needs some of the same routines as the file system uses. There is however a very new service pack for the Coldfire where this has been changed:

- firstly the parameter system doesn't have to be a part of the file system and so can occupy an area in memory separate from the file system.
- secondly the file system can be disabled, but the necessary routines as required by the parameter system are still supplied.

You could therefore look at the SP8 to see whether it is suitable. You can disable FLASH_FILE_SYSTEM and keep USE_PARAMETER_BLOCK active.
The parameter block is then set to the end of FLASH:
#define PARAMETER_BLOCK_START 0x3f000 (see app_hw_m5223x.h).

Note that the FLASH has a granularity of 2k and this is for swap block support and so it is 4k from the end of the 256k FLASH boundary (assuming 256K FLASH device).


You may also be able to do much the same with your present version by defining the file system size to be 0 (FILE_SYSTEM_SIZE), which will still link in all routines but not actually occupy space. The file system can then also be set to the desired location since the parameter blocks are automatically at the start of the file system in that version.

Regards

Mark

PS. SP8 is available at: http://www.utasker.com/software/softwareV1.3.html

Offline Pursuit20

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Parameter Storage
« Reply #2 on: September 14, 2008, 09:11:50 PM »
Thanks for the quick response. So if I remain with SP7, It should work as long as I set the FILE_SYSTEM_SIZE to 0 and the start address to 0x3f000.  Is that right?  There is no PARAMETER_BLOCK_START in SP7?

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: Parameter Storage
« Reply #3 on: September 14, 2008, 09:41:40 PM »
Hi

I just check in a little more detail concerning SP7.

I think that the following setup should work:

#define uFILE_START 0x3f000 // this sets the parameter start address
#define FILE_SYSTEM_SIZE (2*SINGLE_FILE_SIZE) // this is the file system size INCLUDING parameter blocks, so zero is not absolutely correct (4k in this case entirely for the parameter system).

Regards

Mark

Offline Pursuit20

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Parameter Storage
« Reply #4 on: September 14, 2008, 09:42:52 PM »
Thanks, I will give it a try.