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

Fix build for GTR and SKR PRO with usb flash drive support #21197

Conversation

rhapsodyv
Copy link
Member

Description

Fix missing flags. Fix #20750

@gaby64
Copy link

gaby64 commented Feb 26, 2021

tested with your pr, im getting this error:

In file included from Marlin/src/HAL/STM32/HAL.h:27, from Marlin/src/HAL/STM32/HAL.cpp:25: Marlin/src/HAL/STM32/HAL.h:63:23: error: 'MSerial' was not declared in this scope; did you mean 'MSerial9'? 63 | #define MYSERIAL1 MSerial

@rhapsodyv
Copy link
Member Author

To use gtr with a usb flash drive, you need to move the usb jumper and not use -1 as serial in marlin, as the usb serial will not be available when using usb flash drive.

You should set it to 1, 2 or 3. I don't know the right value. You need to take a look in the gtr specs. But -1 will not be available.

@gaby64
Copy link

gaby64 commented Feb 26, 2021

so this is unusable on my SKR Pro 1.2 with a BTT TFT70, I just wanted usb drive support for the motherboard.

@rhapsodyv
Copy link
Member Author

so this is unusable on my SKR Pro 1.2 with a BTT TFT70, I just wanted usb drive support for the motherboard.

I don’t have this board. But I know that you will lose the usb to computer when using usb flash drive.

but I don’t think it will stop working the tft...

We need to take a look in the board specs to see what are the serial port available.

@rhapsodyv
Copy link
Member Author

When using usb flash drive, I think you will only lose the usb connect with host/computer. The serial for the tft will not change, it will be serial 1 yet.
You just lose the serial -1.

@thisiskeithb right?

@thisiskeithb
Copy link
Member

@thisiskeithb right?

Sounds right, but I didn't have a TFT hooked up when I was testing it.

@gaby64
Copy link

gaby64 commented Feb 26, 2021

you are right, I had changed to something other then 1 for the first serial.

@ghost
Copy link

ghost commented Feb 26, 2021

kép
Freshly donwloaded and builded.. :(

@ghost
Copy link

ghost commented Feb 26, 2021

Now it's works with this setting:

/**
 * Select the serial port on the board to use for communication with the host.
 * This allows the connection of wireless adapters (for instance) to non-default port pins.
 * Serial port -1 is the USB emulated serial port, if available.
 * Note: The first serial port (-1 or 0) will always be used by the Arduino bootloader.
 *
 * :[-1, 0, 1, 2, 3, 4, 5, 6, 7]
 */
#define SERIAL_PORT 1
#
# Bigtreetech GTR V1.0 (STM32F407IGT6 ARM Cortex-M4) with USB Flash Drive Support
#
[env:BIGTREE_GTR_V1_0_usb_flash_drive]
platform          = ${common_stm32.platform}
extends           = common_stm32
board             = BigTree_GTR_v1
extra_scripts     = ${common.extra_scripts}
  pre:buildroot/share/PlatformIO/scripts/generic_create_variant.py
platform_packages = ${stm32_flash_drive.platform_packages}
build_flags       = ${common_stm32.build_flags}
  -DSTM32F407IX -DVECT_TAB_OFFSET=0x8000

@rhapsodyv
Copy link
Member Author

My branch didn't work for you?? I didn't understand you.

@ghost
Copy link

ghost commented Feb 26, 2021

After all settings implemented in Config file:
kép

@ghost
Copy link

ghost commented Feb 26, 2021

My branch didn't work for you?? I didn't understand you.

No. Not work. :(

@ghost
Copy link

ghost commented Feb 26, 2021

When i turn off the sdsupport then compiled without error:
kép

@rhapsodyv
Copy link
Member Author

I think you aren't using my branch. I just compiled it without any error or warning. Configs:

#define SERIAL_PORT 3
#define MOTHERBOARD BOARD_BTT_GTR_V1_0
#define SDSUPPORT
#define USB_FLASH_DRIVE_SUPPORT
#define USE_OTG_USB_HOST

@rhapsodyv
Copy link
Member Author

I just added a test in the Marlin CI to build GTR + OTG USB, just to make sure it's working... and the test just finished with success...

@margaale
Copy link
Contributor

Yep, i can confirm it's working fine. I was having a problem where the status message was saying "USB start failed", however i had USE_OTG_USB_HOST commented out. Thanks to your test i was able to find that out.

@ghost
Copy link

ghost commented Feb 26, 2021

config.zip

@rhapsodyv
Copy link
Member Author

config.zip

You need to enable the configs:

#define SERIAL_PORT 3
#define MOTHERBOARD BOARD_BTT_GTR_V1_0
#define SDSUPPORT
#define USB_FLASH_DRIVE_SUPPORT
#define USE_OTG_USB_HOST

And use this branch, not bugfix.

@ghost
Copy link

ghost commented Feb 26, 2021

I think you aren't using my branch. I just compiled it without any error or warning. Configs:

#define SERIAL_PORT 3
#define MOTHERBOARD BOARD_BTT_GTR_V1_0
#define SDSUPPORT
#define USB_FLASH_DRIVE_SUPPORT
#define USE_OTG_USB_HOST

ok then I try it again.

@ghost
Copy link

ghost commented Feb 26, 2021

Thank you! It's alive! :D

@thinkyhead thinkyhead merged commit f384f81 into MarlinFirmware:bugfix-2.0.x Feb 26, 2021
@ghost
Copy link

ghost commented Feb 27, 2021

Yes i konw... I open another error ticket. But it is driven by curiosity.
There is still a bug still.
Even though I turn the probe offset in the plus or minus direction, the bed always moves in only one direction (it keeps moving away).

@rhapsodyv rhapsodyv deleted the fix-gtr-skr-pro-usb-flash-drive branch February 27, 2021 17:26
vyacheslav-shubin pushed a commit to vyacheslav-shubin/Marlin that referenced this pull request Mar 10, 2021
vyacheslav-shubin pushed a commit to vyacheslav-shubin/Marlin that referenced this pull request Mar 10, 2021
W4tel-BiDi pushed a commit to W4tel-BiDi/Marlin that referenced this pull request Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] BIGTREE_GTR_V1_0_usb_flash_drive fails with "no match MCU defined"
5 participants