Skip to content
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

[BUG] Marlin on BigTreeTech SKR PRO can't be configured to use the onboard SD-card #14684

Closed
eightheads opened this issue Jul 19, 2019 · 102 comments

Comments

@eightheads
Copy link

Description

Bigtreetech SKR Pro control board(STM32F4) does not seem to hold SD-based EEPROM to the on-board card.

Steps to Reproduce

  1. Load lastest Marlin 2.0 to SKR Pro
  2. Make change via LCD to z-offset, etc, and Save to EEPROM
  3. Power cycle board. Settings have now reverted to initial(firmware) values

Expected behavior: Settings to EEPROM should save between power cycles

Actual behavior: Settings revert to initial firmware values after power cycle
Configs.zip

@tpruvot
Copy link
Contributor

tpruvot commented Jul 19, 2019

if your sdcard is empty (no gcode file) it may cause an issue to save/load the eeprom.dat

@tpruvot
Copy link
Contributor

tpruvot commented Jul 19, 2019

But im not sure the F4/F7 can emulate that on the sdcard, seems a F1 feature

@eightheads
Copy link
Author

eightheads commented Jul 19, 2019

if your sdcard is empty (no gcode file) it may cause an issue to save/load the eeprom.dat

The onboard SD card just has the boards firmware on it. I do not currently have an external SD in my LCD currently.

@tpruvot
Copy link
Contributor

tpruvot commented Jul 19, 2019

on the F4.. its emulated in the SoC flash, not on the SD

@dch1921
Copy link

dch1921 commented Jul 20, 2019

I'm seeing the same issue with the SKR Pro 1.1 Does not save changes to eeprom with M500

@boelle boelle changed the title SD-EEPROM not with Bigtreetech SKR Pro(STM32F4) on-board SD card? [BUG] SD-EEPROM not with Bigtreetech SKR Pro(STM32F4) on-board SD card? Jul 21, 2019
@LinoBarreca
Copy link
Contributor

LinoBarreca commented Jul 26, 2019

why don't you just take the
Marlin/Marlin/src/HAL/HAL_STM32F1/persistent_store_sdcard.cpp which is a F1 platform feature and put it "a level UP" in the /shared features among the SpiEeprom.cpp and I2CEeprom.cpp defining it as VirtualSDEeprom.cpp?

This way you could
#define VIRTUAL_SD_EEPROM 8 (where 8 = 8*512bytes = 4kb user defined eeprom file)
in Configuration.h and use the sdcard instead of a real EEPROM chip on ANY platform/controller which has limited writes before you have to replace the whole board
For platforms which have a real EEPROM chip you can use that OR the virtual eeprom on the SD (user preference).
For platforms which don't have a real EEPROM you would force the define in the platform HAL layer.

And everyone would be happy.

Also...this could allow easy "eeprom" backup/restore from the sdcard: if your printer controller suddenly fails (I.E. a voltage regulator or a burnt IO port on the cpu) or you simply want to do an upgrade of your controller you can replace the board and have the same settings you had before the replacement (z-probe offset, bed mesh, speeds, steps, jerks and so on)

Considering this all, the only reason the user could still choose the "internal eeprom" is if he frequently swaps sd cards.

@LinoBarreca
Copy link
Contributor

Apparently someone has done it at the "platform" level.
https://github.com/bigtreetech/BIGTREETECH-SKR-PRO-V1.1/pull/21/files
I wouldn't still merge this into marlin because I still think that EEPROM emulation should be handled at a global level and not at a platform level.

@TheWeakBerlin
Copy link

TheWeakBerlin commented Sep 8, 2019

Any news on that Topic?

i just bought the SKR PRO Board and it runs well with Marlin 2.0.x i can store Data with M500 on a SD-Card but after shut down the Printer it will not load the Data (Mesh Data for example) but on the SD the eeprom.dat file is still there.

Do i need to implement the "platform level" solution into my version or is there something i missed?

in Configuration.h i set EEPROM_SETTINGS
and at pins_BIGTREE_SKR_PRO_V1.1.h i tried both SRAM_EEPROM_EMULATION and FLASH_EEPROM_EMULATION, with no difference in behavior.

Greetings from Germany :D

EDIT: i just saw the "Platform Level" solution is allready there

@tpruvot
Copy link
Contributor

tpruvot commented Sep 8, 2019

There was a config storage version change last week end.. to V69. When that happens, the SD or FLASH (or whatever) cant be loaded... need a reset

@boelle
Copy link
Contributor

boelle commented Sep 24, 2019

@eightheads still having problems?

@eightheads
Copy link
Author

@eightheads still having problems?

As far as I know this is still an issue in the main Marlin branch.

@boelle
Copy link
Contributor

boelle commented Sep 24, 2019

@eightheads have you tested it?

@reloxx13
Copy link
Contributor

still wont load config after restart.

@TheWeakBerlin
Copy link

I still have Problems too, if i use SRAM_EEPROM_EMULATION i get the version error with V69 of the EEPROM and if i use the FLASH_EEPROM_EMULATION it only loads old data but dont want to store new data.

@Evg33
Copy link
Contributor

Evg33 commented Oct 2, 2019

#define EEPROM_SETTINGS
#define EEPROM_CHITCHAT       // Give feedback on EEPROM commands. Disable to save PROGMEM.
#define FLASH_EEPROM_EMULATION  // Use Flash-based EEPROM emulation

no problems

reloxx13 added a commit to reloxx13/Marlin that referenced this issue Oct 4, 2019
@dineshvyas
Copy link

PINS
CONFIG
THIS SHOULD WORK

@eightheads
Copy link
Author

eightheads commented Oct 8, 2019

THIS SHOULD WORK

This would enable Flash based EEPROM emulation, not SD card EEPROM emulation though, correct?

@dineshvyas
Copy link

dineshvyas commented Oct 8, 2019

THIS SHOULD WORK

This would enable Flash based EEPROM emulation, not SD card EEPROM emulation though, correct?

Correct.

@dineshvyas
Copy link

I still have Problems too, if i use SRAM_EEPROM_EMULATION i get the version error with V69 of the EEPROM and if i use the FLASH_EEPROM_EMULATION it only loads old data but dont want to store new data.

FLASH_EEPROM_EMULATION is working fine for me, stores new data too.

@AnHardt
Copy link
Contributor

AnHardt commented Oct 8, 2019

The last time i tried EEPROM from SD-card worked.
But only from the external card-reader on the display panel - not from the on-board-slot.
But that's not a fault of the SD-EEPROM emulation but a more general on-board SD problem.

@tpruvot
Copy link
Contributor

tpruvot commented Oct 8, 2019

There was a lot of changes recently on the data storage, we are at v70, but there was other changes in the structure since... each time its reset... Are you sure its not your problem ?

@dineshvyas
Copy link

SD EEPROM is not supported on STM32F4. it is only supported on STM32F1, so not on SKR PRO V1.1

@tpruvot
Copy link
Contributor

tpruvot commented Oct 8, 2019

some F4 seems to have it, but maybe not the SKR... due to framework differences cf #14808 & #14844

@AnHardt
Copy link
Contributor

AnHardt commented Oct 8, 2019

@dineshvyas
Don't be ridicules. It works on the external SD at SKR PRO 1.1!

@dineshvyas
Copy link

@dineshvyas
Don't be ridicules. It works on the external SD at SKR PRO 1.1!

I have no such intention to ridicule. i just stated what I read. it was about on board sd card. I am not an expert, I am just looking for a solution. I apologize if by any mean I made you feel bad.

@LinoBarreca
Copy link
Contributor

LinoBarreca commented Dec 10, 2019

or split it up in multple PR's ?

Yeah that could have been an option but most of those are deeply linked one to the other.
The sdcard bug (this) and the multiple spi (change) are linked. They require a deep change to how marlin handles/defines SPI. This means it has to be backported to the other hals (at least at the interface level)
I am closing the hardware CRC part and I will surely make a PR to "commit it" into the marlin source code. (the hardware CRC wasn't strictly necessary, but since it will require a HAL interface change with the core I preferred to do it now, so I don't ask people to revisit things twice)
As I said somewhere in the above link I need to make that PR because I need help in adapting all the other HALS to the new "variable" spis by board. We need to adapt each pins file (most of them will be a 1 to 1 translation, easy and stupid, because most boards don't have multiple SPIs but just one) and all the hals to handle the new calls. that work is just "adapt this call to fit into what we have now" and it will be easy for the maintainers of the hals once I make the PR. I already did it for the STM32.
Problem isn't that I can't do it myself, I could indeed adapt each pins/hal to the new "dynamic" logic but I will take A LOT to do that if I'm alone. If I push that PR we can have more people working on the "multispi" branch and then merge it all at once.

Today we finished half of the Hardware CRC part. when the other half is ready I'll make the PR.
We are actually working in three (me, @Evg33 and @Patag ) on that one but the problem with board design of the SKR pro makes it harder to work on it because of a (wrong) R5 on the clock line. I sorted the problems out (with their precious testing help) and I guess that by the end of this week we will have the pr done to marlin's source.

@jgwinner
Copy link

This sounds fantastic. I have an SKR Pro and just started trying to program it. I was going to use UART, not SPI. CR-10, adding another extruder. BLTouch, 2209's and 2208's.

If I can do anything to help, let me know, I'm a long time C++ dev.

    == John ==

@Evg33
Copy link
Contributor

Evg33 commented Dec 20, 2019

Multiple, simultaneous, SPI buses handling and Smart SD mounting #16260

@LinoBarreca
Copy link
Contributor

everyone having this problem, please go and test pr 16260, as linked by @Evg33

@boelle
Copy link
Contributor

boelle commented Dec 24, 2019

@eightheads is the issue still the same with all the updates in the last 27 days?

@boelle
Copy link
Contributor

boelle commented Dec 24, 2019

btw, who can confirm there is an issue? use the same configs as OP and the same hardware if possible

@m-kozlowski
Copy link

btw, who can confirm there is an issue?

You mean onboard sd on skr pro? Yes, there is an issue.
It does work with #16260 however.

@boelle
Copy link
Contributor

boelle commented Dec 24, 2019

if that is what is in #14684 (comment) then yes

@boelle
Copy link
Contributor

boelle commented Dec 24, 2019

@thinkyhead could we get #16260 merged maybe?

@LinoBarreca
Copy link
Contributor

LinoBarreca commented Dec 25, 2019 via email

@G-Pereira
Copy link
Contributor

What about printing from the on board SD card @LinoBarreca? I don't want to rush you in any way, I am just wondering if that is possible and planned.
Happy Holidays!

@LinoBarreca
Copy link
Contributor

LinoBarreca commented Dec 25, 2019 via email

@fighter777
Copy link

good work, i will test that on my board ;)

and i will order a sd card extender ... thx @dineshvyas ^^

@G-Pereira
Copy link
Contributor

G-Pereira commented Dec 30, 2019

That's actually working on skr pro. It's not merge-able because it needs work on other hals.

Is it in bugfix-2.0.x? and not in 2.0.x?

@LinoBarreca
Copy link
Contributor

That's actually working on skr pro. It's not merge-able because it needs work on other hals.

Is it in bugfix-2.0.x? and not in 2.0.x?

Yes, actually 2.0 is out. This could go into 2.0-bugfix or 2.1-dev (I think the latter is more appropriate since the entity of changes, but there no one could use it)

@fighter777
Copy link

that work for me

thank @LinoBarreca

USB port work ?

@jgwinner
Copy link

I'm away from my machine now, but I wasn't able to get the RepRap SD card working on the SKR Pro 1.1 nor the onboard SD card. The onboard one wasn't recognized. I also was never able to get the USB working.

I was using the Lino7 branch.

I get CRC errors on the display SD card, although it reads the directory fine.

Are there some settings that maybe I was missing?

I have an ST Link coming, I can run further diagnostics if you need.

== John ==

@LinoBarreca
Copy link
Contributor

that work for me

thank @LinoBarreca

USB port work ?

Not yet. That's another hardware part...I might work on it when that will be merged. But it's unlikely since that pr opens a million of possibilities for developing more useful things.

@LinoBarreca
Copy link
Contributor

@jgwinner as I said on the PR pull it again and test it again. When @thinkyhead did the forced push something broke. I did a force push again from my last knowing one and it's working now, for sure.

@jgwinner
Copy link

@LinoBarreca Oh, sorry, Missed that (bandwidth constrained ATM).

I will do that!

@boelle
Copy link
Contributor

boelle commented Jan 7, 2020

since we have not heard from OP i will mark this one as stale

Lack of Activity
This issue is being closed due to lack of activity. If you have solved the
issue, please let us know how you solved it. If you haven't, please tell us
what else you've tried in the meantime, and possibly this issue will be
reopened.

@boelle boelle closed this as completed Jan 7, 2020
@jgwinner
Copy link

jgwinner commented Jan 7, 2020

Six days stale over Christmas and New Years gets it closed? Good grief.

@LinoBarreca
Copy link
Contributor

there's a fix anyway for it...so it makes sense to be closed.

@fighter777
Copy link

fix not merged ?

@LinoBarreca
Copy link
Contributor

not yet. it needs work on other boards... but on skr-pro it works.

@github-actions
Copy link

github-actions bot commented Jul 3, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests