-
-
Notifications
You must be signed in to change notification settings - Fork 19.3k
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
[BUG] STM32F103VET6 and software serial #15873
Comments
So, I found answer to both questions. For first one, in STM32F1 HAL of lastest Marlin version softwareserial.cpp is dummy, inside it there is a following text:
And really, downloading Fysetc library and placing it into Marlin\src\HAL\HAL_STM32F1\ does everything I wanted. And second answer is also "yes". It is possible to bind tx and rx of virtual port to single output. In this case you don't need 1k resistor between tx and rx, simply connect pdn to chosen output and everything will work as it must |
Hey, really glad you posted this. I have the same board and am considering the TMC2208 upgrade as well. Could you upload your new pins files and perhaps photos of how you wired it? I couldn't find any pinout for the life of me. Would be great help! Thanks in advance! |
Several boards specify SoftwareSerialM dependencies in the platformio.ini file. I didn't add it for MKS boards because I didn't have anything to test with. If you add it and it works, I'm sure a pull request would be welcome to help other users who encounter the same problem. |
daniyo27, I can provide file, but it is very tricky to solder wires to controller and 99.9% you'll need to have microscope. Stm32F103 have pins with only 3.3v level and 5v tolerant. All of the pins, that are free and already soldered on board are 3.3v olny. I tried to add protection circuits with dividers or zener diodes, but after it TMCs were not working. So I found out, that part of port F and port A are 5v tolerant and are free, so I tried to solder wires to them, but all of wires were too thick for this task(I didn't want to use single thread wires). The ones on photo were the smallest ones. sjasonsmith, this file was not mine and all I do - I followed instruction in current source file... The person, who write this instuction was able to do this, but didn't do this for some reason... |
Thanks for the photo! Looking at the photo and a pinout, it seems you hooked black wire to VDDA? and Yellow to PA 0, white to PA3, purple to VDD4?, and orange to PA5? They didn't seem to correlate to your pins file... sorry if this is misunderstanding on my part! Couldn't help but to notice that you had the BTT TMC2208 V3 and Fystec TMC2208's... which both seems to have different pinout than the Robin would accept. Specifically the VM rail. Could this be a factor why your chips didn't work? MKS is the only Chinese company that follows this convention... Watterott chips seem to have both... All TMC2208 datasheets for Fystec and MKS show they are 3.3v and 5V logic tolerant... unless you mean the TMC's are powered by 5V and the PC3, PA1, PF9, and PF8 are 3.3V logic only? There seems to be someone with a Robin Nano board that the manufacturer replied to manually wire to the XS1 and XS2 of that board. https://github.com/makerbase-mks/MKS-Robin/issues/146 |
Sorry, send you wrong file, this is correct one: |
Thanks for the additonal info. I just wanted to double check, if I had 4 stepper drivers with TMC2208 I can use the 4 free ports? Do I pull the jumpers for each driver? I noticed when shorted they are connected to VCC. I assume that is 5V? Trying to avoid soldering if I can and use XS1 and XS2. Thanks! |
Yes you can, but, in that way, cut out bottom pins(BTT have pins on top and bottom part of chip for it), that TMCs are using as UART, just to prevent possibility to hit chip with 5v jumper And yes, jumpers are connected to 5v, that's the reason of my modification. I haven't found way to cut 5v and replace it with 3.3v, without affecting other parts of board |
Oh, you mean don't allow the PDN/UART pins go into the socket and only allow it to go to XS1 and XS2. Got it! Do I need to pull any jumpers in Jm4_M2? |
Yes, that's correct! |
Ok! Thank you for the confirmation! Just to confirm, the UART pins do output at 3.3V as long as the pins are not connected in the socket? That's the only confusion I have now as you mentioned XS1 and XS2 are NOT 5V tolerant. Will be doing this mod with TMC2209 when the drivers arrive! Will report back my results here! :) |
As for TMC2209 there is one more thing: they have slave address and you can connect up to 4 of them to single uart port(doesn't matter software or hardware), but I haven't tried it myself. Two remaining jumpers are forming slave address. If you use different pins for RX and TX, you can use zener diode overvoltage protection. |
Just wanted to report back huge success! A big thank you for the helpful hints! Everything was working on the first shot! I was able to desolder the MKS TMC2209 UART pins and flip them around. No need to short the two pins together, MKS had a resistor labelled R8 already populated. I did not choose to go with one wire for everything so I stuck with one per TMC. Also, I removed all the jumpers underneath the drivers. One tip for Vref calibration, the SD card slot metal casing also acts as a ground! Seems like Marlin 2.0.5.1 makes my screen go to blank after the bootscreen. No issues with 2.0.4.4. |
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. |
After successful building of Marlin 2.0 bugfix for MKS Robin (bases on STM32F103VET6), I tried to add TMC2208 UART control. Pins_MKS_Robin don't have uart description, so I copied corresponding part from SKR V1.3 config. As sample I tried to make X stepper working, first with hardware UART, to do it I disabled Wifi serial in configuration.h
#define SERIAL_PORT_2 -1
And uncommented line in pins
#define X_HARDWARE_SERIAL Serial1
Everything worked, so I tried to use software UART. Robin have unused pins in XS1 (PC3 and PA1) and in XS2(PF9 and PF8), choosed XS2 for X. Commented them as servos, disabled hardware serial and enabled software serial
#define X_SERIAL_TX_PIN PF9 #define X_SERIAL_RX_PIN PF8
It compiled, flashed to controller and all I receive "TMC communication error". Tried listening port with usb2com - nothing, measured pins voltage with tester(TX should be pulled up to 1) - both zero. Tried to bind LED to PF9 and PF8 - both working.
Is there something I have to enable first? Or software serial is unavailable for STM32F103?
Attached my Configuration.h(taken with Configuration_adv.h from examples, only change is tmc2208 chose for X and disabled second serial, no changes to Configuration_adv.h ), working pins with hardware serial and not working pins with software ones.
Configuration.zip
pins_MKS_ROBIN_software_serial.zip
pins_MKS_ROBIN_hardware_serial.zip
Second question, if first one can be done, is following: in some boards like "pins_BIGTREE_SKR_E3_DIP.h" pins for rx and tx are the same, but in skr v1.3 these ones are different. Can I combine this pins for Robin?
The text was updated successfully, but these errors were encountered: