2019-05-14 08:00 AM
Here is my current approach to perform flash and run without debug:
With this configuration it is possible to quickly perform build and run by pressing Ctrl+B and then Ctrl+F11. Maybe there are better methods to perform flash and run without debug? Also interested in performing reset without flash using SWD.
2019-05-16 07:39 AM
Hey,
Thank you! This is exactly what i need as well. But i use F7 to Build Project and F9 to flash the firmware to the board. As for reset only, it seems if you give wrong
file path, it will just reset the CPU, but not sure how to assign to separate command/key.
Next super useful feature would be SWO print in the Eclipse Console Tab and flashing the firmware with F7 press, without going through twenty buttons in the STLink Utility, same as when using an UART for printf() debugging.
I always wonder why would implement such good hardware debug feature as ITM debug via SWO pin, but not implement it seamlessly in the IDE.
K.
2019-07-31 11:53 PM
Currently using stm32cube ide 1.0.2 with stm32_programmer_cli.exe (already exists in cubeide directory)
It is not best way, because it flashes each time after build, so trick with "C/C++ Application" may be used (first message).
2019-12-24 01:37 PM
Thank you to the posters above for sharing some input, helping me the find some good workaround.
My setup: I'm using a Segger JLink Programmer which is already supported by CubeIDE but allows programming by debugging only.
My IDE is running in Win10.
For some strange reason CubeIDE does not allow the classic eclipse "Environment" menu ... therefore I'm using the following procedure to flash without debugging:
Preparations
device STM32L052K8
r
#erase
loadfile C:\Users\User1\Documents\git\STM32L052K8_MCU_Extension\STM32L052K8_MCU_Extension\Debug\STM32L052K8_MCU_Extension.hex
r
st
hwinfo
g
q
"C:\Program Files (x86)\SEGGER\JLink\JLink.exe" -device STM32L052K8 -if SWD -speed 12000 -autoconnect 1 -CommanderScript C:\Users\User1\Documents\git\STM32L052K8_MCU_Extension\STM32L052K8_MCU_Extension\flashonly.jlink
Both files reside in the CubeIDE project path and are visible in the Project Explorer.
The flashonly.bat is once selected as "Open With System Editor".
When clicking on the flashonly.bat file afterwards, the .bat file is simply executed, loading the .hex file and flashing it to the target.
2019-12-24 05:44 PM
Good example!
I am wondering maybe there is a way to assign some hotkey to run cmd/bat file in CubeIDE's Eclipse?
Or even an ability to create hotkey + sub-menu to executes batch-like script with access to Eclipse environment parameters.
Currently I use run C/C++ Application trick, and run programmer instead of c/c++ app:
C:\ST\STM32CubeIDE_1.1.0\STM32CubeIDE\plugins\com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.win32_1.1.0.201910081157\tools\bin\STM32_Programmer_CLI.exe
with program arguments set to
-c port=swd -d ${project_loc}\${config_name:${project_name}}\${project_name}.elf -rst
but it need to be written manually for each project
It would be great if any hotkey + sub-menu may be assigned to some script, for example
Ctrl+F11 runs:
some_flash.exe {path_to_flash_file}.hex
some_flash.exe reset
some_tool_gui_to_communicate_with_device {some_parameter_from_eclipse}
Once configured, it may be used for any project name saved in any directory, because {parameters} are replaced with actual values.
Current workarounds with bat/cmd files are still great. When project does not need to be debugged, and you want to see results fast in hardware, doing flash and run is the only option. I think many programmers still using "debug" button to perform flash and run, and then waiting to press "play" button, this procedure certainly wastes some time. When i do flash and run using hotkey, I am free to do next step, for example preparing to run GUI on PC side, or look at oscilloscope screen.
2020-02-14 02:26 PM
Create file makefile.targets at the root of the project:
STM32CubeProgrammer := 'C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin\STM32_Programmer_CLI.exe'
flash: all
-@echo 'Download hex/bin to MCU Flash ...'
# $(STM32CubeProgrammer) -c port=SWD -d $(wildcard *.hex) -Rst
$(STM32CubeProgrammer) -c port=SWD -d $(wildcard *.bin) 0x8000000 -Rst
.PHONY: flash
Click Debug, Release or project folder in Project explorer. Press Shift+F9. Add target "flash". Select new target. Click build. Now you can just press F9.
CubeIDE should have such a command!