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] SD card support for teensy 4.1 does not compile in Arduino IDE with Marlin 2.0.7 from 2.x.x #19562

Closed
nanotuxi opened this issue Sep 30, 2020 · 11 comments

Comments

@nanotuxi
Copy link

Bug Description

Compiling Marlin 2.0.7 from the default branch for teensy 4.1 with MOTHERBOARD BOARD_TEENSY41 and #define SDSUPPORT enabled does not work in Arduino IDE 1.8.13/Teensyduino 1.53
error is
Compiler says In file included from /tmp/arduino_build_871308/sketch/src/HAL/STM32F1/onboard_sd.cpp:19:0: /tmp/arduino_build_871308/sketch/src/HAL/STM32F1/SPI.h:28:37: fatal error: libmaple/libmaple_types.h: No such file or directory compilation terminated. Fehler beim Kompilieren für das Board Teensy 4.1.

My Configurations

Everything else but the two changes in the config mentioned above are left to default.

Steps to Reproduce

  1. Download fresh sources from https://github.com/MarlinFirmware/Marlin.git 2.x.x branch
  2. set #define MOTHERBOARD BOARD_RAMPS_14_EFB to #define MOTHERBOARD BOARD_TEENSY41
  3. change //#define SDSUPPORT to #define SDSUPPORT
  4. compile the sources in Arduino IDE as shown above.

Expected behavior:
Compilation should not show any errors and sd card support for the teensy 4.1 onboard sd-card reader should be enabled.

Actual behavior:
Compilation fails with file not found error mentioned above.

Additional Information

Compilation with //#define SDSUPPORT (sd card support disabled) works fine and the board can be connected without any error with serial connection. In Arduino IDE keybord layout for teensy board is set to German.
The board is not connected to anything else (bare).
Some examples from the SDfat library from https://github.com/greiman/SdFat-beta.git compiled fine and worked as expected.

@boelle
Copy link
Contributor

boelle commented Sep 30, 2020

Configurations, please
Please ZIP up your Configuration.h and Configuration_adv.h files (as
requested in the Issue template) and drop them into your next reply.
We'll check them over and see if anything is amiss.

Please test the bugfix-2.0.x branch to see where it stands. 2.0.7 is just a frozen copy of that anyway

@boelle
Copy link
Contributor

boelle commented Sep 30, 2020

Arduino IDE 1.8.13/Teensyduino 1.53

please use vs code + platform.io extension

@boelle
Copy link
Contributor

boelle commented Sep 30, 2020

fatal error: libmaple/libmaple_types.h: No such file or directory

there is a small clue

@nanotuxi
Copy link
Author

nanotuxi commented Sep 30, 2020

Marlin 2.0.7 @thinkyhead thinkyhead released this yesterday
, so there are no updates in the bugfix branch.
Tried with platform.io and compilation is fine now. Connection over serial is fine.
But sending a M20 says No media. Do I have to configure the PINS for the onboard sd card somewhere else to use it?

@sjasonsmith
Copy link
Contributor

Does M20 work if you first send M21?

Teensy 4.1 was only added a few days ago. I expect there are some issues, but SD seems like core functionality that hopefully works.

@ellensp
Copy link
Contributor

ellensp commented Sep 30, 2020

In Marlin/Marlin/src/HAL/STM32F1/onboard_sd.cpp add #ifdef __STM32F1__ after the end of comment */ (line 12)
And close it with adding a #endifto the very end of the file.

@ellensp
Copy link
Contributor

ellensp commented Sep 30, 2020

Issue is arduino ide trying to compile STM32F1 code. Platformio is smart enough to not compile it, but arduino ide you have to explicitly tell it just skip this when not compiling for a STM32F1.

This compiles, let 'us' know if sd card actually works.

@nanotuxi
Copy link
Author

@ellensp
Compilation works now with Arduino IDE. But for some unknown reason the board doesn't work anymore as it should. There is something wrong with the serial connection/driver on my linux machine. Trying to connect to the board results sometimes in a kernel oops and I have to hard reset the whole machine. Have to investigate this later, so I can't tell you now, if the sd card works. Will give you a feedback when I found the reason for that.
Thank you.

@nanotuxi
Copy link
Author

nanotuxi commented Oct 1, 2020

Forgot to set the dummie values for the thermistors.

Switched to bugfix-2.0.x
Good news:
Compilation works (also with 2.0.7 branch). Board can be connected to e.g. RepetierHost.
Tested with both Marlin 2.0.7 and bugfix-branch.
Tested with both Arduino IDE 1.8.13/Teensyduino1.53 and updated platformio.
Bad news:
The sd card does't init . It says after M21

11:36:04.675 : echo:No SD card 11:36:04.675 : echo:No media
Triggering the M21 command lets the red led on the teensy board light up for about a second.
nt_marlin_teensy4_1.zip
Got an ethernet adapter for teensy 4.1 yesterday and will try to get it running.

Should I open another bug report with this issue and close this one?

@nanotuxi
Copy link
Author

nanotuxi commented Oct 1, 2020

@ellensp
Thanks for the solution

@nanotuxi nanotuxi closed this as completed Oct 1, 2020
ellensp pushed a commit to ellensp/Marlin that referenced this issue Oct 2, 2020
@github-actions
Copy link

github-actions bot commented Dec 2, 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 Dec 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants