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

BTT_SKR_Pro v1.2 onboard sd_card #139

Open
Melkiyby opened this issue Sep 6, 2023 · 2 comments
Open

BTT_SKR_Pro v1.2 onboard sd_card #139

Melkiyby opened this issue Sep 6, 2023 · 2 comments

Comments

@Melkiyby
Copy link

Melkiyby commented Sep 6, 2023

Hello. I'm trying to set up sd card support. I figured out the problems during compilation, but still an error 60 mounting the SD card.
I commented the exp2 part and uncommented it from the onboard

`//#if SDCARD_ENABLE
// Connect to the  EXP2 Header
//#define SD_CS_PORT                  GPIOB
//#define SD_CS_PIN                   12
//#define SPI_PORT                    2 // GPIOB, SCK_PIN = 13, MISO_PIN = 14, MOSI_PIN = 15
//#endif

//*
#if SDCARD_ENABLE
// On board socket- flaky?
#define SD_CS_PORT                  GPIOA
#define SD_CS_PIN                   4
#define SPI_PORT                    11 // (MCU port 1) GPIOA: SCK_PIN = 5, MISO_PIN = 5, GBIOB: MOSI_PIN = 5
// PB11 - TF_SW - card detect
#endif
//*/`

Part of my platformio.ini

# uncomment `FatFS` and `sdcard` below.
  FatFs
  sdcard
  spindle
  # USB serial support
  Core
  Class
  App
  Target
lib_extra_dirs =
  .
  FatFs
  Middlewares/ST/STM32_USB_Device_Library
  USB_DEVICE

[env]
platform = ststm32
platform_packages = framework-stm32cubef4 @ ~1.26.2
framework = stm32cube
# Do not produce .a files for lib deps (which would prevent them from overriding weak symbols)
lib_archive = no
lib_ldf_mode = off

[env:btt_skr_pro_1_1]
# Untested and might not boot.  Please report issues at:
# https://github.com/grblHAL/STM32F4xx/issues
board = genericSTM32F407VGT6
board_build.ldscript = STM32F407VGTX_BL32K_FLASH.ld
build_flags = ${common.build_flags}
  # See Inc/my_machine.h for options
  -D BOARD_BTT_SKR_PRO_1_1=
  # 8MHz crystal
  -D HSE_VALUE=8000000
  -D HAS_BOOTLOADER
  -D TRINAMIC_ENABLE=2209
  -D USB_SERIAL_CDC=0
  -D POLAR_ROBOT
  -D SDCARD_ENABLE=1
  -D _VOLUMES=1
lib_deps = ${common.lib_deps}
  eeprom
  trinamic
lib_extra_dirs = ${common.lib_extra_dirs}
@asulonn
Copy link

asulonn commented Sep 13, 2023

I had the same issue, with the same board (SKR PRO V1.1).
Unfortunately at the time i misplaced my issue under the core repo instead of here.
I did some testing, but at some point i got busy doing other stuff and i did not have the time to further investigate.
Meaby this info can help you and/or you can finish where i stopped:
#grblHAL/core#244

My plan was to one day pick this back up and go further with testing...

@terjeio
Copy link
Contributor

terjeio commented Sep 13, 2023

There is a typo in spi.c... 5 should be GPIO_PIN_5.

terjeio added a commit that referenced this issue Sep 14, 2023
Fix for SPI pin definition typo, issue #139.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants