Error uploding Marlin onto LPC1768 SKR 1.3 Board

So I have been stuck for a few days here, mind you this is my first board programming with platformIO but I have gone through everything I can think of. I keep getting this error when trying to upload my Marlin config to a BIGTREE TECH SKR 1.3 board:

"
Unable to find destination disk (a bytes-like object is required, not ‘str’)
Please select it in platformio.ini using the upload_port keyword (Redirecting...) or copy the firmware (.pio/build/LPC1768/firmware.bin) manually to the appropriate disk

Looking for upload disk…
Error: Please specify upload_port for environment or use global --upload-port option.
"

The IDE is detecting the board as you can see here

Here are the relevant parts of the .ini file.

[platformio]
src_dir      = Marlin
build_dir    = .pioenvs
lib_dir      = .plotlib
libdeps_dir  = .piolibdeps
boards_dir   = buildroot/share/PlatformIO/boards
default_envs = LPC1768


    # NXP LPC176x ARM Cortex-M3
#
[env:LPC1768]
platform          = https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/master.zip
framework         = arduino
# I added upload_port =COM[9] after autodetect failed to work
upload_port = COM[9]
board             = nxp_lpc1768
build_flags       = -DTARGET_LPC1768 -DU8G_HAL_LINKS  -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags}
# debug options for backtrace
#  -funwind-tables
#  -mpoke-function-name
lib_ldf_mode      = off
lib_compat_mode   = strict
extra_scripts     = Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py
src_filter        = ${common.default_src_filter} +<src/HAL/HAL_LPC1768>
monitor_speed     = 250000
lib_deps          = Servo
  LiquidCrystal
  U8glib-HAL=https://github.com/MarlinFirmware/U8glib-HAL/archive/bugfix.zip
  TMCStepper@<1.0.0
  Adafruit NeoPixel=https://github.com/p3p/Adafruit_NeoPixel/archive/master.zip
  SailfishLCD=https://github.com/mikeshub/SailfishLCD/archive/master.zip

Update I was able to flash directly to the onboard SD Card by changing the
upload_port =COM[9]
to
upload_port = E:/

However, I am still confused as to why the original method did not work.

Since it seems that the default upload_protocol is mbed… does the mbed upload type support specifying a serial port? The fact that the error message indicates it’s looking for a disk (not a serial port) suggests that could be the problem? Otherwise, whilst I would have done COM9 since it’s not a range, COM[9] should still have been accepted.

Marlin uses the script Marlin/src/HAL/HAL_LPC1768/upload_extra_script.py to locate the operating system drive that is the LPC1768 based SD card. For it to find the correct drive It looks for one of two things. A file called FIRMWARE.CUR in the root of the file system or a volume name of “REARM” If it find either of these it uses that drive.

2 Likes

dude i was beating my head aginst a wall for like 3 hours before i saw your explaition 1min and 48 seconds later got my sd card flashed with firmware thank you

I honestly pulled an all nighter trying to flash my sd card then I found this and had it done in a minute.

1 Like