SKR1.4 Turbo COMPILATION ERRORS

Marlin has errors when compiling the code for SKR 1.4 Turbo board, I’m using the modified script below to compile:
Using:

source .venv/bin/activate
src/core/config-for-machine V1CNC_SkrTurbo_2209
src/core/build-for-machine

File V1CNC_SkrTurbo_2209:

#!/bin/bash

set -e

restore_configs
export V1_VERSION=${V1_VERSION}S
$CFGDIR/common/v1-base-config
$CFGDIR/common/cnc-config
$CFGDIR/boards/skr_turbo_1p4
$CFGDIR/accessories/dummy-extruder
$CFGDIR/accessories/tmc2209
$CFGDIR/accessories/reprap_discount_full_graphic_lcd
$CFGDIR/accessories/no-dual-endstops
$CFGDIR/accessories/TFT35_e3_v3_CNC
$CFGDIR/accessories/laser
export PLATFORMIO_ENV=LPC1769

and the compiler gives me the following error:

Marlin/src/feature/../inc/../HAL/./LPC1768/fastio.h:105:35: note: in expansion of macro '_WRITE'
  105 | #define SET_OUTPUT(IO)        do{ _WRITE(IO, _READ(IO)); _SET_OUTPUT(IO); }while(0)
      |                                   ^~~~~~
Marlin/src/feature/../inc/../HAL/./LPC1768/fastio.h:107:31: note: in expansion of macro 'SET_OUTPUT'
  107 | #define SET_PWM               SET_OUTPUT
      |                               ^~~~~~~~~~
Marlin/src/feature/spindle_laser.cpp:81:13: note: in expansion of macro 'SPINDLE_LASER_PWM_PIN'
   81 |     SET_PWM(SPINDLE_LASER_PWM_PIN);
      |             ^~~~~~~~~~~~~~~~~~~~~
In file included from Marlin/src/feature/../inc/MarlinConfigPre.h:39,
                 from Marlin/src/feature/../inc/MarlinConfig.h:28,
                 from Marlin/src/feature/spindle_laser.cpp:27:
Marlin/src/feature/../inc/../../Configuration.h:1:31: error: 'PC9' was not declared in this scope
    1 | #define SPINDLE_LASER_PWM_PIN PC9
      |                               ^~~
Marlin/src/feature/spindle_laser.cpp:82:28: note: in expansion of macro 'SPINDLE_LASER_PWM_PIN'
   82 |     hal.set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), SPINDLE_LASER_PWM_OFF); // Set to lowest speed
      |                            ^~~~~~~~~~~~~~~~~~~~~
Marlin/src/feature/spindle_laser.cpp: In static member function 'static void SpindleLaser::_set_ocr(uint8_t)':
Marlin/src/feature/../inc/../../Configuration.h:1:31: error: 'PC9' was not declared in this scope
    1 | #define SPINDLE_LASER_PWM_PIN PC9
      |                               ^~~
Marlin/src/feature/spindle_laser.cpp:103:28: note: in expansion of macro 'SPINDLE_LASER_PWM_PIN'
  103 |     hal.set_pwm_duty(pin_t(SPINDLE_LASER_PWM_PIN), ocr ^ SPINDLE_LASER_PWM_OFF);
      |                            ^~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -fmax-errors=5.
*** [.pio/build/LPC1769/src/src/feature/spindle_laser.cpp.o] Error 1
In file included from Marlin/src/gcode/calibrate/../../inc/../pins/pins.h:917,
                 from Marlin/src/gcode/calibrate/../../inc/MarlinConfig.h:34,
                 from Marlin/src/gcode/calibrate/G28.cpp:23:
Marlin/src/gcode/calibrate/../../inc/../pins/pins_postprocess.h:540: warning: "Z_MIN_PIN" redefined
  540 |       #define Z_MIN_PIN Z_STOP_PIN
      |
In file included from Marlin/src/gcode/calibrate/../../inc/MarlinConfigPre.h:39,
                 from Marlin/src/gcode/calibrate/../../inc/MarlinConfig.h:28,
                 from Marlin/src/gcode/calibrate/G28.cpp:23:
Marlin/src/gcode/calibrate/../../inc/../../Configuration.h:3363: note: this is the location of the previous definition
 3363 | #define Z_MIN_PIN P1_27
      |
===================================================================== [FAILED] Took 54.65 seconds =====================================================================

Environment    Status    Duration
-------------  --------  ------------
LPC1769        FAILED    00:00:54.649
================================================================ 1 failed, 0 succeeded in 00:00:54.649 ================================================================

can anybody help me?

Are you trying to configure it for a laser?

This looks like the root error:

Marlin/src/feature/spindle_laser.cpp:81:13: note: in expansion of macro 'SPINDLE_LASER_PWM_PIN'
   81 |     SET_PWM(SPINDLE_LASER_PWM_PIN);
      |             ^~~~~~~~~~~~~~~~~~~~~
In file included from Marlin/src/feature/../inc/MarlinConfigPre.h:39,
                 from Marlin/src/feature/../inc/MarlinConfig.h:28,
                 from Marlin/src/feature/spindle_laser.cpp:27:
Marlin/src/feature/../inc/../../Configuration.h:1:31: error: 'PC9' was not declared in this scope
    1 | #define SPINDLE_LASER_PWM_PIN PC9
      |                               ^~~

Your config is trying to set the laser PWM to PC9, and that doesn’t exist for your board (according to the compiler).

Another thing you can try is to change the base marlin version you are using. Are you using a “stable” version like 2.1.1? or one of the bugfix branches?

Are you using a “stable” version like 2.1.1? yes
I’m configuring my board to accept the laser

LASER TREE Máquina de Gravação a Laser, Módulo de Alta Potência, Assistente de Ar com Bocal de Metal, Cabeça TTL para Gravura CNC, Ferramenta de Corte, Faça Você Mesmo, 80W| | - AliExpress

I think the problem is coming from here:

I’m not sure what the pin should be, but setting it there is at least a little confusing. It is probably for the skr pro.

A bunch of your pin names are here:

The turbo pins config just includes this file. There are a few more in skr common…

tanks

I helped someone get their laser working on a SKR Turo in this topic. Pin 2.0 was used for the laser PWM and 4.29 for the enable.

1 Like