Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 2 of 2

Thread: Question re: Teensy LC Flash emulation

  1. #1
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,398

    Question re: Teensy LC Flash emulation

    HI everyone,

    It's been a while... all related to current politics having a significant impact in work life. Anyhow, so while the logger is currently in suspended animation re: development, I have been pushing forward on occasion with other developments, the most recent is the humidifier upgrade.

    As you may recall, I use a Teensy LC in that application because of it's 5V switchable output (pin 17?). That's helpful for a light strip in the ductwork that announces the state of the humidifier to anyone passing by and peering into the return duct from above.

    A diagnostic I implemented is storing variables like uptime, runtime, etc. by zone in the simulated flash memory. Since some of these variables are int32_t's, I use the EEPROMEx library (http://playground.arduino.cc/Code/EEPROMex) to store the stuff since it saves me from having to convert long variables into bytes and back again. But, I seem to have a runtime problem that is vexing me. Specifically, even though I keep track of how many times the EEPROM write function has been called (once an hour), the flash writes only appear to be successful half of the time. For example, last night, the display indicated 7 updates but when I cut the power and rebooted the device, the counter count in flash seemed to be stuck at update #4. The flash write counter is only advanced when the write function is called, so there is no way that the update program was not called.

    So here is my question to the team: Has anyone else used EEPROMEx on a Teensy LC and found it to be unreliable?

    I guess my next step should be to read the flash after each write and see if the update worked, rinse-repeat write 5 times if it didn't?
    Last edited by Constantin; 01-27-2017 at 02:05 PM.

  2. #2
    Senior Member Constantin's Avatar
    Join Date
    Nov 2012
    Location
    In the yard with a 17' Dia. Ferris Wheel
    Posts
    1,398

    Foolish I am... again.

    Looks like I omitted the apparently all-important memBase integer... which for some reason does not have a default value (like zero?) in the library. Once memBase was set, the program works as intended. The program currently updates the EEPROM once an hour, so I'll be hopefully good for about 20-30 years (the system is only on during winter). I suppose I could increase the time interval between updates until it exceeds my expected lifetime...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •