Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » 4DIAC Forte Build with FreeRtos
4DIAC Forte Build with FreeRtos [message #1847886] Thu, 11 November 2021 10:39 Go to next message
chen peng is currently offline chen pengFriend
Messages: 25
Registered: November 2021
Junior Member
We are building 4DIAC Forte as a static lib for FreeRtos, and plan to run it in STM32
However, when we modify FreeRtos makefile to load libforte-static.a, many errors come out, please look at attached picture makefileError.PNG
Also Attached lib file libforte-static.a, this is making according to your web course "4diac FORTE for freeRTOS + LwIP"
Can you please check why those errors comes out and how to fix.
Besides, We alse facing an error when we build libforte-static.a, attached makeErrorAboutLib.PNG, we are not sure if those error will affect it, after all, those errors appear after libforte-static.a build.
  • Attachment: PlsHelp.rar
    (Size: 568.32KB, Downloaded 61 times)
Re: 4DIAC Forte Build with FreeRtos [message #1847888 is a reply to message #1847886] Thu, 11 November 2021 12:31 Go to previous messageGo to next message
Jose Maria Jesus Cabral Lassalle is currently offline Jose Maria Jesus Cabral LassalleFriend
Messages: 16
Registered: January 2021
Junior Member
in makeErrorAboutLib.PNG you're building the static library and also an executable which uses the library. In CMAke you can define not to build the executable and only the library. In any case, the error you see there does not affect your library.

Regarding the makefileError.PNG (VFP register arguments) it seems that the forte library was compiled using soft float, while the rest of the files with hard float (I see the flag -mfload-abi=hard). When you compile your forte static library, make sure that you have the same flags set when compiling the whole application.
Re: 4DIAC Forte Build with FreeRtos [message #1847902 is a reply to message #1847888] Fri, 12 November 2021 03:03 Go to previous messageGo to next message
chen peng is currently offline chen pengFriend
Messages: 25
Registered: November 2021
Junior Member
Thanks Jose
So it is different at CFLAG in Makefile right? I build STM32 project in CubeMx and its makefile attached, it shows -mfloat-abi=hard, -mcpu=cortex-m4.

I also try STM32 Makefile -mfloat-abi=soft, and new error ouccurs below,
C:\Users\C00477~1\AppData\Local\Temp\ccNsx1rs.s:531: Error: selected FPU does not support instruction -- `vstmdbeq r0!,{s16-s31}'
C:\Users\C00477~1\AppData\Local\Temp\ccNsx1rs.s:553: Error: selected FPU does not support instruction -- `vldmiaeq r0!,{s16-s31}'

I think I should modify 4DIAC Forte CFLAG option(mfloat-abi) to matching STM32 Makefile.
But where and how to modify CFLAG option for 4DIAC forte, I only find some keyword in CMakeError.log but it obviously not where I should modify.

Plz help, Thanks

[Updated on: Fri, 12 November 2021 08:27]

Report message to a moderator

Re: 4DIAC Forte Build with FreeRtos [message #1847916 is a reply to message #1847902] Fri, 12 November 2021 14:19 Go to previous messageGo to next message
Jonathan Lainer is currently offline Jonathan LainerFriend
Messages: 5
Registered: November 2021
Junior Member
Hello Chen,

in your attached Makefile the option -mfloat-abi is set to soft. I'd change that to hard.

To change the CFLAGS option for the forte build process you can either

  1. pass a toolchain file to CMake or
  2. pass the variables directly to CMake.

When I encountered this problem about half a year ago, I created a simple toolchain file.
I attached this file to this post. Feel free to use it in your project.

Note that this file was created to work on a Linux machine and that you have to adapt the options
to fit your project layout. This is especially true for the options

  • TOOLCHAIN_BIN
  • all CMAKE_C and CMAKE_CXX options
  • the TARGET_PROJECT_ROOT option
  • the definition at the end (insert your device class here)
Re: 4DIAC Forte Build with FreeRtos [message #1847944 is a reply to message #1847916] Mon, 15 November 2021 06:39 Go to previous messageGo to next message
chen peng is currently offline chen pengFriend
Messages: 25
Registered: November 2021
Junior Member
Thanks Jonathan
But How can I pass a toolchain file to CMake or pass the variables directly to CMake.
I just modify CMakeLists.txt under src dir or others in 4DIAC Forte code:
SET(CMAKE_C_FLAGS "-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nano.specs")
SET(CMAKE_CXX_FLAGS "-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -specs=nano.specs")

Then press "Generate" in cmake, then I check CMakeCache.txt, it always show:
CMAKE_CXX_FLAGS:STRING=
CMAKE_C_FLAGS:STRING=

Perhaps my operation is not correct, pls share your method

Re: 4DIAC Forte Build with FreeRtos [message #1847950 is a reply to message #1847944] Mon, 15 November 2021 07:49 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

First of all we tried to provide 4diac FORTE such that you don't need to modify files that we provide. This has the great advantage that you can easily update to newer 4diac FORTE version. To add here as described in the documentation it is also a good idea to have the build directories outside of the 4diac FORTE directory.

Coming to your specific problem: The simplest way to select a toolchain file is to use CMake gui. If that is not possible in your setup you can also provide a toolchain file when calling cmake just from the command line. You can look on the provided shell scripts for reference.

Re: 4DIAC Forte Build with FreeRtos [message #1847951 is a reply to message #1847950] Mon, 15 November 2021 08:17 Go to previous messageGo to next message
chen peng is currently offline chen pengFriend
Messages: 25
Registered: November 2021
Junior Member
Thanks Alois
I will try with latest 4DIAC FORTE version and see if can be easily
Now I' modifying CMakeCache.txt to add CFLAG option(Although this is not good), and those errors(VFP register arguments) doesn't happen now
But I'm faceing below errors, If any friends also encounter this problem, please tell me the solution:
d:/software/arm-none-eabi/10.1.1\libforte-static.a(freertostiha.cpp.obj): in function `CFreeRTOSTimerHandler::CFreeRTOSTimerHandler(CDeviceExecution&)':
freertostiha.cpp:(.text+0x74): undefined reference to `xTimerCreate'
d:/software/arm-none-eabi/10.1.1\libforte-static.a(freertostiha.cpp.obj): in function `CFreeRTOSTimerHandler::~CFreeRTOSTimerHandler()':
freertostiha.cpp:(.text+0xca): undefined reference to `xTimerGenericCommand'
d:/software/arm-none-eabi/10.1.1\libforte-static.a(freertostiha.cpp.obj): in function `CFreeRTOSTimerHandler::enableHandler()':
freertostiha.cpp:(.text+0x120): undefined reference to `xTimerGenericCommand'
d:/software/arm-none-eabi/10.1.1\libforte-static.a(freertostiha.cpp.obj): in function `CFreeRTOSTimerHandler::disableHandler()':
freertostiha.cpp:(.text+0x142): undefined reference to `xTimerGenericCommand'
d:/software/arm-none-eabi/10.1.1\libforte-static.a(freertostiha.cpp.obj): in function `CFreeRTOSTimerHandler::vCallbackFunction(tmrTimerControl*)':
freertostiha.cpp:(.text+0x184): undefined reference to `pvTimerGetTimerID'
d:/software/arm-none-eabi/10.1.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc_nano.a(lib_a-openr.o): in function `_open_r':
openr.c:(.text._open_r+0x10): undefined reference to `_open'
collect2.exe: error: ld returned 1 exit status
Re: 4DIAC Forte Build with FreeRtos [message #1847953 is a reply to message #1847951] Mon, 15 November 2021 08:54 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

have you enabled the timers in freeRTOS?
Re: 4DIAC Forte Build with FreeRtos [message #1847954 is a reply to message #1847953] Mon, 15 November 2021 09:13 Go to previous messageGo to next message
chen peng is currently offline chen pengFriend
Messages: 25
Registered: November 2021
Junior Member
Thanks Alois
I opened timer and now xTimer errors disappear
But Below error still exist:
d:/software/arm-none-eabi/10.1.1/../../../../arm-none-eabi/lib/thumb/v7e-m+fp/hard\libc_nano.a(lib_a-openr.o): in function `_open_r':
openr.c:(.text._open_r+0x10): undefined reference to `_open'

Please share if you have a good idea
Re: 4DIAC Forte Build with FreeRtos [message #1847956 is a reply to message #1847954] Mon, 15 November 2021 09:26 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

hi,

the intersting point would be what parts are using open. I have a slight guess that it could be our logging infra. Can you disable logging?

BR,
Alois
Re: 4DIAC Forte Build with FreeRtos [message #1847957 is a reply to message #1847956] Mon, 15 November 2021 09:35 Go to previous messageGo to next message
chen peng is currently offline chen pengFriend
Messages: 25
Registered: November 2021
Junior Member
I add NOLOG define and it shows NOLOG already defined, so I think log already disabled
E:/eclipse/Forte/org.eclipse.4diac.forte-1.14.0_new/org.eclipse.4diac.forte-1.14.0/src/arch/devlog.cpp:14: warning: "NOLOG" redefined
14 | #define NOLOG

[Updated on: Mon, 15 November 2021 09:53]

Report message to a moderator

Re: 4DIAC Forte Build with FreeRtos [message #1847965 is a reply to message #1847957] Mon, 15 November 2021 14:18 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1585
Registered: January 2014
Senior Member

You need to select nolog for the FORTE_LOGLEVEL option in CMake Gui.
Re: 4DIAC Forte Build with FreeRtos [message #1847966 is a reply to message #1847957] Mon, 15 November 2021 14:32 Go to previous messageGo to next message
Jonathan Lainer is currently offline Jonathan LainerFriend
Messages: 5
Registered: November 2021
Junior Member
In my Makefile, I have the following line for LIBS:

LIBS = -LCore/Lib -lforte-static -lc -lm -lnosys -lstdc++


I believe that your issue's root is the order of library includes. However, the -lstdc++ will probably save you the next step.

I just checked by running my own build:

  • Your configuration generates the same linker error in my project.
  • by putting -LCore/Lib -lforte-static at the beginning of LIBS, I got rid of undefined reference: _open. However, I got many more linker errors like undefined reference to: std::__throw_logic_error
  • adding the flag -lstdc++ resolves those errors and my build succeeds.

I hope you'll have similar results.

Edit:
Of course I assume, that your forte static library is called forte-static and is located at Core/Lib/forte-static.

[Updated on: Mon, 15 November 2021 14:34]

Report message to a moderator

Re: 4DIAC Forte Build with FreeRtos [message #1847977 is a reply to message #1847966] Tue, 16 November 2021 01:53 Go to previous messageGo to next message
chen peng is currently offline chen pengFriend
Messages: 25
Registered: November 2021
Junior Member
Thanks Jonathan
You are right, now I build success
Next, I'm going to run Forte in my STM32

Thanks All
Re: 4DIAC Forte Build with FreeRtos [message #1847998 is a reply to message #1847950] Wed, 17 November 2021 06:39 Go to previous message
chen peng is currently offline chen pengFriend
Messages: 25
Registered: November 2021
Junior Member
No Message Body

[Updated on: Wed, 17 November 2021 07:35]

Report message to a moderator

Previous Topic:HELP: Eclipse Forte Build in keil
Next Topic:http client can't show response code
Goto Forum:
  


Current Time: Fri Apr 26 09:11:31 GMT 2024

Powered by FUDForum. Page generated in 0.04288 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top