SKR V1.3 firmware upload

Hi. I am working on getting the firmware uploaded to my lowrider2 and I don’t know how. I am trying to use the firmware from the discription of Michael’s part 2 video of the lowrider CNC from the YouTube channel Teaching Tech. I just don’t know what files to upload and how to do it. I am using the SKR V1.3 the MKS TFT28 and some cheep generic stepper drivers. I you can help me, please let me know.

I don’t have any experience with the MKS TFT28. Maybe someone else can tell you more.

But basically, you need to get Marlin and configure it for your steppers, your stepper drivers, your LCD, and then some other cnc related things.

Here is Marlin that Ryan publishes:

Start with this version:

https://github.com/Allted/Marlin/archive/MPCNC_Ramps_T8_16T_LCD_32step.zip

Starting with Ryan’s will get a lot of simple settings out of the way. Then you can just change things for your hardware. I’m assuming tt didn’t publish his firmware, right?

That is for a RAMPS board with drv8825 drivers.

What kind of drivers do you have? You’ll need to configure it to work with your drivers.

Youll need to turn off the reprap full graphics display and turn on your display. There might be other settings for your display, I’m not sure.

Making these changes, you’ll be changing the Configuration.h file. You’ll then need to upload using arduino.

You’ll want to wire the double motor axes in series. But we can figure that out once you have everything else figured out.

That’s very little detail on a lot of the process. If you’re new to this, don’t panic. Buying a preflashed board from Ryan is a lot easier. Flashing a configuration that is already configured is also easier. But this is possible. Just remember that you’re not trying to understand a natural system. This is designed by humans to be used by humans and it is possible, although not necessarily easy.

1 Like

Ok. Thanks for the help. TT did publish his firmware and that is what I was trying to get onto my the SD card for the SKR V1.3. I am glad you told me that I have to download arduino that could be what I am doing wrong. The drivers I am using are the DRV8825 stepper drivers. They came with the board. Should I get new ones? And how do I configure the firmware for the stepper drivers?

You’ve got the firmware from here?

That looks like a very good starting place. That is configured for tmc 5160 drivers. And it’s set up for dual drivers. It will use all 5 drivers. Each motor will get their own driver.

There is a section in the Configuration.h file. It chooses a driver type for each motor. In the RAMPS firmware, it looks like this:

In your firmware, it should have a bunch of TMC5160 's in there.

Yes. That is exactly where I’m at. Now I just need to figure you what files to copy onto the SD card for the SKR 1.3. Do you know which ones? I’ve true to copy a few different things to it not I still can’t get the motors running.

Ah. Yeah. So in that zip there is a precompiled binary. But that has built in the TMC5160 configuration. You also can’t use arduino, you need to use platform.io

You need to open the marlin 2.0 folder in platform.io. Then change the Marlin/Configuration.h file for the drv8825 and then build it in platform.io and find where it puts the file to put on the sd card.

Actually I believe there are two parts to deal with. The TFT28 updates via a file on the SD card, remember the MKS TFT series has their own processor and OS onboard. The SKR 1.3 runs Marlin and is updated via the USB port using Arduino. Please correct me if I’m wrong…

Yes, this is correct. I have the files for the mks tft28 on an SD card in it and that works. The thing I can’t figure out how to do is get the firmware for the skr v1.3. thanks for the help.

OK, I don’t have one handy, but flashing it should be the same procedure as with the RAMPS or Rambo. You will need to do the proper edits to the source code in order to change the board type, but there shouldn’t be a lot more needed since the functionality is pretty similar.

Are you sure? It’s a 32 bit board and from what I can tell you put the compiled binary on an sd card and it flashes itself.

1 Like
Do you want to use TMC5160 in combination with SKR 1.3 ?

No. I’m using generic stepper drivers that came with the board.

To use frimware for SKR1.3 in combination with TFT published by channel Teaching Tech you need to modify it to use drv8825 using PlatformIO in VSCode or PlatformIO in Atom
http://marlinfw.org/docs/basics/install_platformio_atom.html http://marlinfw.org/docs/basics/install_platformio_vscode.html After modification you have to compile the file and then you get the firmware which you then place on the SD card; after the reset (on board) the firmware is loaded into board.

guideline
https://www.youtube.com/watch?v=yLm7Yl8_QUU

When I try to compile the TT firmware it atom and VS code throw a improper syntax error and aborts. Marlin bug fix 2.0 vanilla compiles fine. I have been at it for a month now and have gotten to the point where I may just tap out. Some one help!

What is the error?

Compile the TT firmware

Try

Give marlin folder admin rights

in platformio.ini

change env_default = LPC1768 to default_envs = LPC1768 (new version command in platformio)

uncomment extra_scripts = Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py or remove line (calling python script for saving location)

upload_port = /dev/ttyUSB0 change to upload_port = D: (or some drive visible to system)

Hi, I’d like to understand if I have some issues in VS Code because I’m still getting errors on 2 different PCs… does the Teaching Tech firmware works for you?

 

This is what I get when I compile TT firmware with ICT Avatar suggestions

> Executing task: C:\Users\mirko.platformio\penv\Scripts\platformio.exe run <

Can not remove temporary directory c:\MPCNC\marlin 2.0 - mpcnc lowrider2 - skr v1.3 tmc5160.pioenvs. Please remove it manually to avoid build issues
Processing LPC1768 (platform: https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/master.zip; framework: arduino; board: nxp_lpc1768)

Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: https://docs.platformio.org/page/boards/nxplpc-arduino-lpc176x/nxp_lpc1768.html
PLATFORM: NXP Arduino LPC176x 0.1.0 > NXP LPC1768
HARDWARE: LPC1768 100MHz, 31.97KB RAM, 464KB Flash
DEBUG: Current (cmsis-dap) On-board (cmsis-dap) External (blackmagic, jlink)
PACKAGES: toolchain-gccarmnoneeabi 1.80201.190214 (8.2.1), framework-arduino-lpc176x 0.1.3
Converting Marlin.ino
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ strict
Looking for TMCStepper library in registry
Found: https://platformio.org/lib/show/5513/TMCStepper
LibraryManager: Installing id=5513 @ <1.0.0
Using cache: C:\Users\mirko.platformio.cache\4a\00c7fd7875e9cd0a4cf8d7b2771b3c4a
TMCStepper @ 0.6.1 has been successfully installed!
Found 5 compatible libraries
Scanning dependencies…
Dependency Graph
|-- <Servo> 1.0.0
|-- <LiquidCrystal> 1.0.0
|-- <U8glib-HAL> 0.4
|-- <TMCStepper> 0.6.1
|-- <Adafruit NeoPixel> 1.2.4
Building in release mode
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\CHOPCONF.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\COOLCONF.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\DRVCONF.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\DRVCTRL.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\DRVSTATUS.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\DRV_CONF.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\DRV_STATUS.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\ENCMODE.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\GCONF.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\IHOLD_IRUN.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\PWMCONF.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\RAMP_STAT.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\SERIAL_SWITCH.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\SGCSCONF.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\SHORT_CONF.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\SMARTEN.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\SW_MODE.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\SW_SPI.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\TMC2130Stepper.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\TMC2160Stepper.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\TMC2208Stepper.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\TMC2209Stepper.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\TMC2660Stepper.cpp.o
Compiling .pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\TMC5130Stepper.cpp.o
In file included from .piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.h:4,
from .piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.cpp:1:
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.cpp: In member function ‘void SW_SPIClass::init()’:
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\TMC_platforms.h:22:22: error: ‘LPC176x’ has not been declared
#define writeSCK_H LPC176x::delay_ns(40); LPC176x::gpio_set(sck_pin)
^~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.cpp:21:3: note: in expansion of macro ‘writeSCK_H’
writeSCK_H;
^~~~~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\TMC_platforms.h:22:45: error: ‘LPC176x’ has not been declared
#define writeSCK_H LPC176x::delay_ns(40); LPC176x::gpio_set(sck_pin)
^~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.cpp:21:3: note: in expansion of macro ‘writeSCK_H’
writeSCK_H;
^~~~~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.cpp: In member function ‘uint8_t SW_SPIClass::transfer(uint8_t)’:
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\TMC_platforms.h:23:22: error: ‘LPC176x’ has not been declared
#define writeSCK_L LPC176x::delay_ns(40); LPC176x::gpio_clear(sck_pin)
^~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.cpp:26:3: note: in expansion of macro ‘writeSCK_L’
writeSCK_L;
^~~~~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\TMC_platforms.h:23:45: error: ‘LPC176x’ has not been declared
#define writeSCK_L LPC176x::delay_ns(40); LPC176x::gpio_clear(sck_pin)
^~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.cpp:26:3: note: in expansion of macro ‘writeSCK_L’
writeSCK_L;
^~~~~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\TMC_platforms.h:20:23: error: ‘LPC176x’ has not been declared
#define writeMOSI_H LPC176x::gpio_set(mosi_pin)
^~~~~~~
.piolibdeps\LPC1768\TMCStepper_ID5513\src\source\SW_SPI.cpp:30:28: note: in expansion of macro ‘writeMOSI_H’
!!(ulVal & (1 << i)) ? writeMOSI_H : writeMOSI_L;
^~~~~~~~~~~
compilation terminated due to -fmax-errors=5.
*** [.pioenvs\LPC1768\lib563\TMCStepper_ID5513\source\SW_SPI.cpp.o] Error 1
================================================================================================== [FAILED] Took 8.39 seconds ==================================================================================================

Environment Status Duration


megaatmega2560 IGNORED
megaatmega1280 IGNORED
at90usb1286_cdc IGNORED
at90usb1286_dfu IGNORED
DUE IGNORED
DUE_USB IGNORED
DUE_debug IGNORED
LPC1768 FAILED 00:00:08.390
LPC1769 IGNORED
melzi IGNORED
melzi_optiboot IGNORED
rambo IGNORED
sanguino_atmega644p IGNORED
sanguino_atmega1284p IGNORED
STM32F1 IGNORED
STM32F4 IGNORED
ARMED IGNORED
mks_robin IGNORED
black_stm32f407ve IGNORED
teensy35 IGNORED
malyanm200 IGNORED
esp32 IGNORED
fysetc_f6_13 IGNORED
linux_native IGNORED
============================================================================================= 1 failed, 0 succeeded in 00:00:08.390 =============================================================================================
The terminal process terminated with exit code: 1

Terminal will be reused by tasks, press any key to close it.

There’s a bug in the newest version of the tmc driver. Details here: Error: 'LPC176x' has not been declared · Issue #130 · bigtreetech/BIGTREETECH-SKR-V1.3 · GitHub

1 Like

I’m new to this site so if this is redundant I’ll apologize in advance. I’m also a big fan of flexibility and power. No point in going 8 bit when 32 bit is available and applicable. Not to mention cheaper.

The only time I’ve had the error you list is when I’ve had a file in the .pio folder open. When Marlin compiles in VScode it deletes the existing .pio folder and writes a new one. If a file or folder is open it can’t delete the folder so it fails to write/compile.

I agree that the SKR v1.3 is a potentially complicated board to program but imo that makes it move valuable.

I believe the original question was how to update the board once Marlin is compiled. All that is necessary is to copy Firmware.bin and firmware.elf (found in the /pio/build/LPC1768/ folder) to a compatible SD card, insert it into the SKR board and reboot it. The Firmware.bin is changed to Firmware.cur. You can also copy the files using usb once the SKR is configured to show as an attached drive.

As an aside, I love my SKR v1.3. Now that I know that people are using it for the MPCNC and LowRider I’ll go that route. I currently have one installed in my Ender-3 Pro.

My final comment is don’t change a lot of things on this card at one time. There is significant interaction between some settings. Making a bunch of changes at the same time makes trouble shooting much more difficult. In the end, for me at least, is the money. Cheap, quick or good, pick two. I’ve got the time to take cheap and good.

You don’t need the firmware.elf, just the firmware.bin file. The ELF format is in use by several different operating systems. Among others, this includes Linux, Solaris/Illumos, Free-, Net- and OpenBSD, QNX, BeOS/Haiku, and Fuchsia OS [2]. Furthermore, you will find it on mobile devices running Android, Maemo or Meego OS/Sailfish OS as well as on game consoles like the PlayStation Portable, Dreamcast, and Wii…but not ARM-Cortex which the LPC1768 is.