2019-07-10 07:47 AM
Hi everyone!
I am able to successfully create a new Makefile project in a directory containing existing code. It work seamlessly and I am able to build the code without a hitch but when I try to debug the actual hardware target (e.g. STM32L072RBTx) I hit a brick wall and I don't know how to proceed further.
When I launch the "Debug Configurations" dialog, I get an error dialog: "Project setup issue: Not able to get mcu target. Reason: Build configuration is not valid. Described mcu target is not supported". See attached screenshot:
How do I specify the HW target (after creating a Makefile project)? Any hints / tips / links would be much appreciated!
Thanks in advance,
Pieter
Solved! Go to Solution.
2019-07-11 01:33 AM
Hi Pieter,
Here is how I dealt with Makefile project for your reference:
https://github.com/ethanhuanginst/STM32CubeIDE-Workshop-2019/tree/master/hands-on/02_stm32_hp141_lcd
NOTE: This was tested over STM32CubeIDE v.1,0.0 and not tested over the latest v1.0.1.
2019-07-10 08:21 AM
Hi, not a specialist with make projects. I think you will still need a startupfile.s, linkerfile and you have to generate an .elf file with highest debug options and no optimization.
The link command from my tests with a project:
arm-none-eabi-g++ -o "AProPrinterGUI.elf" @"objects.list" $(USER_OBJS) $(LIBS) -mcpu=cortex-m7 -T"../STM32F746NG_FLASH.ld" --specs=nosys.specs -Wl,-Map="AProPrinterGUI.map" -Wl,--gc-sections -static -L../Middlewares/ST/TouchGFX/touchgfx/lib/core/cortex_m7/gcc --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -lstdc++ -lsupc++ -Wl,--end-group
The .elf creation
post-build:
arm-none-eabi-objcopy.exe -O ihex "AProPrinterGUI.elf" "AProPrinterGUI.hex"
-@echo ' '
My best guess is they get it from the .elf file. I hope this helps.
2019-07-10 10:15 AM
Hi @hands56,
Sorry if I did not make this clear. My project build successfully and generates an ELF file. This is not the problem.
My problem is that I am unable to get debugging working. For that I have to specify the HW target somewhere in the IDE. The IDE is complaining that it is "unable to get the MCU target".
So this is more of a support question for the STM32CubeIDE development team, unless someone already knows how to do this.
Best regards,
Pieter
2019-07-10 04:01 PM
Even an IDE generated project is a make file project. Where is your .elf reference in the C/C++ Application?
2019-07-11 12:30 AM
Hi @hands56,
I did some more digging. I found that in order to debug STM32 I had to add a project nature:
I'm not very familiar on what a "project nature" is exactly, but it looks like I need it.
I also manually edited the ".cproject" file and updated the following lines to specify the MCU target:
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu.1716657407" name="Mcu" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_mcu" value="STM32L072RBTx" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid.1015595930" name="CpuId" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_cpuid" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid.241682417" name="CpuCoreId" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_coreid" value="0" valueType="string"/>
<option id="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board.1761731627" name="Board" superClass="com.st.stm32cube.ide.mcu.gnu.managedbuild.option.target_board" value="genericBoard" valueType="string"/>
This made the error dialog go away and an "STM32 MCU Debugging" configuration appeared:
Success! I can program and debug my target hardware.
I did notice this though:
Manually editing the ".cproject" file feels like a dirty hack to me and not sustainable long term. I am going to create a new thread question where I try to solve it using a different approach by creating an STM32 project and trying to change it from a Managed CDT project nature to an unmanaged Makefile project nature.
Regards,
Pieter
P.S. If someone finds this question and found an elegant solution, please post here.
2019-07-11 01:33 AM
Hi Pieter,
Here is how I dealt with Makefile project for your reference:
https://github.com/ethanhuanginst/STM32CubeIDE-Workshop-2019/tree/master/hands-on/02_stm32_hp141_lcd
NOTE: This was tested over STM32CubeIDE v.1,0.0 and not tested over the latest v1.0.1.
2019-07-11 05:09 AM
Hi Ethan,
Your answer is perfect, thanks :) FYI, I got to a similar solution and posted it here:
Best regards,
Pieter