-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SD EEPROM: Create eeprom.dat if not found on SD #14824
SD EEPROM: Create eeprom.dat if not found on SD #14824
Conversation
I didn't have any problems with the root directory thing we discussed, but I found there was no eeprom.dat created automatically if it wasnt present |
seems weird to me, we never had to create it manually... |
I didn't either, until the recent builds. I can't figure out why, but 3am me probably was missing something in one of the revisions. It was repeatable for me however, I do think this PR is required. |
I now guess I wonder if adding O_CREAT permission to the initial open would make it return a success....... |
I dont see why that could help to store junk and return true |
Because if no file is found, the PersistentStore::access_start() aborts the save eeprom process - the same as if no card was detected, so the PersistentStore::access_finish() is never reached, and so the correct file is never created. But I wonder if adding O_CREAT permission to the initial file.open would achieve the same result. Regardless, I'm just sharing my findings after people informed me that they had problems, and I diagnosed the cause. Not sure what the best way to patch this bug is. |
format the sdcard imo, seems an hardware to me |
Tried multiple sd cards, formatted, with files or completely blank, multiple printers, checked write switch etc etc. Repeatable. |
so you are saying the eeprom data is reloaded before save ? cant be... |
hmm maybe it is... need to read the shared ocde |
I'm not claiming to be able to write C++ code well any better than I can claim to speak french, but I can at least read some of it :-P |
i dont see any abort on access_start failure.. just a serial message warning |
oh i see it now: |
commit fdbc733 |
but its not the right solution.. this commit... you dont have to create the file to fix that... just need to return true |
rmm im currently testing the flash eeprom PR, and maybe my issue is the same one... :p
|
Ahhhh, that was the breaking commit! That makes sense now. |
tagging #14776 |
yep, sorry i made tests recently but was before this change... and i was confused about your issue |
I appreciate that you're looking into flash eeprom, would be even nicer to have that working too. |
not won for now, the PR didnt work on any of my 2 different boards.. (skrmini/longer3D) else the sd fix to appy: tpruvot@b97409d |
|
@trouch not sure I understand your comment in relation to this PR I think that simply returning true is the wrong solution as if there is another failure to open the file we do want it to return false. |
see the other implementations, they return most true by default... doing nothing on start. and the write may return false in case of write problem anyway |
Fair enough - I guess there’s no need for it to be in an if statement at all then if we don’t care about the returned value being false? |
Variant of the PR MarlinFirmware#14824, required since the PR MarlinFirmware#14776 (31 july) the typo is only seen with DEBUG_EEPROM_READWRITE
The version I downloaded in July. Don't create eeprom. Dat file. |
@yangwenxiong - if you do the top change at this link it should work: |
For the MCU of STM32F103xx series, it is necessary to build a file EEPROM.DAT in SD card in advance to simulate EEPROM data storage in SD card.Otherwise it's not gonna work and you're going to have a problem with it, |
#define EEPROM_START() int eeprom_index = EEPROM_OFFSET; persistentStore.access_start() |
You don’t need to do that. You do need to change the file containing the access_start() |
This one can be closed now.. (you can delete the branch pinchies:fix-sd-no-file-eeprom @pinchies to do it) |
I don’t see the issue fixed yet? |
commit 92c35d1 |
fix for SD as eeprom - create file if no eeprom.dat file found.