Shop OBEX P1 Docs P2 Docs Learn Events
Retrieving files from eeprom??? Possible? — Parallax Forums

Retrieving files from eeprom??? Possible?

RforbesRforbes Posts: 281
edited 2012-12-19 10:36 in Propeller 1
Hello all!

Is it possible to read the eeprom with the propeller tool to get the spin files off of it?

For some reason, almost every object in my latest project just became corrupted and renamed. This happened a couple of weeks ago too, so I started using a new SD card. But it happened again a couple minutes ago and now my application is trashed. Well, not totally trashed because I have archives... but I just spent a considerable amount of time coding in between archives.

Also, is anyone else experiencing this? My files get a bunch of junk in them like the examples below:
2ŽXÔÄpPÜÅ+"a  pۂ©*á;^ÀYÈ ä.Z,ÇWpÈÁ<Æ]ñ„=«J÷ a¥”ˆ´‰¸¤ÜðžJ$Ðâ¼/Ø8Óæ4ne!jHz´gÎ?Á1¼bZ+Î~jN*<F–7‰qŪ&"èÐFÙ
H˜žn   ÷ôÎñMZM<d{Cz—bB<bۚ•bŒ…tïТ´>y©3íœb=;$žEÆ´bZËYbh™–Õ™2®ÿHÝgRGcŠÓmžAlhàV!&^r%%¾<ªÚ£<‚¦Þ5<¼=jkwºfaå_UäUŠúŠVûýy½ÑGÃ7t×pøªr%ÌcæÄ>ÜFNìAøó‰VG_—?螓Ž&jgDλ¤»ÈµF¶Þ¬C>é
@3çÑè6w}Ñ =8Aæ#\Ñ&'iΫV5$1ŒQöì—T×éòXíëVjûI.¯ó³]ò'b£D´Ug£]çœø³-Ðg6V{Á$dPòÚ¢us²`¢Öd¥ãîK2["iô–È\½“Œí·¢8beèÚ»–PƒdPân|ä¶*gŽØܗÇ^‡òȑžó"yø°“ÃìѧHÉ#§õQŸ‚-¤/*zº›d²°GÏQGÎɳÜÖDßu

This was about 1020 lines of code before this incident.

And another odd one:
PUB Start : okay 

'PUB StartINDIRECT(_databit0, _addr0, _addr1, _cs, _rd, _wr, _reset, _sen) : okay

''  Initializes the I/O and registers based on parameters.
''  After initilization another cog is started which is the
''  cog responsible for the Indirect/parallel communication to the W5100.
''
''  The W5100 Indirect/parallel cog will allow only one instance of itself
''  to run and the it consumes only 1 cog.
''
''  params:  the seven pins of required for indirect/parallel
''           _databit0 is the pin for bit0, the other pins are assumed to be sequential following this pin.
''           _sen = the pin of the W5100 SPI_EN.  If not used, set to -1
''  return:  value of cog if started or zero if not started

  'Keeps from two cogs running
  StopINDIRECT

  '-------------------------------------------------------------
  ' Mike Gebhard
  ' This guy is one long above the PASM entry point
  ' It points to the a HUB ram block that holds socket
  ' state and memory lock.
  '------------------------------------------------------------- 
  statusSemId :=  locknew 
  statePointer := @statusSemId

  'Initialize the I/O for writing the mask data to the memory area that will be copied into a COG.
  'This routine assumes Indirect/parallel connection, SPI_EN will be made output low by the ASM cog
  ADD0mask  := |< _addr0
  ADD1mask  := |< _addr1
  CSmask    := |< _cs
  RDmask    := |< _rd
  WRmask    := |< _wr
  RESETmask := |< _reset

  BASEpin   := _databit0                                'The base pin of data byte for shifting operations
  DATAmask  := %1111_1111 << _databit0                  'Special mask setup with ei&#31611;&#12045;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12079;&#12045;&#8239;&#13139;&#13109;&#12345;&#8257;&#25938;&#27745;&#21536;&#28009;&#8293;&#27715;&#25455;&#8299;&#28229;&#26983;&#25966;&#12045;&#3375;&#12079;&#16672;&#29813;&#28520;&#14962;&#19232;&#24951;&#25954;&#24942;&#22304;*&#26433;&#25977;&#24941;&#3438;&#12079;&#21792;&#25712;&#29793;&#25701;›&#12083;&#13106;&#12847;&#12592;&#3377;&#12079;&#17440;&#29541;&#26473;&#25966;&#8292;&#28486;&#14962;&#20512;&#22584;&#12851;&#3393;&#12079;&#22048;&#29285;&#26995;&#28271;›&#11825;&#3376;&#12079;&#12045;&#8239;&#28483;&#31088;&#26994;&#26727;&#8308;&#25384;&#8233;&#12338;&#12593;&#19232;&#24951;&#25954;&#24942;&#22304;*
&#26433;&#25977;&#24941;&#3438;&#12079;&#21280;&#25957;&#25888;&#25710;&#28448;&#8294;&#26982;&#25964;&#26144;&#29295;&#29728;&#29285;

This is what happened to the W5100_Indirect_Driver.


Any thoughts/advice would REALLY be appreciated here! (slinking off to weep for a few minutes. hehe)

Thanks in advance,
Robert

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-12-18 18:22
    Are you using SD cards as your main storage? If so make sure you use good ones but even then it's not a good idea to continually edit files that are stored on SD cards. They are great for cameras or anything where you are not editing the same file over and over, they have limited erase and write cycles, even if it is hidden.

    BTW, there are no Spin files on the EEPROM, only the compiled binary.
  • RforbesRforbes Posts: 281
    edited 2012-12-18 18:26
    Peter- Yes, I am... or WAS using SD card from main storage. Ok, I'll stop doing that immediately. Is a thumb drive / flash drive better? I am mobile, going between different computers a lot.
    So, the compiled binary... I have no idea what to do with that. :) Was worth asking about I guess.
  • mindrobotsmindrobots Posts: 6,506
    edited 2012-12-18 18:33
    Are you mobile with Internet access? I've been tossing code files up to Dropbox lately for a couple projects. I your 'net connection is quick enough, you can even edit in place.
  • TubularTubular Posts: 4,703
    edited 2012-12-18 18:43
    It sounds like the fault is on the PC, but I thought I'd post this here for others that may be searching...

    There is a utility distributed for the Defcon badges that can read (rip) an image from the eeprom using the propellent utility. There are minimal docs included in the zip file, but it works fine. It expects a 5MHz xtal. Search for BadgeUtil.Zip, on github or elsewhere
  • RforbesRforbes Posts: 281
    edited 2012-12-18 18:50
    mindrobots - Man, unfortunately I live so far out in the woods we pipe in sunlight and use pigeons for cell service. My internet connection is my tethered blackberry. I'm working from home and at the office, and up until now it's been pretty convenient to just slap everything on an SD card and go. I guess I need to change my routine up somehow.

    Tubular- thanks. I'll look at that. Would it allow me to get everything back in order? I am definitely not skilled enough to look at 8 bazzillion 0's and 1's and say "oh yeah, THERE'S my junk! Lemme rename that to blahblah.spin and I'm good to go." :)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2012-12-18 18:55
    By all means backup to SD or any other Flash memory such as USB memory sticks and copy that onto whatever you are working on and so forth. I think you would be doing extremely well if you could decompile the binary back into source (including the comments) but it's way easier to edit source in the first place :)
  • lardomlardom Posts: 1,659
    edited 2012-12-19 07:03
    I use flash drives but I also have two back-up harddrives. One does automatic backup. I learned my lesson when my PC crashed and I lost several years of work. The files were retrieved after the repair place worked on it for three days.
  • Don MDon M Posts: 1,652
    edited 2012-12-19 07:07
    Tubular wrote: »
    There is a utility distributed for the Defcon badges that can read (rip) an image from the eeprom using the propellent utility. There are minimal docs included in the zip file, but it works fine. It expects a 5MHz xtal. Search for BadgeUtil.Zip, on github or elsewhere

    I was playing around with this a bit.. I wonder why would you use the PropHexWriter.exe to write the eeprom file when you can just use Propellent to do the same thing?
  • prof_brainoprof_braino Posts: 4,313
    edited 2012-12-19 08:01
    Are you using SD cards as your main storage? If so make sure you use good ones but even then it's not a good idea to continually edit files that are stored on SD cards. They are great for cameras or anything where you are not editing the same file over and over, they have limited erase and write cycles, even if it is hidden.

    Peter, did you run a test that demonstrated this? For example, write the same value to every byte in a block and read it back, and then increment the value, and repeat until you detect a failure? I thought we did this when we implemented SD in propforth, but it was in development and I don't have that test. Anyway, I thought the test ran with no errors until we needed the hardware for something else. Also, the test automation we use constantly writes to EEPROM and SD, and we've never seen an error with hardware failing.

    I have some old SD's I could sacrifice if you can share your torture test.
  • Dave HeinDave Hein Posts: 6,347
    edited 2012-12-19 08:24
    Some SD cards do wear leveling, and others don't. It's safer to assume that your SD card doesn't do wear leveling, and avoid writing to the same sector more than 100,000 times. If you write to the same sector less than 25 times per day the SD card should be usable for at least 10 years.

    It's more likely that the card was corrupted because it hadn't updated all of the sectors that needed to be written before it lost power or was reset.

    EDIT: I was working on a program to disassemble a binary file back into Spin. I never completed it, but it does generate Spin bytecode mnenomics, and they are grouped together so that you can determine where a Spin statement should be. I think I got it to a point where it did generate a few Spin statements. Read the contents from the EEPROM and save it to a file, and I can run my disassembler on it if you're interested.
  • potatoheadpotatohead Posts: 10,261
    edited 2012-12-19 10:36
    Hmmm... tethered blackberry.

    Seems to me, an e-mail account would make for a great cloud storage. Maybe try that. You can keep the data transfer requirements lean enough to be viable on the blackberry. Source isn't generally that large for Propeller.

    A few Kb / sec is all you need to backup to e-mail, and you get version history!
Sign In or Register to comment.