Author Topic: backup data using the simulator  (Read 9114 times)

Offline lthyagar

  • Newbie
  • *
  • Posts: 21
    • View Profile
backup data using the simulator
« on: October 14, 2009, 03:22:04 AM »
Hello Mark, Can I use the simulator to backup realtime data? For e.g. If have data logging application monitoring different parameters ( I have written an app that simulates this), how can I use the
simulator to save data?
Thanks!!
Lav

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: backup data using the simulator
« Reply #1 on: October 14, 2009, 12:34:32 PM »
Hi Lav

Since the simulator is in fact a 'normal' program running under Windows it can also be used to save data to the hard drive (using file commands).
Note that the simulator is, for example, logging all transmitted serial data (if the configuration is set for this).

In the code region where you would like to save data you can use the #ifdef _WINDOWS conditional define to embed code to open files and save data, etc. This will then not appear in any target code, so the same project can still be cross-compiler for the final hardware.

Regards

Mark


Offline lthyagar

  • Newbie
  • *
  • Posts: 21
    • View Profile
Re: backup data using the simulator
« Reply #2 on: October 14, 2009, 04:16:28 PM »
Hello Mark,  can I save the data using the ufile system to  memory using the simulator?
Thanks!!
Lav

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: backup data using the simulator
« Reply #3 on: October 14, 2009, 08:07:12 PM »
Hi Lav

Yes, this will then be the same as a target hardware. When the simulator is close it saves all internal (and SPI FLASH) memory to a file called
FLASH_XXXXX.ini (where XXXX is the processor type) and any SPI FLASH to STM25PXXX.ini (for example). This is in binary and will be read back in on the next start.

You can of course use the content outside of the simulator for other purposes or also retrieve it via FTP, HTTP etc. when the simulator is running.

Regards

Mark