2021-02-19 10:56 PM
To end the horrible winter night... even the debugger fails in CubeIDE under Windows.
On the same Windows machine CubeIDE can debug the same target in a Linux VM.
Isn't it curious?
Same error with OpenOCD and ST-LINK GDB server.
Of course, Atollic just works.
Could this be related to failure to convert ELF to any other format?
-- pa
2021-02-20 06:07 AM
2021-02-20 11:53 AM
Well, one mystery less. Failure to load the .elf was because CubeIDE after importing Atollic project could not find the linker script.
So it silently used default layout that starts from address 0. Of course this wasn't gong to work.
The question is now why the linker does not print error message if script file specified with -T parameter cannot be opened.
And why arm-none-eabi-size and objcopy won' run.
-- pa
2021-02-23 08:37 AM
Still struggling to understand why CubeIDE does not not run specified post-build actions.
No bin file and no list file. Only .elf and .map are created.
Using internal builder. Host: Win10 Home v.20H2.
Here is the error log:
!SESSION 2021-02-23 18:24:21.243 -----------------------------------------------
eclipse.buildId=Version 1.5.1
java.version=1.8.0_272
java.vendor=AdoptOpenJDK
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Command-line arguments: -os win32 -ws win32 -arch x86_64
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 4 4 2021-02-23 18:24:34.181
!MESSAGE CubeMX plugin appears to be active, Log4j initialization might be too late.
!ENTRY com.st.stm32cube.ide.mcu.informationcenter 1 1 2021-02-23 18:24:34.223
!MESSAGE Log4j initialized with config file E:\Data\Aero\WS_EVB_CUBEIDE\.metadata\.log4j.xml
!ENTRY com.st.stm32cube.ide.mcu.ide 1 1 2021-02-23 18:24:42.284
!MESSAGE Started RMI Server, listening on port 41337
!ENTRY com.st.stm32cube.ide.mcu.ide 4 4 2021-02-23 18:24:43.055
!MESSAGE com.st.stm32cube.ide.mcu.ide/META-INF/version/build_ref file not found, build reference will not be reported into properties
So I had to make the following scripts and run them as post build actions:
# As postbuild action: sh postbuild.sh ${BuildArtifactFileBaseName}
# Runs in the build directory where the .elf is created
EXENAME=$1
arm-none-eabi-size $EXENAME.elf || exit 1
arm-none-eabi-objcopy -O binary $EXENAME.elf $EXENAME.bin || echo "ERROR convert to bin"
echo "POSTBUILD DONE"
@echo off
:: As postbuild action: cmd /c postbuild.cmd ${BuildArtifactFileBaseName}
:: runs in the build directory where .elf is created
set EXENAME=%1
arm-none-eabi-size %EXENAME%.elf || goto :EOF
arm-none-eabi-objcopy -O binary %EXENAME%.elf %EXENAME%.bin || echo ERROR convert to bin!
call :BIN_size %EXENAME%.bin
echo POSTBUILD DONE
goto :EOF
:BIN_size
echo %~n1%~x1 size=%~z1
goto :EOF
Both sh and cmd versions run successfully and call the ARM toolchain programs.
But I don't know how to get a list file.
Why CubeIDE fails to call the same programs??