2018-11-22 08:14 PM
I upgraded my CubeMX to 5.0.0 and installed F4 1.22.0 firmware recently.
So, I tried to use CubeMX build a TouchGFX Project that use TrueSTUDIO as IDE.Since I was successful run a STemWin Project as my custom F429IGx board graphic solution.
In order to enable TouchGFX middleware in CubeMX, I activated and configured FreeRTOS, CRC, LTDC, DMA2D, TIM7 and FMC-SDRAM1.All setting were the same with my previous STemWin project, excepted in GRAPHICS I used TouchGFX as Graphics Framework. And then I generated code.
1. When opened the project, there were *.c , *.cpp , *.h and *.hpp files. But in C/C++ Build - Tool Setting , neither C++ Compiler and C++ Linker existed. So if I build the project under this settings, I will get a link error say something like main function undefined. Because main function is in main.cpp file and wound't be compile by GCC like other cpp files.
2. So I converted the project to C++ project, by using File - New - Convert to a C/C++ Project (Adds C/C++ nature) method. Now the C++ Compiler showed up and C++ Linker replaced C Linker.I built the project again, but a ton of error message like head files couldn't find show up. I fixed by copied and changed include path from C compiler directories to C++ compiler.But things not go well,some directories in Project Resources Manager's Includes still in grey which implicate those directories did not exist in that location.
3. Then I use TouchGFX Designer to generated a simple project which is only contains a single screen of a text and a background image.After code generation, I put the entire folder in TrueSTUDIO project's root. Now the "Includes" didn't has grey directories any more.I dragged all the cpp files which is generated by TouchGFX Designer into TrueSTUDIO project path [Application-User-TouchGFX-generated|gui].Things going in here is a bit out of my ability, since I am new in TouchGFX and new in mixin C(GCC) and C++(G++) code together.
4. I tried out lots of combination of Assembler, C Complier, C++ Complier, C++ Linker settings which mention in TouchGFX website.I can't describe all of them.The best result I can get is all c files compile into *.o successfully by GCC and all C++ files compile into *.o successfully by G++, but when executed
arm-atollic-eabi-g++ -o LC-MC001.elf *.o ...
command,which as we know is linking, tons of error show up.
d:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: LC-MC001.elf uses VFP register arguments, Application\User\Core\main.o does not
d:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Application\User\Core\main.o
d:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: error: LC-MC001.elf uses VFP register arguments, Application\User\TouchGFX\generated\ApplicationFontProvider.o does not
d:/program files (x86)/atollic/truestudio for stm32 9.0.0/armtools/bin/../lib/gcc/arm-atollic-eabi/6.3.1/../../../../arm-atollic-eabi/bin/ld.exe: failed to merge target specific data of file Application\User\TouchGFX\generated\ApplicationFontProvider.o
...
5. The last information about this I can find is related to floating point implementation? I already tried to switch all implementation to HW or SW the same time.But no luck.
UPDATE
6. I switch Assembler, C compiler, C++ compiler, C++ Linker floating point option to Hardware implementation.And remove -mfloat-abi=softfp parameter which is recommend by this article:
https://touchgfx.zendesk.com/hc/en-us/articles/206116381-Using-other-IDEs-with-TouchGFX
So, after that, all of the processor will have a united floating point setting. Then put SysTick_Handler function back into stm32f4xx_it.c file. Finally, my project build without any error for the first time.
7. I download the program in my board. Sadly, I got this.
And my original design is below.
I will keep you update if any further information.
Thanks for your reading, I know it's a very long problem description.:face_with_tears_of_joy:
Solved! Go to Solution.
2018-12-13 01:58 PM
Thank you for that advice! I did that and everything compiled!
Now, during linking, I'm getting a large number of multiple definition errors:
make all
Building target: Test_SW4STM33.elf
Invoking: MCU G++ Linker
arm-none-eabi-g++ -mcpu=cortex-m7 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -L"C:\Users\Administrator\workspace\Test_SW4STM33\Middlewares\ST\TouchGFX\touchgfx\lib\core\cortex_m7\gcc" -specs=nosys.specs -specs=nano.specs -T"../STM32F746NGHx_FLASH.ld" -Wl,-Map=output.map -Wl,--gc-sections -fno-exceptions -fno-rtti -o "Test_SW4STM33.elf" @"objects.list" -l:libtouchgfx-float-abi-hard.a -lm
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `touchgfx::OSWrappers::initialize()':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:18: multiple definition of `touchgfx::OSWrappers::initialize()'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:18: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `touchgfx::OSWrappers::takeFrameBufferSemaphore()':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:30: multiple definition of `touchgfx::OSWrappers::takeFrameBufferSemaphore()'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:25: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `touchgfx::OSWrappers::giveFrameBufferSemaphore()':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:36: multiple definition of `touchgfx::OSWrappers::giveFrameBufferSemaphore()'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:29: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `touchgfx::OSWrappers::tryTakeFrameBufferSemaphore()':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:42: multiple definition of `touchgfx::OSWrappers::tryTakeFrameBufferSemaphore()'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:34: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `touchgfx::OSWrappers::giveFrameBufferSemaphoreFromISR()':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:48: multiple definition of `touchgfx::OSWrappers::giveFrameBufferSemaphoreFromISR()'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:39: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `touchgfx::OSWrappers::signalVSync()':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:54: multiple definition of `touchgfx::OSWrappers::signalVSync()'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:49: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `touchgfx::OSWrappers::waitForVSync()':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:63: multiple definition of `touchgfx::OSWrappers::waitForVSync()'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:60: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `touchgfx::OSWrappers::taskDelay(unsigned short)':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:74: multiple definition of `touchgfx::OSWrappers::taskDelay(unsigned short)'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:69: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `vApplicationStackOverflowHook':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:104: multiple definition of `vApplicationStackOverflowHook'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:91: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `vApplicationMallocFailedHook':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:110: multiple definition of `vApplicationMallocFailedHook'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:97: first defined here
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.o: In function `vApplicationIdleHook':
C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers_cmsis.cpp:115: multiple definition of `vApplicationIdleHook'
Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.o:C:\Users\Administrator\workspace\Test_SW4STM33\Debug/../Middlewares/ST/TouchGFX/touchgfx/os/OSWrappers.cpp:102: first defined here
collect2.exe: error: ld returned 1 exit status
make: *** [Test_SW4STM33.elf] Error 1
makefile:92: recipe for target 'Test_SW4STM33.elf' failed
15:55:40 Build Finished (took 1s.567ms)
Anyone have any ideas how to fix this?
2018-12-13 02:57 PM
Hi Nick, do you mind explaining briefly your workflow with workbench, cubemx and touchgfx? Thanks, I am stuck trying to get something to work on my 429 board. Thanks
2018-12-13 03:45 PM
I think this is all.
I still have problem with getting nonGUI task to gain some time from scheduler: seems GUI task hogging it. I tried to increase defaultTask's priority but it did not help. I was thinking in meantime to make sure ChromART is activated but have not tried this yet. Just to make sure, I tried same project in IAR with same outcome: defaultTask is on hold.
2018-12-13 03:48 PM
make sure your linker has path to touchgfx library. I don;t remember doing this myself.
on other hand, it seems you have more than one object file with references to touchgfx library content
2018-12-13 07:42 PM
I've added this path for linker: ../Middlewares/ST/TouchGFX/touchgfx/lib/core/cortex_m7/gcc
2018-12-13 07:53 PM
Hi @PPiar and @Clark Sann
If you use SW4STM32 of TrueSTUDIO as the toolchain/IDE.
Try to NOT select the "under the root" checkbox in CubeMX project manager.
Project structure use "Advanced".
Delete all files and directories you generated previously.
And generate code through CubeMX again.
I also post other information in this link
https://community.st.com/s/question/0D50X0000A4q22HSQQ/custom-pcb-using-tgfx
I hope that will give you some help.
2018-12-13 08:40 PM
full list of excluded from build files:
/Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/driver/touch/SDL2TouchController.cpp
/Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2_icon.cpp
/Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/hal/simulator/sdl2/HALSDL2.cpp
/Middlewares/ST/TouchGFX/touchgfx/framework/source/platform/hal/simulator/sdl2/OSWrappers.cpp
/TouchGFX/simulator/*.*
/TouchGFX/simulator/msvs/*.*
/TouchGFX/simulator/gcc/*.*
2018-12-13 09:03 PM
I have no luck with TRUE studio so far.
BTW: how to disable interrupts while in step debugging mode? IAR has such menu option, I don't see anything like that in STM32, but I suspect there should be command to gdb/openocd/STLink, right?
2018-12-13 09:34 PM
I've figured how to make GUI task to let other tasks to work for me: I simply moved GRAPHICS_MainTask() call to separate task:
void StartGuiTask(void const * argument)
{
/* Graphic application */
GRAPHICS_MainTask();
}
2018-12-14 03:08 PM
Thanks Nick. I will try that.