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

[FR] MKS Robin (STM32) support #9771

Closed
userosos opened this issue Feb 23, 2018 · 71 comments
Closed

[FR] MKS Robin (STM32) support #9771

userosos opened this issue Feb 23, 2018 · 71 comments
Labels
T: Feature Request Features requested by users.

Comments

@userosos
Copy link

Hi everyone!
Will marlin work with MKS Robin?

@thinkyhead thinkyhead changed the title work MKS Robin on STM32 [FR] MKS Robin (STM32) support Feb 23, 2018
@thinkyhead thinkyhead added T: Feature Request Features requested by users. C: Boards/Pins T: HAL & APIs Topic related to the HAL and internal APIs. labels Feb 23, 2018
@thinkyhead
Copy link
Member

thinkyhead commented Feb 23, 2018

We'll add it to the "to do" list. Thanks for visiting!

@washeree
Copy link

Cant wait for it. I think so many people stuck with their fw. Thank you.

@vivian-ng
Copy link
Contributor

I found this reverse engineered pinout for the MKS Robin while trying to find a solution, wonder if it will be of help to those trying to write a version of Marlin for it.
https://docs.google.com/spreadsheets/d/1xn-nZW4KOSEYWt05clBIl1fS5pS82zgXlpCp8Voftiw/edit#gid=0

Got it from this thread on RepRap.org:
https://reprap.org/forum/read.php?13,716774,page=3

@alexxy
Copy link
Contributor

alexxy commented Jun 19, 2018

I can create pinout files for MKS Robin, but i cannot test it.

So if someone with board can test i can do it

And display will not work it seems

@washeree
Copy link

i already flashed my board while i was trying to dump fw so i can be victim no problem 👍 Why do you think display wont work?

@alexxy
Copy link
Contributor

alexxy commented Jun 19, 2018

because this type of display seems not supported by marlin.

what type of stm32 is on Robin?

@washeree
Copy link

May be in future display can work. I think so its a TFT32 with ribbon connector. Its a F103ZET6.

@alexxy
Copy link
Contributor

alexxy commented Jun 20, 2018

yep, but display code running on same controller (not on separate one as on TFT24/32)

@washeree
Copy link

Can we assign different display such as RepRapDiscount Full Graphic Smart Controller?

@vivian-ng
Copy link
Contributor

Has there been any luck on getting Marlin to work with the MKS Robin?

@gerleimarci
Copy link

And what about MKS Robin Lite?

@pen25
Copy link

pen25 commented Sep 18, 2018

i ordered two and will be shipping 1 to scott. just got them in and will ship 1 to scott sometime this week. will probably wait until friday since he is headed to makerfair nyc this weekend.

@imrj
Copy link

imrj commented Nov 13, 2018

hey guys any update on this? just got me an MKS robin board, would love to try it out with Marlin!!

@jmz52
Copy link
Contributor

jmz52 commented Dec 17, 2018

@washeree,
Original bootloader for MKS Robin (STM32F103ZET6) can be downloaded from https://reprap.org/forum/read.php?13,716774,839792#msg-839792

You can connect 'RepRapDiscount Smart Controller' or 'MKS MINI 12864' to MKS Robin, but the 'RepRapDiscount Full Graphic Smart Controller' is not supported for STM32F1 HAL yet.
http://3dtoday.ru/upload/main/bba/bba66777a72d90df6aeaf7ff0ea514ba.jpg

@pen25
Copy link

pen25 commented Dec 17, 2018

I can say Scott just moved. So don't know what the status is. I figured he would get to it when he got to it. I still haven't tried it in its stock form yet. But I'm lazy

@imrj
Copy link

imrj commented Jan 4, 2019

So can I just flash mine using Marlin 2.0 and platform.io and use the STM32F1 Hall? I can take care of the pins assignment from a spreadsheet I have that has all the pins definition for Robin....

@vivian-ng
Copy link
Contributor

@imrj How about creating your own pins file for the MKS Robin to give it a try?
I think you can follow the idea here. If it works, you can then send a pull request for it to be added into the 2.0 branch.

@jmz52
Copy link
Contributor

jmz52 commented Jan 4, 2019

@imrj, MKS Robin has it's own build environment in platformio.ini file - "mks_robin", it has the right HAL and encryption feature to use Marlin with original MKS bootloader (i.e. install/update Markin from SD card)
Problem is that recent changes messed with configuration examples and STM32F1 HAL, so right now bugfix-2.0.x does not work on MKS Robin.
Also these is an open pull request #12782 to add support for SD card on SDIO interface used on Robin board.

There is no need to write your own pins file - Marlin/src/pins/pin_MKS_ROBIN.h already contains pins definition for MKS Robin board. Add #define MOTHERBOARD BOARD_MKS_ROBIN in your Configuration.h to use it.

If you want to try Marlin 2.0 you can use code from Implement-SDIO-support-for-STM32F1
and replace files
Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.cpp
Marlin/src/HAL/HAL_STM32F1/watchdog_STM32F1.h
by
watchdog_STM32F1.cpp
watchdog_STM32F1.h

Configuration.h and Configuration_adv.h should be copied from Marlin/src/config/examples/Mks/Robin

This will get you the funtionality Marlin will have once SDIO code is merged and STM32F1 HAL is fixed.
MKS Robin TFT is used to display standard graphics 12864 UI - https://ibb.co/0sbJKXT
Please note that you will need encoder to get access to menu.
Once Marlin is compiled, look for Robin.bin in .pioenvs\mks_robin directory. You need to copy this file to SD card for firmware update. And yes, you can go back to original firmware after you've installed Marlin from SD card.

Alternatively you can use code from MKS-Robin-Touch-POC
It is already had Configuration.h and Configuration_adv.h setup for MKS Robin.
Along with support of on-board SD card this code provides you three on-screen buttons to access menu, and colored screen that indicates print progress (PRINTER_EVENT_LEDS feature). Or you can use M150 to set screens' color.
https://ibb.co/p1Z9Q2K
Screen's color here is actually green - an indication of completed print from SD card.

If you have wiped your bootloader you can either flash bootloader using file linked in my earlier comment, or remove the "extra_scripts" line from "[env:mks_robin]" section of platform.ini. Without "extra_scripts" option the marlin firmware will be compiled to use with no bootloader, just flash the firmware.bin using STLink.

Update 1: Implement-SDIO-support-for-STM32F1 merged into bugfix-2.0.x. Main repository should be used for no-touch-screen configuration.

Update 2: MKS Robin uses SPI2 to access touch screen controller.
You need to update file .platformio\packages\framework-arduinoststm32\STM32F1\libraries\SPI\src\SPI.cpp - change SPIClass SPI(1); to SPIClass SPI(2);

@Sneakers82
Copy link

Sneakers82 commented Jan 8, 2019

@jmz52, Thank you so much for bringing Marlin to the MKS Robin! I tried building Marlin for MKS Robin from MKS-Robin-Touch-POC However, I get the immediate error of

Error: Unknown board ID 'genericSTM32F103ZE'

I know this is a supported board, so I don't know what I'm doing wrong.

If I use the AutoBuild suggested by Marlin, the build gets a little farther, however, I noticed it's building for genericSTM32F103RE.

@jmz52
Copy link
Contributor

jmz52 commented Jan 8, 2019

@Sneakers82, you need to update STM32 packages used by PlatformIO.
One way to do it is to remove .platformio\platforms\ststm32 from your user's environment directory to force PlatformIO to download latest version.

Also you need to update file .platformio\packages\framework-arduinoststm32\STM32F1\libraries\SPI\src\SPI.cpp - change SPIClass SPI(1); to SPIClass SPI(2);
MKS Robin uses SPI2 to access touch screen controller.

What version of MKS Robin board and MKS Robin TFT you have?
Mine are v2.4 and TFT_v2.0, so this is what have been tested so far. Robin v2.3 with TFT_v1.1 has different (meaning - incompatible) LCD controller and different Touch Screen connection.
I am working on this but code is not ready to be pushed to GitHub yet.

@Sneakers82
Copy link

@jmz52, Thanks! That worked perfectly!

I don't have the board yet. My Geeetech A30 died some time ago and I was digging through the Marlin firmware to find a suitable replacement board and the MKS Robin seemed like the perfect replacement. I was just trying to make sure I could build Marlin before ordering the board.
Thanks again for your help!

@washeree
Copy link

@jmz52 nice work really, thanks a lot. It was a big news for everyone i think so. My board is v2.3 and tft as you said v1.1 so bootloader is different or same? In my opinion they changed some pins?

@jmz52
Copy link
Contributor

jmz52 commented Jan 11, 2019

@washeree, bootloader v2.3 might be different, but pins are the same - all revisions of MKS Robin use the same firmware. There should not be any problems with older versions of bootloader. And I have a confirmation that v2.4 bootloader is working on v2.3 board.

MKS-Robin-Touch-POC updated to support ili9328 controller found in TFT v1.1.
There are two sets of touch screen calibration parameters in Marlin\src\HAL\HAL_STM32F1\xpt2046.h
one for TFT v2.0 (default) and another one for TFT v1.1.

You might calibrate your touch screen using this "calibration tool"
It will also show you what LCD controller is installed in your display module.
Please let me know if controller is not the ili9328.

@washeree
Copy link

washeree commented Jan 11, 2019

@jmz52 Thanks a lot for your help jmz52, some how i couldnt compile marlin via vs code with pio. It gaves lots of errors. Im installing atom now lets see if it make differences. I compiled with Atom with errors now i have Robin.bin. Btw i flash it with your bootloader by stlink and copy robin original fw files to sd card now im getting on screen completed message thats all nothing else. Really interesting :)

@jmz52
Copy link
Contributor

jmz52 commented Jun 19, 2019

@0bey
You need to remove U8glib-HAL from lib_ignore in platformio.ini file. It really should not be there for MKS Robin, but this line keeps getting back over and over again.

Configuration files for MKS Robin are located in https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x/config/examples/Mks/Robin.
Configuration files you were trying to use are for different code base - https://github.com/jmz52/Marlin/tree/MKS-Robin-Touch-POC. This code is a bit outdated proof-of-concept and is not part of main Marlin repository. Configuration files from this branch are not fully compatible with main Marlin repository.

@0bey
Copy link

0bey commented Jun 20, 2019

Hey @jmz52

I use official source, use exemple configuration.h et configuration_adv.h for mks_robin and U8glib-HAL
Compilation it's OK :)

Thx for help

Now, I learn to configure before try on my alphawise U20

@CodeKartonka
Copy link

CodeKartonka commented Jun 22, 2019

Hi, sorry i have absolutly no idea what i do here :-) but i need only Marlin 2.0 on my Robin 2.3 Board :-)
I Hope the community here can help me out to get it worked:

  • Atom and PlatformIO installed. (got a Welcome to PlatformIO)
  • Clang 3.9.1 for Windows (64-bit) installed with select “Add LLVM to the system PATH” option on the installation step
  • https://github.com/makerbase-mks/MKS-Robin -> clone or download button to get master zip file
  • extract/copy out "MKS-Robin/MKS Robin/firmware/Marlin2.0-MKS-Robin/" to a new Folder on Dektop as "RobinSDCARD"
  • Open in Atom "Welcome to PlatformIO Home" with Open project Folder "Desktop\RobinSDCARD\Marlin2.0-MKS-Robin"
  • press PlatformIO:Build an got error with U8glib-HAL (many of them)
  • klick on platformio.ini and strg+f "U8glib-HAL" found 5 what now?

lib_ignore = U8glib LiquidCrystal_I2C LiquidCrystal NewliquidCrystal LiquidTWI2 Adafruit NeoPixel TMCStepper Servo(STM32F1) TMC26XStepper U8glib-HAL c1921b4

at 347 shlould i delete only this one? i tried it and got after save same U8Glib-Hal fails.

@0bey how do u get it work? did i miss a step?

@0bey
Copy link

0bey commented Jun 22, 2019

This morning I use same source without problem
@androwolf did you try without U8glib-HAL from platformio.ini like say jmz52 ?

@CodeKartonka
Copy link

CodeKartonka commented Jun 22, 2019

only find and delete? "U8glib-HAL"
5x

i got now:

In file included from Marlin\src\HAL\HAL_STM32F1\HAL.cpp:36:0:
C:\Users\Kartonka\.platformio\packages\framework-arduinoststm32\STM32F1\libraries\SPI\src/SPI.h:167:15: warning: '_spi3_this' defined but not used [-Wunused-variable]
static void (*_spi3_this);
^~~~~~~~~~
C:\Users\Kartonka\.platformio\packages\framework-arduinoststm32\STM32F1\libraries\SPI\src/SPI.h:165:15: warning: '_spi2_this' defined but not used [-Wunused-variable]
static void (*_spi2_this);
^~~~~~~~~~
C:\Users\Kartonka\.platformio\packages\framework-arduinoststm32\STM32F1\libraries\SPI\src/SPI.h:164:15: warning: '_spi1_this' defined but not used [-Wunused-variable]
static void (*_spi1_this);
^~~~~~~~~~
C:\Users\Kartonka\.platformio\packages\framework-arduinoststm32\STM32F1\libraries\SPI\src/SPI.h:163:16: warning: 'ff' defined but not used [-Wunused-variable]
static uint8_t ff = 0XFF;
^~
In file included from Marlin\src\HAL\HAL_STM32F1\HAL.cpp:34:0:
Marlin\src\HAL\HAL_STM32F1\HAL.h:188:12: warning: 'int freeMemory()' defined but not used [-Wunused-function]
static int freeMemory() {
^~~~~~~~~~

and more many other files :-) can upload a full log file but where?

@CodeKartonka
Copy link

This morning I use same source without problem
@androwolf did you try without U8glib-HAL from platformio.ini like say jmz52 ?

i think i have something not installed or missed? sad that there not a list what tools or programm i need to build this robin.bin xD

@1kemanciii
Copy link

https://ibb.co/g6rchg7

SD Card not ready :((

@caothai
Copy link

caothai commented Jul 8, 2019

@1kemanciii
i have same problem with you, mks robin v 2.2, tft v1.1R,
no SD card

@boelle boelle removed C: Boards/Pins T: HAL & APIs Topic related to the HAL and internal APIs. labels Jul 21, 2019
@3Dangel
Copy link
Contributor

3Dangel commented Jul 29, 2019

I finally got it to work with the SD card.
the pins-Mks-Robin.h was not complete
I added the remaining Pins and deactivated the SD-Detect_pin

I downloaded the firmware from Makerbase's github.

so now, I can manually mount the SD card and "print" (no yet mounted onto my printer) from SD card.
Mks-Robin V2.1
Robin TFT V1.0 R0

thank you @jmz52 you have a lot of input in this project and I red a lot form your posts.

below is my portion of pins_MKS-Robin.h

//#define SD card
#define SD_DETECT_PIN      -1//PF12
#define SDSS                 PD2    //PF12 // was missing

  #define SCK_PIN          PC12
  #define MISO_PIN        PC8
  #define MOSI_PIN        PD2
  #define SS_PIN                 -1   // Chip select for SD card used by Marlin
  #define ONBOARD_SD_CS    PC11 

@caothai
Copy link

caothai commented Jul 30, 2019

Thank you @jmz52 for all your code and 3Dangel with sd card
now , i can use mks robin with sd card

@3Dangel
Copy link
Contributor

3Dangel commented Jul 30, 2019 via email

@thinkyhead
Copy link
Member

  #define SCK_PIN          P12

What is P12 supposed to actually be?

@tpruvot
Copy link
Contributor

tpruvot commented Aug 5, 2019

thinkyhead added a commit that referenced this issue Aug 5, 2019
@pen25
Copy link

pen25 commented Aug 5, 2019 via email

@3Dangel
Copy link
Contributor

3Dangel commented Aug 6, 2019

hello guys,
you were right... I missed the "c".
It is PC12.

I think the dev had the board on hand to get things going thus far....
grateful for what has been accomplished so far!!!

@daniyo27
Copy link

daniyo27 commented Aug 7, 2019

@jmz52 I have compiled the Marlin version of yours and it gave a file of 147kb. I flashed it and it just kept getting stuck at Booting -- Complete.

I tried flashing back to stock firmware and it now also is stuck at Complete after rebooting. I have tried flashing the bootloader file you have... (renaming as Robin.bin?) and still same result.

All fixed with a different SD card going back to stock, however compiled Marlin is still not working.

@jfkerekes
Copy link

jfkerekes commented Aug 9, 2019

THIS IS RESOLVED... WAS A PIN CONFLICT - Hi Guys, I have an MKS Robin Mini that I have been able to successfully compile Marlin 2.0 and flash to the board. Everything works.... X, Y, Z all move as expected.. SD works, touch screen works, Hot End and bed both heat... the only issue I am having is that I cannot get the Extruder to move. No matter how I try, Pronterface or Octoprint control interface or just printing... everything moves as it should but the Extruder will not feed any filament. There is no clicking, whining or squealing to indicate like low stepper motor current or anything, just no movement at all. If I flash back to the MKS firmware it works fine and I can print no problem, but when I flash marlin back all works but the Extruder motor. I cannot find anything in Configuration.h, configuration_adv.h, or MKS_ROBIN_MINI_Pins.h that stands out as the issue. Can you provide any help at all on this?

As a point of interest, I contacted the printer support to see if they had any info and the tech there had the same exact result with the same printer using a Robin Mini... everything works but the E Stepper motor.

@github-actions
Copy link

github-actions bot commented Jul 4, 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 Jul 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T: Feature Request Features requested by users.
Projects
None yet
Development

No branches or pull requests