V2 firmware on MKS rumba32

Good morning

This is the first time I have used Visual Studio Code and Platformie.
I have been trying to write V2 firmware to MKS Rumba32 for many days.
I get these errors:

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

Processing RUMBA32 (platform: ststm32; framework: arduino; board: RUMBA32_F446VE)
-----------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
PLATFORM: ST STM32 8.0.0 > 3D Printer control board
HARDWARE: STM32F446RET6 180MHz, 128KB RAM, 512KB Flash
DEBUG: Current (blackmagic) External (blackmagic, jlink, stlink)
PACKAGES:
 - framework-arduinoststm32 4.10900.200819 (1.9.0)
 - framework-cmsis 2.50501.200527 (5.5.1)
 - tool-dfuutil 1.9.200310
 - toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 11 compatible libraries
Scanning dependencies...
Dependency Graph
|-- <SPI> 1.0
|-- <IWatchdog> 1.0.0
|-- <Wire> 1.0
|-- <TMCStepper> 0.6.1
|   |-- <SoftwareSerial> 1.0
|   |-- <SPI> 1.0
Building in release mode
Compiling .pio\build\RUMBA32\FrameworkArduino\stm32\usb\usbd_desc.c.o
Compiling .pio\build\RUMBA32\FrameworkArduino\wiring_analog.c.o
Compiling .pio\build\RUMBA32\FrameworkArduino\wiring_digital.c.o
Compiling .pio\build\RUMBA32\FrameworkArduino\wiring_pulse.cpp.o
C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb\usbd_desc.c:46:4: error: #error "USB VID or PID not specified"
   46 |   #error "USB VID or PID not specified"
      |    ^~~~~
In file included from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_core.h:30,
                 from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb\usbd_desc.c:21:
C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32\usb\usbd_desc.c:160:10: error: 'USBD_PID' undeclared here (not in a 
function); did you mean 'USBD_VID'?
  160 |   LOBYTE(USBD_PID),           /* idProduct */
      |          ^~~~~~~~
C:\Users\mauro\.platformio\packages\framework-arduinoststm32\system\Middlewares\ST\STM32_USB_Device_Library\Core\Inc/usbd_def.h:275:32: note: in definition of macro 'LOBYTE'
  275 | #define LOBYTE(x)  ((uint8_t)((x) & 0x00FFU))
      |                                ^
*** [.pio\build\RUMBA32\FrameworkArduino\stm32\usb\usbd_desc.c.o] Error 1
============================================================ [FAILED] Took 5.58 seconds ============================================================

Environment               Status    Duration
------------------------  --------  ------------
due                       IGNORED
dueUSB                    IGNORED
megaatmega2560            IGNORED
adafruit_grandcentral_m4  IGNORED
stacker_3d_superboard     IGNORED
RUMBA32                   FAILED    00:00:05.584
======================================================= 1 failed, 0 succeeded in 00:00:05.584 =======================================================Il processo del terminale "C:\Users\mauro\.platformio\penv\Scripts\platformio.exe 'run'" è stato terminato. Codice di uscita: 1.

Terminale verrà riutilizzato dalle attività, premere un tasto qualsiasi per chiuderlo.

Comments

  • Loks like the STM library has changed and now required VID and PID. Please check platformio.ini line 87 should look like

    build_flags   = ${common.build_flags} -DSTM32F4xx -DARDUINO_RUMBA32_F446VE -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"RUMBA32_F446VE\"" -DSTM32F446xx -DUSBCON -DUSBD_VID=0x8000 -DUSBD_PID=0x5711 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"RUMBA32_F446VE\"" -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DSERIAL_RX_BUFFER_SIZE=256 -DSERIAL_TX_BUFFER_SIZE=256 -Os

    I added
    -DUSBD_PID=0x5740

    and with that it compiles. Hope it works as I can not access a rmba32 at the moment.
  • Good morning
    Which VID and PID should I use, that of the STM32 BOATLOADER or the COM port?

    Now I get these errors:
    > Executing task: C:\Users\mauro\.platformio\penv\Scripts\platformio.exe run <

    Processing RUMBA32 (platform: ststm32; framework: arduino; board: RUMBA32_F446VE)
    -----------------------------------------------------------------------------------------------------------------------------------------------------Verbose mode can be enabled via `-v, --verbose` option
    PLATFORM: ST STM32 8.0.0 > 3D Printer control board
    HARDWARE: STM32F446RET6 180MHz, 128KB RAM, 512KB Flash
    DEBUG: Current (blackmagic) External (blackmagic, jlink, stlink)
    PACKAGES:
     - framework-arduinoststm32 4.10900.200819 (1.9.0)
     - framework-cmsis 2.50501.200527 (5.5.1)
     - tool-dfuutil 1.9.200310
     - toolchain-gccarmnoneeabi 1.90201.191206 (9.2.1)
    LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 11 compatible libraries
    Scanning dependencies...
    Dependency Graph
    |-- <SPI> 1.0
    |-- <IWatchdog> 1.0.0
    |-- <Wire> 1.0
    |-- <TMCStepper> 0.6.1
    |   |-- <SoftwareSerial> 1.0
    |   |-- <SPI> 1.0
    Building in release mode
    Compiling .pio\build\RUMBA32\src\boards\STM32F4\HAL.cpp.o
    Compiling .pio\build\RUMBA32\src\communication\Eeprom.cpp.o
    Compiling .pio\build\RUMBA32\src\communication\GCodes.cpp.o
    Compiling .pio\build\RUMBA32\src\communication\MCodes.cpp.o
    src\boards\STM32F4\HAL.cpp: In static member function 'static void HAL::hwSetup()':
    src\boards\STM32F4\HAL.cpp:311:91: error: no matching function for call to 'HardwareTimer::setPWM(int, PinName, int, int, void (&)(HardwareTimer*), void (&)(HardwareTimer*))'
      311 |     servo->timer->setPWM(1, NC, 200, 50, TIMER_VECTOR_NAME(SERVO_TIMER_NUM), servoOffTimer);
          |                                                                                           ^
    In file included from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/analog.h:45,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/board.h:8,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:41,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
                     from src/boards/pins.h:4,
                     from src/Configuration.h:154,
                     from src/Repetier.h:210,
                     from src\boards\STM32F4\HAL.cpp:27:
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:115:10: note: candidate: 'void HardwareTimer::setPWM(uint32_t, PinName, uint32_t, uint32_t, callback_function_t, callback_function_t)'
      115 |     void setPWM(uint32_t channel, PinName pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr); // Set all in one command freq in HZ, Duty in percentage. Including both interrup.
          |          ^~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:115:108: note:   no known conversion for argument 5 from 'void(HardwareTimer*)' to 'callback_function_t' {aka 'std::function<void()>'}
      115 |     void setPWM(uint32_t channel, PinName pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr); // Set all in one command freq in HZ, Duty in percentage. Including both interrup.
          |                                                                                        ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
    In file included from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/analog.h:45,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/board.h:8,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:41,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
                     from src/boards/pins.h:4,
                     from src/Configuration.h:154,
                     from src/Repetier.h:210,
                     from src\boards\STM32F4\HAL.cpp:27:
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:116:10: note: candidate: 'void HardwareTimer::setPWM(uint32_t, uint32_t, uint32_t, uint32_t, callback_function_t, callback_function_t)'
      116 |     void setPWM(uint32_t channel, uint32_t pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr);
          |          ^~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:116:109: note:   no known conversion for argument 5 from 'void(HardwareTimer*)' to 'callback_function_t' {aka 'std::function<void()>'}
      116 |     void setPWM(uint32_t channel, uint32_t pin, uint32_t frequency, uint32_t dutycycle, callback_function_t PeriodCallback = nullptr, callback_function_t CompareCallback = nullptr);
          |                                                                                         ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
    src\boards\STM32F4\HAL.cpp: In static member function 'static void HAL::setupTimer()':
    src\boards\STM32F4\HAL.cpp:344:73: error: no matching function for call to 'HardwareTimer::attachInterrupt(void (&)(HardwareTimer*))'
      344 |     motion2->timer->attachInterrupt(TIMER_VECTOR_NAME(MOTION2_TIMER_NUM));
          |                                                                         ^
    In file included from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/analog.h:45,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/board.h:8,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:41,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
                     from src/boards/pins.h:4,
                     from src/Configuration.h:154,
                     from src/Repetier.h:210,
                     from src\boards\STM32F4\HAL.cpp:27:
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:134:10: note: candidate: 'void HardwareTimer::attachInterrupt(callback_function_t)'
      134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover)
          |          ^~~~~~~~~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:134:46: note:   no known conversion for argument 1 from 'void(HardwareTimer*)' to 'callback_function_t' {aka 'std::function<void()>'}
      134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover)
          |                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:138:10: note: candidate: 'void HardwareTimer::attachInterrupt(uint32_t, callback_function_t)'
      138 |     void attachInterrupt(uint32_t channel, callback_function_t callback); // Attach interrupt callback which will be called upon compare match event of specified channel
          |          ^~~~~~~~~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:138:10: note:   candidate expects 2 arguments, 1 provided
    src\boards\STM32F4\HAL.cpp:354:65: error: no matching function for call to 'HardwareTimer::attachInterrupt(void (&)(HardwareTimer*))'
      354 |     pwm->timer->attachInterrupt(TIMER_VECTOR_NAME(PWM_TIMER_NUM));
          |                                                                 ^
    In file included from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/analog.h:45,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/board.h:8,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:41,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
                     from src/boards/pins.h:4,
                     from src/Configuration.h:154,
                     from src/Repetier.h:210,
                     from src\boards\STM32F4\HAL.cpp:27:
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:134:10: note: candidate: 'void HardwareTimer::attachInterrupt(callback_function_t)'
      134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover) 
          |          ^~~~~~~~~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:134:46: note:   no known conversion for argument 1 from 'void(HardwareTimer*)' to 'callback_function_t' {aka 'std::function<void()>'}
      134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover) 
          |                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:138:10: note: candidate: 'void HardwareTimer::attachInterrupt(uint32_t, callback_function_t)'
      138 |     void attachInterrupt(uint32_t channel, callback_function_t callback); // Attach interrupt callback which will be called upon compare match event of specified channel
          |          ^~~~~~~~~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:138:10: note:   candidate expects 2 arguments, 1 provided 
    src\boards\STM32F4\HAL.cpp:364:73: error: no matching function for call to 'HardwareTimer::attachInterrupt(void (&)(HardwareTimer*))'
      364 |     motion3->timer->attachInterrupt(TIMER_VECTOR_NAME(MOTION3_TIMER_NUM));
          |                                                                         ^
    In file included from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino\stm32/analog.h:45,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/board.h:8,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/wiring.h:41,
                     from C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/Arduino.h:36,
                     from src/boards/pins.h:4,
                     from src/Configuration.h:154,
                     from src/Repetier.h:210,
                     from src\boards\STM32F4\HAL.cpp:27:
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:134:10: note: candidate: 'void HardwareTimer::attachInterrupt(callback_function_t)'
      134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover)
          |          ^~~~~~~~~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:134:46: note:   no known conversion for argument 1 from 'void(HardwareTimer*)' to 'callback_function_t' {aka 'std::function<void()>'}
      134 |     void attachInterrupt(callback_function_t callback); // Attach interrupt callback which will be called upon update event (timer rollover) 
          |                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:138:10: note: candidate: 'void HardwareTimer::attachInterrupt(uint32_t, callback_function_t)'
      138 |     void attachInterrupt(uint32_t channel, callback_function_t callback); // Attach interrupt callback which will be called upon compare match event of specified channel
          |          ^~~~~~~~~~~~~~~
    C:\Users\mauro\.platformio\packages\framework-arduinoststm32\cores\arduino/HardwareTimer.h:138:10: note:   candidate expects 2 arguments, 1 provided
    *** [.pio\build\RUMBA32\src\boards\STM32F4\HAL.cpp.o] Error 1
    ============================================================ [FAILED] Took 10.92 seconds ============================================================
    Environment               Status    Duration
    ------------------------  --------  ------------
    due                       IGNORED
    dueUSB                    IGNORED
    megaatmega2560            IGNORED
    adafruit_grandcentral_m4  IGNORED
    stacker_3d_superboard     IGNORED
    RUMBA32                   FAILED    00:00:10.915
    ======================================================= 1 failed, 0 succeeded in 00:00:10.915 =======================================================Il processo del terminale "C:\Users\mauro\.platformio\penv\Scripts\platformio.exe 'run'" è stato terminato. Codice di uscita: 1.




    platformio.ini

    ; PlatformIO Project Configuration File
    ;
    ;   Build options: build flags, source filter
    ;   Upload options: custom upload port, speed and extra flags
    ;   Library options: dependencies, extra library storages
    ;   Advanced options: extra scripting
    ;
    ; Please visit documentation for the other options and examples
    ;
    ; IMPORTANT: Use PlatformIO Core 4.0.0 or newer!

    [platformio]
    ; Select here the environment you want to compile
    ; Arduino Due based
    ;     due, dueUSB, stacker_3d_superboard
    ; AVR based (8 bit)
    ;     megaatmega2560
    ; SAMD51 based
    ;     adafruit_grandcentral_m4
    ; STM32 based
    ;     RUMBA32
    default_envs = RUMBA32
    ; env_default = stacker_3d_superboard
    ; lib_deps = 
    ; Set upload port if autodetect does not work
    ; upload_port = COM1
    [common]
    ; Default monitor speed for testing
    default_src_filter = +<*> -<boards>
    build_flags = -fmax-errors=5
      -g
      -ggdb

    ; Properties shared with all envs if not overridden
    [env]
    monitor_speed = 115200

    [env:due]
    platform = atmelsam
    board = due
    framework = arduino
    src_filter = ${common.default_src_filter} +<boards/due>
    debug_tool = jlink
    monitor_speed = 115200

    [env:dueUSB]
    platform = atmelsam
    board = dueUSB
    framework = arduino
    src_filter = ${common.default_src_filter} +<boards/due>
    debug_tool = jlink
    monitor_speed = 115200

    ; upload_protocol = jlink-jtag
    ; any port that starts with /dev/ttyUSB
    ;upload_port = /dev/ttyUSB*
    ; COM1
    ;upload_port = COM1

    [env:megaatmega2560]
    platform = atmelavr
    board = megaatmega2560
    framework = arduino
    src_filter = ${common.default_src_filter} +<boards/avr>

    [env:adafruit_grandcentral_m4]
    platform = atmelsam
    board = adafruit_grandcentral_m4
    src_filter = ${common.default_src_filter} +<boards/SAMD51>
    upload_protocol = sam-ba
    framework = arduino
    monitor_speed = 115200
    debug_tool = jlink

    [env:stacker_3d_superboard]
    platform = atmelsam
    board = stacker_3d_superboard
    framework = arduino
    src_filter = ${common.default_src_filter} +<boards/due>
    monitor_speed = 115200

    [env:RUMBA32]
    platform      = ststm32
    framework     = arduino
    board         = RUMBA32_F446VE
    ; *** Originale ** build_flags   = ${common.build_flags} -DSTM32F4xx -DARDUINO_RUMBA32_F446VE -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"RUMBA32_F446VE\"" -DSTM32F446xx -DUSBCON -DUSBD_VID=0x8000 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"RUMBA32_F446VE\"" -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DSERIAL_RX_BUFFER_SIZE=256 -DSERIAL_TX_BUFFER_SIZE=256 -Os
    build_flags   = ${common.build_flags} -DSTM32F4xx -DARDUINO_RUMBA32_F446VE -DARDUINO_ARCH_STM32 "-DBOARD_NAME=\"RUMBA32_F446VE\"" -DSTM32F446xx -DUSBCON -DUSBD_VID=0x8000 -DUSBD_PID=0x5711 "-DUSB_MANUFACTURER=\"Unknown\"" "-DUSB_PRODUCT=\"RUMBA32_F446VE\"" -DHAL_PCD_MODULE_ENABLED -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB -DHAL_UART_MODULE_ENABLED -DSERIAL_RX_BUFFER_SIZE=256 -DSERIAL_TX_BUFFER_SIZE=256 -Os
    src_filter    = ${common.default_src_filter} +<boards/STM32F4>
    upload_protocol = dfu
  • I see. Version 8 of stm seems to have changed some methods causing all these troubles. Please leave me a week or so to fix them so they work on new version. Also that will make it not work with older versions, but a update can fix that problem. But with all these changes I better check this with my board.
  • OK thanks
  • In the mean time, downgrading the STM32 library from v8 to V6.1.1 helps avoiding the USB vid error. (Trying to get Rumba32 working for a Cartesian dual extrusion printer with BLTouch)
Sign In or Register to comment.