AN 961: IO Module Design Example for OPC UA: for Intel® MAX® 10 Devices

ID 691266
Date 10/30/2021
Public

Generating an open62541 OPC UA Amalgamation (optional)

Open62541 provides the alternative for building the library in different modes. In an embedded software project, such as the IO Module Design Example, you can build an amalgamation of the library into a single source and header file (open62541.c and open62541.h) using CMake for Windows and Eclipse.
  1. Download and extract open62541.
  2. Open <project directory>/opcua_nios/SdkNios.cmake and change the UA_ARCH_EXTRA_INCLUDES to point to the project BSP directory.
  3. Open CMake, navigate to open62541 directory for source.
  4. Create a /BUILD_/ directory for the binaries.
  5. Click on Configure.
  6. Select Eclipse CDT4 - Unix Makefiles as a generator and Specify toolchain for cross-compiling.
  7. Specify the toolchain file: <project directory>/opcua_nios/SdkNios.cmake and click Finish.
  8. Click Generate.
  9. Open Nios II Software Build Tools for Eclipse.
  10. Right click BSP > Import > Existing Projects into Workspace, browse to ../BUILD_/ directory.
  11. Click Window > Show View > Other > Make > Make Target.
  12. Click Make Target Window > <open62541> > @BUILD_ > all.
    Ignore any fail messages.
  13. Open open62541.c and find the line: include <task.h>.
  14. In the line above add: include <FreeRTOS.h> and save.
  15. Copy the generated open62541.c and .h files to the FreeRTOS project.