-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile freeRTOS with open62541 errors #2893
Comments
cc @cabralfortiss |
You said you use the flag -UA_ARCHITECTURE_FREERTOSLWIP (not sure where) but this might be -DUA_ARCHITECTURE_FREERTOSLWIP instead. In most IDE, you can add symbols to your project, and then it generates the flag according to it. If your generating the amalgamted files and including them in a project in an IDE prepared for your embedded, then when you do cmake you only need -DUA_ARCHITECTURE=freertosLWIP regarding the architecture and the compilation will fail, but the generated files will be there. The other flags are needed when compiling, which should be set by the IDE |
pub sub wasn't tested yet on freeRTOS+LwIP (from what I know). Try deactivating. Again, there isn't much we can do from here. If AI_PASSIVE is not recognized, you'll have to look for it in your code. The information provided in #2511 has made most people sucessfully run the opcua server. If something is working, probably you did something different. Take your time and read it carefully and investigate where the problem is coming from. Your problems seem to be related to your project and not to the open62541 code |
I solved the errors. Thank you for your help. I added some missing parameters to my header file. When I add #2511 the functions:
I get the error: undefined reference to `pdMS_TO_TICKS'. Does this mean I have some timing issues? Also in the open62541.h file that I generated via cmake there is no function called |
I have pdMS_TO_TICKS defined in freertos/include/projdefs.h About UA_ServerConfig_new_customBuffer can maybe @Pro help |
Yes correct, we changed how the server config is handled. You can find more on that in our examples on master. |
Thank you. I updated my FreeRTOS files to V10.2.0 and this solved the missing pdMS_TO_TICKS problem. For now I have two questions left:
With the lines below commented so is it not a part of the program, the LED's are blinking and the internet connection is able to be established.
It never come to the line with the debugout print. |
I'm using 3 with realloc and calloc self-implemented just calling pvPortMalloc
I think this last line shouldn't be there since it will reset the hostname you set the line before
You're not starting your server. From the example, you see at the end of the function the following:
|
Hey guys, I am new to github so apologies if I am in the wrong thread. I am trying to set up open62541 as a opc server on stm F207. The tutorial for creating open62541.c and open62541.h works fine but after integrating these files into my stmCubeIDE Project i have about 30 compile errors left. I am pretty sure that I miss an include or something and maybe someone could give me a hint. I am working with the latest master-branch, maybe this is my error? Thanks in advance for any help. |
Read the documentation carefully. It looks like you forgot this part: When compiling LwIP you need a file called lwipopts.h. In this file, you put all the configuration variables. You need to make sure that you have the following configurations there:
|
@cabralfortiss Thanks for the quick answer. I have these defines in my lwipopts.h and double checked it now. I did the changes of the freertos-config file as well. Before i had them I had around 300 errors ;) I´m going to try the release pack v1.0 later or tomorrow instead of the masterbranch I use now. Or is their another stable release of open62541 I haven´t seen yet. |
mmm that's strange, all the errors are related to the lwip, and those flags should take care of it. Maybe check that these values are actually there when used in open62541. In you open62541.h after the includes like #include <lwip/sockets.h> put some #if to check that for example LWIP_COMPAT_SOCKETS is actually 0 |
@cabralfortiss I actually don´t know what went wrong yesterday. Overnight I thought there might be a problem because I use RMII ethernet config insted of MII but that was not the problem. I did set up a whole new project in another workspace this morning and now I can compile it with some other errors which I am trying to fix at the moment.
|
@mrburen121 hey Chris, did you manage to run PubSub in your embedded device? |
Hello @ZekeLandon. No, I didn't manage to get it working. The reason for this is that we currently use the TCPIP stack and the open62541 project the LWIP stack. It would cost us to much time to add TCPIP as architecture to open62541. It has currently not the highest priority to implement OPC UA in our products. My guess is that I will start on the implenentation of TCPIP in Q3 this year. |
Maybe this example helps: https://github.com/Pro/open62541-esp32 It shows how to compile open62541 for the ESP32 microchip, which is based on FreeRTOS. |
I got this error during the compilation : |
Description
After creating the amalgamation header/source files and included them in my project I get some compiling errors. Did I forgot to include some parameters/files?
Language: -std=gnu99 (-std=c99 is also not working)
Compiler flags: -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -UA_ARCHITECTURE_FREERTOSLWIP
With cmake I created the zz file fith the folliwing parameters:
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=OFF -DUA_ARCHITECTURE=freertosLWIP -DUA_ENABLE_AMALGAMATION=ON -DUA_ENABLE_PUBSUB=ON -DUA_ARCH_FREERTOS_USE_OWN_MEMORY_FUNCTIONS=ON -DUA_ARCH_EXTRA_INCLUDES="ALL MY FOLDERS THAT NEEDED TO BE INCLUDED" -DUA_ARCH_ADD_FLAGS="-std=gnu99 -DUA_ARCHITECTURE_FREERTOSLWIP -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_LPCOPEN -DCORE_M3 -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m3 -mthumb -D__REDLIB__ -fstack-usage -specs=redlib.specs" ..
The output error:
The file seems to be including all necessary open62541 library files.
I did the settings from #2511
In lwipopts.h I have:
In FreeRTOSConfig.h I set:
#define configCHECK_FOR_STACK_OVERFLOW 1
#define configUSE_MALLOC_FAILED_HOOK 1
In my main.c I only included the open62541 header file. I did not add any open62541 server code.
In open62541.h the following files are included, but AI_PASSIVE isn't declared in one of those files, even not i any file in my project.
Background Information / Reproduction Steps
Please provide the following information:
UA_LOGLEVEL
set as low as necessary) attachedThe text was updated successfully, but these errors were encountered: