MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.04k stars 19.15k forks source link

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

Closed eightheads closed 4 years ago

eightheads commented 5 years ago

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

LinoBarreca commented 4 years ago

@xC0000005 How is it supposed to work if stm32 lacks sdio.h/cpp? I mean...The hal doesn't have the support for it.... When I get my board I'll work on it.

xC0000005 commented 4 years ago

The HALSTM32 doesn’t have working SDIO implementation - I’ve been using it on STM32F103, STM32F070, and STM32F407 machines with the SD cards hooked up via SPI (the onboard card on the BTT SKR Pro is hooked up this way). I did get the SDIO ports on a lerdge board working using the code here - https://github.com/xC0000005/Marlin/tree/LerdgeXAndK/Marlin/src/HAL/HAL_STM32 https://github.com/xC0000005/Marlin/tree/LerdgeXAndK/Marlin/src/HAL/HAL_STM32 the two files are the SDIO ones. It doesn’t use DMA yet and occasionally hits an error, but it would be a good start toward SDIO for the unified HAL.

On Nov 4, 2019, at 12:33 PM, Lino Barreca notifications@github.com wrote:

@xC0000005 https://github.com/xC0000005 How is it supposed to work if stm32 lacks sdio.h/cpp? I mean...The hal doesn't have the support for it.... When I get my board I'll work on it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/14684?email_source=notifications&email_token=AHVGS4LNSNXZJAVTETORZE3QSCBKZA5CNFSM4IFLWW6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDATUFI#issuecomment-549534229, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVGS4PAX7RCLNXIWRLHDE3QSCBKZANCNFSM4IFLWW6A.

LinoBarreca commented 4 years ago

https://github.com/stm32duino/STM32SD We just need to use it inside marlin...maybe that's what I'll work on next. I'll create the interface in the generic stm32 hal to use the official stm32 SD support.

xC0000005 commented 4 years ago

That includes the parameter order fix for both F4 and F103 so that’s good a perfectly good way to use it.

On Nov 4, 2019, at 12:44 PM, Lino Barreca notifications@github.com wrote:

https://github.com/stm32duino/STM32SD https://github.com/stm32duino/STM32SD We just need to use it inside marlin...maybe that's what I'll work on next. I'll create the interface in the generic stm32 hal to use the official stm32 SD support.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/14684?email_source=notifications&email_token=AHVGS4KRX7IYYAQZIR5Q5PLQSCCRFA5CNFSM4IFLWW6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDAUS7Q#issuecomment-549538174, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHVGS4MK3A4IW5IAN3GLOHDQSCCRFANCNFSM4IFLWW6A.

LinoBarreca commented 4 years ago

I am working on it. Once I'm done marlin will be able to support multiple SPI buses simultaneously and on-board sd card

davidcgu commented 4 years ago

following!!!!!

tjengbudi commented 4 years ago

I am working on it. Once I'm done marlin will be able to support multiple SPI buses simultaneously and on-board sd card

Waiting for this...

LinoBarreca commented 4 years ago

It's done! :muscle: :tada:

eightheads commented 4 years ago

It's done! 💪 🎉

Thanks @LinoBarreca !

eightheads commented 4 years ago

I'm not running a SKR Pro board currently. If we can get some testing verifying this then I'm more than happy to close the issue. Thanks for all the works guys!

cobrettee commented 4 years ago

would like to test - so just to confirm I have to use Lino's marlin branch?

LinoBarreca commented 4 years ago

Hold on, everyone. It's working but it isn't production-ready. I had to modify lots of things in the spi subsystem. It works but it breaks, at the moment, every other board. It needs to be backported to other HALS/pins files.

SkullKill commented 4 years ago

@LinoBarreca Great work! hopefully this will be production-ready soon :)

holgin commented 4 years ago

Does someone have the SKR bootloader

fw_stlink.zip My dump via st-link SKR Pro 1.1 Marln from 08000h

Hey, Im trying to upload the file you have attached using ST-LINK Utility to a brand new MCU on SKR PRO board. As you probably expect, Im getting errors, so I wanted to ask if you could help me with that?

LinoBarreca commented 4 years ago

@SkullKill if you want to come to the other side and make some tests we will finish sooner.

https://github.com/LinoBarreca/Marlin/pull/7

SkullKill commented 4 years ago

@LinoBarreca sure, as soon as i am back, i can do some testing. will be back around end of Dec, start of Jan.

LinoBarreca commented 4 years ago

@LinoBarreca sure, as soon as i am back, i can do some testing. will be back around end of Dec, start of Jan.

That is awesome. By april you should have it then.

BastR commented 4 years ago

@LinoBarreca I can participe to test, what can I do ?

LinoBarreca commented 4 years ago

@BastR you found the thread yourself. so..since you have the drivers in SPI mode (that's nice) just wait for me to support them. I should have something for you later today (~16 GMT)

BastR commented 4 years ago

@LinoBarreca ok, I can try today 👍🏻

boelle commented 4 years ago

could be nice if this one is solved :-D

LinoBarreca commented 4 years ago

@boelle as I said I'm working on it.

boelle commented 4 years ago

@LinoBarreca making a PR for this one or still working on it?

LinoBarreca commented 4 years ago

@boelle https://github.com/LinoBarreca/Marlin/pull/7

I am making a lot of work because I don't just fix that but I add a LOOOOOOT of things to the list. SO yeah...definitely making a pr when it's ready and finished. I don't say something if I'm not sure.... but I want it to be perfect and ADD value, besides the fix. that was ready 15 days ago. but I'm doing way more, as you can see from the link above.

LinoBarreca commented 4 years ago

(also I take care of this https://github.com/xC0000005/Marlin/issues/5#issuecomment-563567564 ) I guess the depth of the work is so huge it should make it into 2.1)

boelle commented 4 years ago

or split it up in multple PR's ?

if one of the things later breaks something else it would be more easy to figure what did go wrong

and small pr's are more easy on @thinkyhead to check and merge in

but since i'm not a programmer nor the maintainer i will let it be up to you :-)

LinoBarreca commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

Multiple, simultaneous, SPI buses handling and Smart SD mounting https://github.com/MarlinFirmware/Marlin/pull/16260

LinoBarreca commented 4 years ago

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

boelle commented 4 years ago

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

boelle commented 4 years ago

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

m-kozlowski commented 4 years ago

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 commented 4 years ago

if that is what is in https://github.com/MarlinFirmware/Marlin/issues/14684#issue-470534484 then yes

boelle commented 4 years ago

@thinkyhead could we get #16260 merged maybe?

LinoBarreca commented 4 years ago

16260 is not in a merge-able state yet. We will get there, but it is not yet complete. I will start back working on it after Christmas. Btw merry Christmas everyone.


From: Bo Herrmannsen notifications@github.com Sent: Tuesday, December 24, 2019 3:10:13 PM To: MarlinFirmware/Marlin Marlin@noreply.github.com Cc: Lino Barreca linobarreca@hotmail.com; Mention mention@noreply.github.com Subject: Re: [MarlinFirmware/Marlin] [BUG] Marlin on BigTreeTech SKR PRO can't be configured to use the onboard SD-card (#14684)

@thinkyheadhttps://github.com/thinkyhead could we get #16260https://github.com/MarlinFirmware/Marlin/pull/16260 merged maybe?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/MarlinFirmware/Marlin/issues/14684?email_source=notifications&email_token=AAG3FOZ2POXPL6QMXVJQTD3Q2IJ4LA5CNFSM4IFLWW6KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTIHQI#issuecomment-568755137, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAG3FO5DZIYVFIPADHVNZ7LQ2IJ4LANCNFSM4IFLWW6A.

G-Pereira commented 4 years ago

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 commented 4 years ago

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

fighter777 commented 4 years ago

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

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

G-Pereira commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

that work for me

thank @LinoBarreca

USB port work ?

jgwinner commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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

I will do that!

boelle commented 4 years ago

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.

jgwinner commented 4 years ago

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

LinoBarreca commented 4 years ago

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

fighter777 commented 4 years ago

fix not merged ?