Wildcards, and SD to EEprom??
James Long
Posts: 1,181
I have two questions:
If I want to look for a portion of a file name, is it possible to use wild cards? I'm not sure how else to do it. Would it be a shift right maneuver? Since I'm looking for a file name, I would figure the string would need to be converted, then shifted.
For example: I know the file name will be update1_4.binary. But the number will change (you will understand after the next question). Can I look for update#_#.binary? or update*_*.binary?
Any ideas how to do it easier?
I now have a boot code that loads a binary to run (from an SD card, actually micro-SD), but I would like to make the system write the new code to the EEprom. I'm not sure of the steps to do it. I'm using the Femto routines (I guess the latest ones), for the boot code.
Both of these questions go together as you can imagine. If I want to update the code, I want the new binary to have a version (in the file name, to make it easy to distinguish), and the current loaded code to know if it should update the Eeprom or not. I have included the version number in the constants for logic comparison upon the next update.
I really have progressed with my programming the last three days. I'm much better (I think), but the objects floating around are out of this world. I hope to one day be able to give back to those of whom I'm hacking at their code. (Believe me it isn't pretty, but I will clean it up after it all works).
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services
If I want to look for a portion of a file name, is it possible to use wild cards? I'm not sure how else to do it. Would it be a shift right maneuver? Since I'm looking for a file name, I would figure the string would need to be converted, then shifted.
For example: I know the file name will be update1_4.binary. But the number will change (you will understand after the next question). Can I look for update#_#.binary? or update*_*.binary?
Any ideas how to do it easier?
I now have a boot code that loads a binary to run (from an SD card, actually micro-SD), but I would like to make the system write the new code to the EEprom. I'm not sure of the steps to do it. I'm using the Femto routines (I guess the latest ones), for the boot code.
Both of these questions go together as you can imagine. If I want to update the code, I want the new binary to have a version (in the file name, to make it easy to distinguish), and the current loaded code to know if it should update the Eeprom or not. I have included the version number in the constants for logic comparison upon the next update.
I really have progressed with my programming the last three days. I'm much better (I think), but the objects floating around are out of this world. I hope to one day be able to give back to those of whom I'm hacking at their code. (Believe me it isn't pretty, but I will clean it up after it all works).
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services
Comments
But in your case if you have the new number as constants, then just build a string from this numbers and load this file:
VERS_L and VERS_H are the constants, the name can only have 8 characters + 3 for the extension.
you can then read all the longs from the sd card and write it to the EEPROM, then initate a reboot.
Andy
That is the problem Andy. The running code will not know the next code revision. It will only know the current version.
But I guess a string compare would work. If the new file name is higher (version number will always go up), then load the file, write the eeprom, and reboot.
Very interesting.
I'll have to try a few things,
James L
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services