grblHAL / STM32F4xx

grblHAL driver for ST STM32F4xx (Nucleo-64, Blackpill)
Other
93 stars 86 forks source link

error: expected identifier #83

Closed duinzicht8 closed 2 years ago

duinzicht8 commented 2 years ago

Hi,

jan@jan-LubuntuESP32:~/STM32F4xx$ /home/jan/.platformio/penv/bin/platformio run --environment nucleo_f446re_protoneer Processing nucleo_f446re_protoneer (board: nucleo_f446re; platform: ststm32; framework: stm32cube)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_f446re.html PLATFORM: ST STM32 (15.4.1) > ST Nucleo F446RE HARDWARE: STM32F446RET6 180MHz, 128KB RAM, 512KB Flash DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink) PACKAGES:

Environment Status Duration


nucleo_f446re_protoneer FAILED 00:00:02.573 =========================================== 1 failed, 0 succeeded in 00:00:02.573 =========================================== jan@jan-LubuntuESP32:~/STM32F4xx$

terjeio commented 2 years ago

Is the core version out of sync with the driver?

duinzicht8 commented 2 years ago

All downloaded today

jan@jan-LubuntuESP32:~$ git clone https://github.com/grblHAL/STM32F4xx.git

Cloning into 'STM32F4xx'... remote: Enumerating objects: 1156, done. remote: Counting objects: 100% (570/570), done. remote: Compressing objects: 100% (98/98), done. remote: Total 1156 (delta 503), reused 493 (delta 472), pack-reused 586 Receiving objects: 100% (1156/1156), 1.96 MiB | 6.48 MiB/s, done. Resolving deltas: 100% (723/723), done.

jan@jan-LubuntuESP32:~$ cd STM32F4xx

jan@jan-LubuntuESP32:~/STM32F4xx$ cp -R ~/STM32F4xx/core/* ~/STM32F4xx/grbl

jan@jan-LubuntuESP32:~/STM32F4xx$ /home/jan/.platformio/penv/bin/platformio run --list-targets

Environment Group Name Title Description


nucleo_f446re_protoneer Platform upload Upload

nucleo_f446re_morpho_cnc Platform upload Upload

btt_skr_2_tmc5160 Platform upload Upload

btt_skr_pro_1_1 Platform upload Upload

fysetc_s6_tmc2209 Platform upload Upload

fysetc_s6 Platform upload Upload

btt_skr_2_tmc2130 Platform upload Upload

nucleo_f411re_protoneer Platform upload Upload

blackpill_f411ce Platform upload Upload

nucleo_f411re_morpho_cnc Platform upload Upload

jan@jan-LubuntuESP32:~/STM32F4xx$ /home/jan/.platformio/penv/bin/platformio run --environment nucleo_f446re_protoneer

Processing nucleo_f446re_protoneer (board: nucleo_f446re; platform: ststm32; framework: stm32cube)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_f446re.html PLATFORM: ST STM32 (15.4.1) > ST Nucleo F446RE HARDWARE: STM32F446RET6 180MHz, 128KB RAM, 512KB Flash DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink) PACKAGES:

Environment Status Duration


nucleo_f446re_protoneer FAILED 00:00:02.655 =========================================== 1 failed, 0 succeeded in 00:00:02.655 =========================================== jan@jan-LubuntuESP32:~/STM32F4xx$

terjeio commented 2 years ago

Ok, there is a bug lurking after all - it shows up when there is no spindle PWM output defined in the map file. Sorry for not catching that earlier.

Change these lines:

https://github.com/grblHAL/STM32F4xx/blob/d4b3e9ce126e198a8a444957fb2a247ee664cdbe/Src/driver.c#L1224-L1229

to:

    } else {
        if(pwmEnabled)
            hal.spindle.set_state((spindle_state_t){0}, 0.0f);
#endif // SPINDLE_PWM_TIMER_N
        hal.spindle.set_state = spindleSetState;
#ifdef SPINDLE_PWM_TIMER_N
    }
#endif
duinzicht8 commented 2 years ago

I think it works now!

jan@jan-LubuntuESP32:~/STM32F4xx$ /home/jan/.platformio/penv/bin/platformio run --environment nucleo_f446re_protoneer

Processing nucleo_f446re_protoneer (board: nucleo_f446re; platform: ststm32; framework: stm32cube)

Verbose mode can be enabled via -v, --verbose option CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_f446re.html PLATFORM: ST STM32 (15.4.1) > ST Nucleo F446RE HARDWARE: STM32F446RET6 180MHz, 128KB RAM, 512KB Flash DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink) PACKAGES:

Environment Status Duration


nucleo_f446re_protoneer SUCCESS 00:00:02.602 ================================================ 1 succeeded in 00:00:02.602 ================================================

jan@jan-LubuntuESP32:~/STM32F4xx$ /home/jan/.platformio/penv/bin/platformio run -v -e nucleo_f446re_protoneer --target upload

Processing nucleo_f446re_protoneer (board: nucleo_f446re; board_build.ldscript: STM32F411CEUX_FLASH.ld; build_flags: -I ., -I FatFS, -I Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc, -I Middlewares/ST/STM32_USB_Device_Library/Core/Inc, -I USB_DEVICE/Target, -D OVERRIDE_MY_MACHINE, -D BOARD_PROTONEER_3XX=, -D NUCLEO_F446=; lib_deps: bluetooth, grbl, keypad, laser, motors, odometer, spindle, Core, Class, App, Target, eeprom; lib_extra_dirs: ., FatFS, Middlewares/ST/STM32_USB_Device_Library, USB_DEVICE; upload_protocol: stlink; platform: ststm32; platform_packages: framework-stm32cubef4 @ ~1.26.2; framework: stm32cube; lib_archive: False; lib_ldf_mode: off)

CONFIGURATION: https://docs.platformio.org/page/boards/ststm32/nucleo_f446re.html PLATFORM: ST STM32 (15.4.1) > ST Nucleo F446RE HARDWARE: STM32F446RET6 180MHz, 128KB RAM, 512KB Flash DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink) PACKAGES:

Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Info : clock speed 2000 kHz
Info : STLINK V2J33M25 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.266711
Info : stm32f4x.cpu: Cortex-M4 r0p1 processor detected
Info : stm32f4x.cpu: target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f4x.cpu on 3333
Info : Listening on port 3333 for gdb connections Info : Unable to match requested speed 2000 kHz, using 1800 kHz Info : Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x0801ccfc msp: 0x20020000
Info : Unable to match requested speed 8000 kHz, using 4000 kHz Info : Unable to match requested speed 8000 kHz, using 4000 kHz
Programming Started
Info : device id = 0x10006421
Info : flash size = 512 kbytes
Info : Flash write discontinued at 0x080001c4, next section at 0x08008000
Programming Finished
Verify Started
Verified OK
Resetting Target
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
shutdown command invoked
=============================================== [SUCCESS] Took 12.39 seconds ===============================================

Environment Status Duration


btt_skr_pro_1_1 IGNORED btt_skr_2_tmc2130 IGNORED btt_skr_2_tmc5160 IGNORED fysetc_s6 IGNORED fysetc_s6_tmc2209 IGNORED nucleo_f411re_morpho_cnc IGNORED nucleo_f411re_protoneer IGNORED nucleo_f446re_morpho_cnc IGNORED nucleo_f446re_protoneer SUCCESS 00:00:12.387 blackpill_f411ce IGNORED ================================================ 1 succeeded in 00:00:12.387 ================================================ jan@jan-LubuntuESP32:~/STM32F4xx$