-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
Fix SD pins for SKR Pro and GTR #19047
Fix SD pins for SKR Pro and GTR #19047
Conversation
I added similar modifications to the GTR board. There was already some attempt to do this in the GTR file, but it did not work at all for me. The behavior on the GTR prior to my change was that inserting a card into the ONBOARD SD would freeze the LCD, and generally things with mixed up between the two. Previously I has probably never tried to use ONBOARD SD with these. |
If anybody is using a GTR, it would be great if you could test with this to ensure it doesn't break functionality with your screen. |
Hoping to test this once your other PR is merged. |
There were some comments on Discord I need to look back at prior to this merging. |
I have a BTT GTR, and prior to cherry picking my config changes onto the PR branch I could print from SD, afterwards Marlin doesn't think an SD card is inserted('Attach Media' message on LCD/'No SD card' message over serial) Configuration and Configuration_adv: |
I have spotted my issue, there is no default SDCARD_CONNECTION define in pins_BTT_GTR_V1_0.h, so by default SD won't work. |
Here's how it's handled in the SKR 1.3: Marlin/Marlin/src/pins/lpc1768/pins_BTT_SKR_V1_3.h Lines 359 to 361 in c55f477
|
@thisiskeithb do you know why that is? Does everybody have SDs on their LCDs? It seems strange that is the default, even if there is no LCD! It seems like the sensible default would be the on-board port, since it is always there? |
I believe that's how it was initially, but was changed at some point.
|
I think I prefer the recommendation to just fail the build with an error if they enable SD without defining this. |
Do you want to change the other pins files as well for consistency? |
Testing an SKR Pro 1.1 with Marlin/Marlin/src/pins/stm32f4/pins_BTT_SKR_PRO_common.h Lines 307 to 310 in 47d7258
This was easier to notice when I defined I'll keep testing... |
This is working fine for me on the SKR Pro 1.1 |
Which LCDs did you try? |
I'm using a BTT TFT35 V3, which emulates a Reprap Discount smart display in marlin mode and is what i have it configured as in marlin. Choosing Onboard, the SKR Pro's SD card is now usable and the lcd is working in a normal manner, and Choosing LCD, the SD card on the BTT TFT35 V3's SD slot works in marlin mode. Ran a print from it and it appears to be fine. |
Just noticed that marlin does not detect the card being inserted or removed showing " Media connected " or "media removed " like it does with the LCD sd card, but the Onboard is in fact working now at least. So sd detection is not in fact working on the SKR Pro but the onboard sd now works which didnt before. |
I had to add |
I didnt have to do this to get the SD on the lcd working however as stated above the detection or onboard is not working but printing from sd does |
I believe I had the detect pin working for both, but |
This makes sense and in fact fixed the non "media detected / removed" That might throw some people off. any way to warn them so they dont file an erroneous bug report? |
@thisiskeithb can you try flashing firmware.bin on the GTR from onboard sd with it enabled in marlin via the M997 command see if it fails for you as well? M997 does not work for me if i have #define SDCARD_CONNECTION ONBOARD but the sd works for printing and what not. The board ends up in a frozen blank screen state with M997 it never flashes the bin. |
Is this considered good enough and at least fixing the issue now? Or, does it need more review and testing. |
This still needs more work. |
These are the combinations I'm going to test and verify work as expected:
|
…ass, to enable SD without display
47d7258
to
7c65de4
Compare
I completely replaced the earlier solution, and methodically went through one display at a time making sure they were working. I tried to make the GTR and SKR Pro configurations as similar as possible. There were some oddities where they didn't behave the same, and I ended up forcing SOFTWARE_SPI for the RepRapDiscount display on the SKR Pro, but not on the GTR. In the end, everything seems to be working on these three displays, with both LCD and ONBOARD SD selected. Maybe @thisiskeithb and @GhostlyCrowd can sanity check with the configurations they had problems with before. You still need to uncomment |
This detail in the description is significant, so I'll repeat it here: I also moved where the pull on the SD_DETECT pin is configured. This was previously initialized in the LCD code instead of the SD code, so it did not work properly if you had an external "LCD" SD Reader, without actually enabling a display. |
@thinkyhead I just marked this ready for review. It looks like CI builds are completely broken, but since this primarily impacts 2 pins file I'm not expecting build failures. |
Onboard SD and LCD SD working here with proper detection for SKR pro and BBT TFT35 V3 (which emulates RepRapDiscount FullGraphics Smart Display) Only Caveat is that M997 rebooting for flashing from ONBOARD AND the reset button are broken on the SKR Pro when using ONBOARD SD and their is a SD in the slot, the system doesn't reboot properly and gets stuck in a weird state with a blank screen, nor will it mount the onboard SD and flash firmware.bin. It must hang trying to mount the SD to check if firmware.bin is present and never finishes this routine. Power cycle solves this. |
@GhostlyCrowd, did you earlIer say that the M997 issue also existed before my changes? |
I don't know if it existed before this PR As onboard SD never worked for me previously, i can Try fresh bug fix and see if the onboard SD works and if the issue is there. |
So current bugfix Onboard SD still points to LCD SD for me, M997 seems to work but thats because onboard SD is never used. SO thats what i've found, I don't think M997 not working on the SKR pro should hold this back as it has never worked properly given its usefulness is only if you can access on board sd send the firmware and flash it via Gcode |
It bothered me that overriding pins to use hardware SPI worked on the GTR but not the SKR Pro. Looking at the experimental Multi-SPI PR (#16260) I was able to find the reason, and added a comment to the pins file documenting it. I confirmed that if I modify the HAL to use SPI Mode 3 then it can work, but decided it is best to wait for other multi-device SPI improvements rather than adding yet another hack for this one board. |
@sjasonsmith I just pushed the multi data mode support for hardware SPI in LPC. We can try test it. |
@rhapsodyv these boards both use HAL/STM32. |
🤦🏻♂️sorry,I confused it with "skr turbo", which is lpc! Haha |
…K8800-2.0.x * tag '2.0.6.1' of https://github.com/MarlinFirmware/Marlin: (195 commits) Version 2.0.6.1 [cron] Bump distribution date (2020-08-28) Add set_all_homed Mark axes not-homed with HOME_AFTER_DEACTIVATE (MarlinFirmware#18907) set_axis_not_trusted => set_axis_never_homed Independent Neopixel option (MarlinFirmware#19115) Fix Creality V4 probe pin Fix small typø Allocate sufficient MSG_MOVE_Z_DIST buffer One MARLIN_DEV_MODE warning per rebuild (MarlinFirmware#19163) FYSETC S6 2.0 (MarlinFirmware#19140) [cron] Bump distribution date (2020-08-27) Fix SINGLENOZZLE fan speed bug (MarlinFirmware#19152) Fix NEOPIXEL_STARTUP_TEST last delay (MarlinFirmware#19156) TFT (plus Hardware SPI) for LPC (MarlinFirmware#19139) Prusa => Průša Direct Stepping update (MarlinFirmware#19135) Fixes to FTDI Touch UI (MarlinFirmware#19134) Add Einsy Rambo Filament Runout Pin (MarlinFirmware#19136) Fix SD pins for SKR Pro and GTR (MarlinFirmware#19047) ...
unsubscribe
>>>> Original Message <<<<<
From: MarlinFirmware/Marlin
To: MarlinFirmware/Marlin
Cc: Subscribed
Sent Date: Mon,17 Aug 2020 22:03:44 Asia/Taipei
Subject: Re: [MarlinFirmware/Marlin] Fix SD pins for SKR Pro and GTR (#19047)
Hoping to test this once your other PR is merged.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Description
Define SD_DETECT differently depending on the value of
SDCARD_CONNECTION
.For the GTR, I modified it to use the same layout as the SKR Pro. It was previously incorrect regarding which SPI is enabled in the variant file, and was not properly switching pins around to allow both LCD and ONBOARD LCD to work.
GTR also had an issue where inserting a card into the the ONBOARD slot could freeze the LCD display, even though they were physically disconnected SPI buses.
Benefits
On both boards, you can now select either ONBOARD or LCD in the Configuration_adv.h.
Allows SD detection when using either mode.
I also moved where the pull on the SD_DETECT pin is configured. This was previously initialized in the LCD code instead of the SD code, so it did not work properly if you had an external "LCD" SD Reader, without actually configuring a display.
Related Issues
#17906 - [BUG] BTT SKR PRO onboard SD Card - detect pin still used from LCD (bugfix-2.0)
#18671 - The SD card on the LCD FYSETC_MINI_12864 screen cannot be read on the SKR Pro V1.1 motherboard (and GTR)