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

Open
userosos opened this Issue Feb 23, 2018 · 43 comments

Comments

Projects
None yet
@userosos
Copy link

userosos commented Feb 23, 2018

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

This comment has been minimized.

Copy link
Member

thinkyhead commented Feb 23, 2018

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

@washeree

This comment has been minimized.

Copy link

washeree commented May 24, 2018

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

@vivian-ng

This comment has been minimized.

Copy link

vivian-ng commented Jun 17, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

washeree commented Jun 19, 2018

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

washeree commented Jun 20, 2018

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

@alexxy

This comment has been minimized.

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

This comment has been minimized.

Copy link

washeree commented Jun 20, 2018

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

@vivian-ng

This comment has been minimized.

Copy link

vivian-ng commented Jul 27, 2018

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

@gerleimarci

This comment has been minimized.

Copy link

gerleimarci commented Aug 25, 2018

And what about MKS Robin Lite?

@pen25

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

vivian-ng commented Jan 4, 2019

@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

This comment has been minimized.

Copy link

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

Sneakers82 commented Jan 8, 2019

@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

This comment has been minimized.

Copy link

washeree commented Jan 11, 2019

@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

This comment has been minimized.

Copy link

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

This comment has been minimized.

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 :)

@washeree

This comment has been minimized.

Copy link

washeree commented Jan 11, 2019

@jmz52 my screen is 8239ili

@jmz52

This comment has been minimized.

Copy link

jmz52 commented Jan 11, 2019

@washeree, can you please make a screenshot for me? Looks like x coordinate is inverted.

@washeree

This comment has been minimized.

Copy link

washeree commented Jan 11, 2019

@jmz52

This comment has been minimized.

Copy link

jmz52 commented Jan 11, 2019

@washeree, should be working now. Fortunately that was a bug in calibration tool and the incorrect initialization sequence.

@washeree

This comment has been minimized.

Copy link

washeree commented Jan 12, 2019

@jmz52, so i will setup marlin and then use your calibration tool or still no chance v1.1 lcd working on marlin? Btw thanks a lot for your hard work again.

@jmz52

This comment has been minimized.

Copy link

jmz52 commented Jan 12, 2019

@washeree, MKS-Robin-Touch-POC supports MKS Robin TFT v1.1. You can try calibration parameters for v1.1 that are already present in Marlin\src\HAL\HAL_STM32F1\xpt2046.h (you need to comment v1.1 set of parameters). If these will not be accurate enough for you, use calibration tool to get values for your screen.

Marlin bugfix-2.0.x does not support v1.1 yet. There are several code changes I want to make before submitting pull request.

@washeree

This comment has been minimized.

Copy link

washeree commented Jan 12, 2019

@jmz52 thank you. I made it work, your values on Y axis little bit different then mine. Next week i will try with my p3steel. I wish i can code these things too. Do you have bed temp problem on Robin since i have it it shows 230C? I changed the pin and assign heaters2 to the hotbed now reading 238C, really interesting :)

@jmz52

This comment has been minimized.

Copy link

jmz52 commented Jan 12, 2019

@washeree the bed sensor works fine for me and some other folks who are using Marlin on their Robin boards (v2.4 and v2.3). Are 230 and 238 degrees measured on cold (i.e. room temperature) bed or heated one?
What type of sensor is configured in your Configuration.h file?
Please check if you get -14 degrees when sensor is not connected and TEMP_SENSOR_BED is set to 1.

@washeree

This comment has been minimized.

Copy link

washeree commented Jan 12, 2019

@jmz52 Hotend measuring 38C, my room is 23C. It was same issue when i was using original Robin fw. In Configuration.h file sensor type is 1 and when i dont connect any sensor its measuring same value which is interesting too.

#define TEMP_0_PIN PC1 // TH1
#define TEMP_1_PIN PC0 // TH2
#define TEMP_BED_PIN PC2 // TB1

i changed pins_MKS_ROBIN.h these values but still same.

In Configuration.h i changed #define TEMP_SENSOR_BED 11 now its showing 250 :)

I have chinese 100k NTC 3950 termistors, im using it with ramps with select termistor type 1 but i think so Robin doesnt like them. I checked 6 different termistors with multimeter all fine but results are same.

I connected my e3dv6 semitec termistor now its measuring 215C.

And lastly Dumy_temp working fine.

@PhantomNix

This comment has been minimized.

Copy link

PhantomNix commented Jan 13, 2019

@jmz52 , I've spent the last two days wanting to throw this board against the wall. I'm having trouble compiling, going over and over the steps you took to make it work... Is there possibly something that could go wrong? I've completely reinstalled everything and started with fresh files, without editing them so not sure where I'm messing up.

Got the Robin V2.4 wit V2 TFT

@washeree

This comment has been minimized.

Copy link

washeree commented Jan 13, 2019

@washeree

This comment has been minimized.

Copy link

washeree commented Jan 13, 2019

@jmz52 one last thing robin use which pins while compiling? pins_MKS_ROBIN.h ?

@PhantomNix

This comment has been minimized.

Copy link

PhantomNix commented Jan 13, 2019

@jmz52

This comment has been minimized.

Copy link

jmz52 commented Jan 14, 2019

@PhantomNix I am using PlatformIO with Atom. Were you able to compile Marlin with these?

@washeree, it looks like hardware problems with MCU. Disconnected temperature sensor with type 1 in Configuration.h should give you a -14 degrees. Different Reading you are getting indicate that there is either electrical problems with board (like failed resistors or capacitors or conductive dust) or failed MCU. Since you are getting same reading on all three temperature inputs and you have same reading ion both Marlin and MKS firmware, I suspect that MCU is the the one to blame.

@washeree

This comment has been minimized.

Copy link

washeree commented Jan 15, 2019

thank you @jmz52, i thought same and i checked in front of pin cap and res all are fine then i think MCU pin fried or dust with compressor i clean it and i tried same results. I will look for stm32f1 from china, will swap and reflash then lets see. Tahnk you again.

@regtoy

This comment has been minimized.

Copy link

regtoy commented Jan 26, 2019

Hi, anybody who can help? I have a question
Is it possible to add uart port for TMC2208?
If have, which port can be used for this job

@youprint

This comment has been minimized.

Copy link

youprint commented Feb 18, 2019

Now it works ! Thanks so much jmz52 for your bootloader 👍
https://ibb.co/x86mvxp
Now I'm going to compile Marlin 2.0 and try...

@youprint

This comment has been minimized.

Copy link

youprint commented Feb 18, 2019

Compilation done with success on Atom/plaformio , LCD support great on your repo (POC) !
https://ibb.co/Q6NvMdY
I'm going to try it tomorrow with motors and TMC 2208.
Thanks again jmz !

@boelle

This comment has been minimized.

Copy link
Contributor

boelle commented Feb 20, 2019

@userosos

This Issue Queue is for Marlin bug reports and development-related issues, and we prefer not to handle user-support questions here. (As noted on this page.) For best results getting help with configuration and troubleshooting, please use the following resources:

After seeking help from the community, if the consensus points to to a bug in Marlin, then you should post a bug report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.