Skip to content

[2.0.x] Add GTM32 Pro VB support#10898

Merged
thinkyhead merged 2 commits intoMarlinFirmware:bugfix-2.0.xfrom
chepo92:bugfix-2.0.x
May 31, 2018
Merged

[2.0.x] Add GTM32 Pro VB support#10898
thinkyhead merged 2 commits intoMarlinFirmware:bugfix-2.0.xfrom
chepo92:bugfix-2.0.x

Conversation

@chepo92
Copy link
Contributor

@chepo92 chepo92 commented May 29, 2018

Requirements

Description

Added pinmap of GTM32 Pro VB Support, basic functionality (no LCD+sdcard)

Benefits

New board support GTM32 Pro, used in Delta Rostock 301

Related Issues

@thinkyhead thinkyhead changed the title [2.0.x] Add GTM32 Pro VB suport [2.0.x] Add GTM32 Pro VB support May 30, 2018
@thinkyhead
Copy link
Member

Thanks! This will need to be rebased and cleaned up, but after I do that work it can be merged.

@thinkyhead thinkyhead force-pushed the bugfix-2.0.x branch 2 times, most recently from 6f90fab to 2f60502 Compare May 31, 2018 05:00
@thinkyhead thinkyhead added C: Boards/Pins T: HAL & APIs Topic related to the HAL and internal APIs. labels May 31, 2018
@thinkyhead thinkyhead merged commit ae322e0 into MarlinFirmware:bugfix-2.0.x May 31, 2018
//
#define SDPOWER -1
#define SDSS -1
#define LED_PIN PD12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excuse me, what is this pin driving? Where physically on GTM32Pro board is this LED located? Can't find any on mine. Can see only voltage presence LEDs. Do you mind posting an photo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not used, should be -1


#define Y_STEP_PIN PA12
#define Y_DIR_PIN PA11
#define Y_ENABLE_PIN PA15 // core conflict?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's this core conflict comment is about? I can't get Y and Z axis moving. Is this because of this "conflict"?

@thinkyhead
Copy link
Member

@chepo92 — Are there some changes that need to be applied to this pins file now that it's had some time out in the wild?

@chepo92
Copy link
Contributor Author

chepo92 commented Jun 30, 2018

Will come with a new PR for the LED pins,
@AlexanderAmelkin Which STM are you using?

@AlexanderAmelkin
Copy link
Contributor

@thinkyhead, I'm going to post an updated pin file for this board soon (next weekend, I suppose). It will have all board's pins described.

@chepo92, I'm using exactly Geeetech GTM32Pro board (the "VB" as you call it). It is STM32F103VE.
Can't figure out why only the X tower is operating with both your and my own pin config. I've been debugging it with ST-Link and it looks like CR registers for tower Y and Z pins are all fine. But the steppers just won't operate. They, of course, work fine with the original Geeetech's firmware as well as with my own dummy firmware based on mbed.

@chepo92
Copy link
Contributor Author

chepo92 commented Jul 2, 2018

@AlexanderAmelkin the pins are already updated on my repo, made a PR but was closed? (#11177)
I faced same problem you are having when i started, in some stm32F103 PA15, PB3 and PB4 are asigned to JTAG by default (JTDI, JTDO NJTRST) and the core doesn't disable it when you want to use them as GPIO
You have to disable JTAG

@AlexanderAmelkin
Copy link
Contributor

@chepo92, disabling JTAG doesn't help. Well, it enables PA15 (the Y_ENABLE_PIN), but PA11 and PA12 (Y_DIR_PIN and Y_STEP_PIN) remain non-functional. I believe that is related to rogerclarkmelbourne/Arduino_STM32#222, but I can't figure out how to properly disable USB for this board.

@Mr-xRed
Copy link

Mr-xRed commented Aug 2, 2018

Hi guys nice job.
Did you managed to make Marlin work with the GTM32 board?
There has been a discussion on the github page of the board about porting Marlin to the GTM32 mini board too.
Geeetech3D/Diagram#1
Geeetech said he doesn’t has the resources to make the port by himself , but is willing to work. Together with Marlin devs, and send the boards to you.
Do you think it would be possible/do you Want to work together with them to make Marlin compatibile for thr GTM32 Mini and Pro Board?

@AlexanderAmelkin
Copy link
Contributor

@redangel1984, it almost works except for the Y tower. Maybe there will be more problems, but now I'm stuck at that.

@amitlobo
Copy link

@AlexanderAmelkin Check this http://stm32duino.com/viewtopic.php?t=1998.Some people made it work

@amitlobo
Copy link

@AlexanderAmelkin
Here are few updtes with my Geeetech board STM32 Pro with A30 printer.
marlin 2.0.0 compiled and tested homing function.
X&Z axis are working fine,y axis has same problem what you mentioned.A fix for it was
I took the -DSERIAL_USB out from Boards.txt for GENERIC STMV version along with #define BOARD_HAVE_SERIALUSB 0
in boards.h for STM32VE.Restart arduino and compile.
Now all my axis are working,but I have a problem with temperature.
Please can you check how temperature feature is working on your end.I mean for both hotend and bed.

@AlexanderAmelkin
Copy link
Contributor

@amitlobo, thanks for the update. Will check and report. Don't expect this soon, I don't have much time to spend on this.

@AlexanderAmelkin
Copy link
Contributor

@amitlobo, defining BOARD_HAVE_SERIALUSB 0 is useless. It's just the same as defining it to 1 because it is checked with #ifdef(for existence), not with #if (for value).

Also, with the latest PlatformIO code it was forcing -DSERIAL_USB in platforms/ststm32/builder/frameworks/arduino/maple/stm32f1.py if the upload protocol wasn't serial (I'm using STLinkV2), so removing that option from boards.txt wasn't enough.

After modifying that wicked python script, I finally got the STEP (PA12) pin on Y axis working, but the DIR pin (PA11) is still non-functional. The axis moves one way only regardless of the requested direction.

@AlexanderAmelkin
Copy link
Contributor

AlexanderAmelkin commented Sep 9, 2018

In case anyone is interested, here are my current changes to PlatformIO:
gtm32pio-patch.txt

diff -ur /tmp/.platformio/packages/framework-arduinoststm32/STM32F1/boards.txt .platformio/packages/framework-arduinoststm32/STM32F1/boards.txt
--- /tmp/.platformio/packages/framework-arduinoststm32/STM32F1/boards.txt	2018-09-10 00:39:12.181556517 +0300
+++ .platformio/packages/framework-arduinoststm32/STM32F1/boards.txt	2018-09-10 00:37:51.091715754 +0300
@@ -696,7 +696,8 @@
 genericSTM32F103V.menu.upload_method.DFUUploadMethod=STM32duino bootloader
 genericSTM32F103V.menu.upload_method.DFUUploadMethod.upload.protocol=maple_dfu
 genericSTM32F103V.menu.upload_method.DFUUploadMethod.upload.tool=maple_upload
-genericSTM32F103V.menu.upload_method.DFUUploadMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER 
+#genericSTM32F103V.menu.upload_method.DFUUploadMethod.build.upload_flags=-DSERIAL_USB -DGENERIC_BOOTLOADER 
+genericSTM32F103V.menu.upload_method.DFUUploadMethod.build.upload_flags=-DGENERIC_BOOTLOADER 
 genericSTM32F103V.menu.upload_method.DFUUploadMethod.build.vect=VECT_TAB_ADDR=0x8002000
 genericSTM32F103V.menu.upload_method.DFUUploadMethod.build.ldscript=ld/stm32f103veDFU.ld
 genericSTM32F103V.menu.upload_method.DFUUploadMethod.upload.usbID=1EAF:0003
@@ -710,7 +711,8 @@
 genericSTM32F103V.menu.upload_method.STLinkMethod=STLink
 genericSTM32F103V.menu.upload_method.STLinkMethod.upload.protocol=STLink
 genericSTM32F103V.menu.upload_method.STLinkMethod.upload.tool=stlink_upload
-genericSTM32F103V.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
+#genericSTM32F103V.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DSERIAL_USB -DGENERIC_BOOTLOADER
+genericSTM32F103V.menu.upload_method.STLinkMethod.build.upload_flags=-DCONFIG_MAPLE_MINI_NO_DISABLE_DEBUG=1 -DGENERIC_BOOTLOADER
 
 genericSTM32F103V.menu.upload_method.BMPMethod=BMP (Black Magic Probe)
 genericSTM32F103V.menu.upload_method.BMPMethod.upload.protocol=gdb_bmp
diff -ur /tmp/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/boards.h .platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/boards.h
--- /tmp/.platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/boards.h	2018-09-10 00:47:42.666729301 +0300
+++ .platformio/packages/framework-arduinoststm32/STM32F1/cores/maple/boards.h	2018-09-09 23:37:16.210005273 +0300
@@ -168,7 +168,12 @@
  * @brief Feature test: nonzero iff the board has SerialUSB.
  */
  //Roger Clark. Change so that BOARD_HAVE_SERIALUSB is always true, so that it can be controller by -DSERIAL_USB
-#define BOARD_HAVE_SERIALUSB 1
+#ifdef SERIAL_USB // amelkin for gtm32
+  #warning "SERIAL_USB is set!"
+  #define BOARD_HAVE_SERIALUSB 1
+#else
+  #warning "SERIAL_USB is not set!"
+#endif
 
 /*(defined(BOARD_USB_DISC_DEV) && defined(BOARD_USB_DISC_BIT))*/
 
diff -ur /tmp/.platformio/platforms/ststm32/builder/frameworks/arduino/maple/stm32f1.py .platformio/platforms/ststm32/builder/frameworks/arduino/maple/stm32f1.py
--- /tmp/.platformio/platforms/ststm32/builder/frameworks/arduino/maple/stm32f1.py	2018-09-10 00:48:13.150172460 +0300
+++ .platformio/platforms/ststm32/builder/frameworks/arduino/maple/stm32f1.py	2018-09-10 00:12:46.564431530 +0300
@@ -76,7 +76,7 @@
 if upload_protocol not in ("dfu", "serial"):
     env.Append(CPPDEFINES=[
         ("CONFIG_MAPLE_MINI_NO_DISABLE_DEBUG", 1),
-        "SERIAL_USB",
+#        "SERIAL_USB",
         "GENERIC_BOOTLOADER"
     ])

@thinkyhead
Copy link
Member

@AlexanderAmelkin — Is that a universal solution for all STM32F1, or only applicable to your STM32F103VE?

As an aside, Geeetech is working on getting Marlin working well on their STM32 boards so they can move away from Smartto. I'm not sure how much longer it will be before they share their work with us.

@Mr-xRed
Copy link

Mr-xRed commented Sep 10, 2018

Geeetech is working as a Smartto alternative for the users. They don’t want to move away from Smartto, just want to offer multiplatform compatibility for their board/printer.

@thinkyhead
Copy link
Member

I see! Well, perhaps in future years they'll decide it's easier to maintain a single firmware. I'm sure Smartto is very good, but it probably doesn't receive as much love as this project.

@AlexanderAmelkin
Copy link
Contributor

@thinkyhead, this is a universal solution for any STM32F1 board NOT using PA11/PA12 for USB Serial. So it is not universal actually. I personally find it utterly dumb to hard-code such things as certain function configurations or presence of certain peripherals on certain pins (or at all), such as this USB Serial thing or the error LED. But, alas! PlatformIO people apparently think different. ;)

That my patch is just for reference. It wasn't indended as production grade (otherwise it would be a pull request).

@AlexanderAmelkin
Copy link
Contributor

AlexanderAmelkin commented Sep 11, 2018

@thinkyhead, there is just one thing that is good about Smartto - it doesn't use any monstrous frameworks. It's purely CMSIS and SPL based. So it's a lot easier to understand and build. This very same thing is also its con: you can't use it on anything but STM32 (but that's fine with me).

However, Smartto looks very feature-limited.

@AlexanderAmelkin
Copy link
Contributor

After all this time and a number of updates to stm32duino, I still can't make PA11 work. Updates to stm32duino really enabled PA12 and it works as expected, but PA11 just doesn't react to any values in GPIOA ODR, always staying low, IIRC.

I have checked CRL (MODE, CNF bits), even changed AFIO_MAPR bits 13:14 to remap CAN1 away from PA11. Didn't help. If anyone has any clues, I'd appreciate that.

@chepo92
Copy link
Contributor Author

chepo92 commented Apr 28, 2020

Sorry, in 2018 I went on a long trip around the world...
Axis always worked for me
https://github.com/chepo92/Marlin/tree/GTM32VB

By disabling JTAG I meant:
https://github.com/chepo92/Marlin/blob/GTM32VB/Marlin/src/pins/pins_GTM32_PRO_VB.h
#define DISABLE_DEBUG
#define DISABLE_JTAG
#define DISABLE_JTAGSWD

Let's see how is this working with current Marlin code, last time I used the rostock and made this PR I had issues with the delta parameters and thermistor values.

@chepo92
Copy link
Contributor Author

chepo92 commented Apr 28, 2020

I also wasn't very expert using github, as I mentioned, #11177 had the corrections, but I did a mess with my base branch and trying to sync with the upstream

@chepo92
Copy link
Contributor Author

chepo92 commented Apr 28, 2020

the final workaround I did in 2018 was 3a479e7
In Marlin/src/Marlin.cpp

#if MB(BOARD_GTM32_PRO_VB)
afio_cfg_debug_ports(AFIO_DEBUG_NONE);
#endif

@AlexanderAmelkin
Copy link
Contributor

have checked CRL (MODE, CNF bits), even changed AFIO_MAPR bits 13:14 to remap CAN1 away from PA11. Didn't help. If anyone has any clues, I'd appreciate that.

Just to let everyone know. I found out that the reason was in burnt PA11 pin on my STM32. I think it got burned because my kids were moving the carets on a turned off printer and there are no diodes that would protect from reverse current.

Anyway, replacing the MCU didn't help as the board is made of extremely low quality materials and all pads went off during resoldering. A new board's price at Geeetech is inadequately high for this quality and this amount of features, so I decided to go with BigTreeTech's SKR Pro v1.1. Thus I'm not interested in GTM32 Pro VB anymore.

Thanks everyone for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: Boards/Pins T: HAL & APIs Topic related to the HAL and internal APIs.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants