Dspace Toolchain

0 views
Skip to first unread message

Kimbery Challacombe

unread,
Aug 3, 2024, 1:59:12 PM8/3/24
to anlindoru

I Alex !
Yesterday I finally managed to cross compile acados and then compile my s function for DS1401! Soon I will start doing some banchmarking of its performance on the dspace!
Thanks for your time and we keep in touch!

I googled why the cmake shows " The C compiler identification is unknown", and get answers that I need to install Windows 10 SDK in my visual studio 2017. I have tried this solution, but it turns out not to help. And I can compile and build acados model in Matlab.
Thanks in advance for your kindness and patience!

@FreyJo and me were thoroughly testing the dSPACE Toolchain with the newest acados release and were fixing some memory alignment and cmake errors, whose fixes have been now pushed to the main. Can you pull the latest acados and retry?

There is one issue with BLASFEO, which I addressed here: use CMAKE_SYSTEM_NAME instead of CMAKE_HOST_SYSTEM_NAME to set OS specific flags by FreyJo Pull Request #160 giaf/blasfeo GitHub
All other fixes are already on the acados master branch.
The current acados/master with this BLASFEO version was tested successfully on the MABX2 by @AlexWin

the compiling is working, but another problem came up when i tried to load my application on the MABX. There is an undefined Error ID 0x2712 (see screenshot below) and thus i have no real time data in ControlDesk.

I tried to cross compile Acados for dSPACE MicroAutoBox III. However I found that there are only toolchain files for DS1401, DS1202, SCALEXIO and mingw32. Is there a way to adapt the toolchain file for AutoBox III (dSPACE-MABXIII)?

you were able to generate S-Functions with acados, which also work in your Simulink simulation 'Simulation_Model_Name'.slx.Thus, you have a folder c_generated_code with your S-Functions, a make_sfun.m Matlab script (and a make_sfun_sim.m script, if needed) and the corresponding C files.

you have prepared a Simulink model with the name 'dSPACE_Model_Name'.slx, which does not contain the S-Functions yet and you were able to compile it for your dSPACE Platform.During the compilation process, the dSPACE Makefile 'dSPACE_Model_Name'_usr.mk was created, which can be found in the same directory as the dSPACE Simulink model.

The CMake toolchain file, needed to cross-compile acados for the dSPACE Platform contains paths to compilers, provided in the dSPACE installation.As the dSPACE installation varies from system to system, this toolchain file first has to be adapted.

The Toolchain files are located in 'acados_root_folder'/cmake.The toolchain file for the MicroLabBox is called Toolchain-dSpaceDS1202.cmake and can be edited with any editor (respectively Toolchain-dSpaceDS1401.cmake for the MicroAutoBox-II).

Define an environment variable (type env in the windows search bar and open Edit the windows environment variables.There, click Environment Variables... and create a new entry for your user) with the name QNX_HOST and as the value, enter the path you set before in the toolchain file.

In order to compile acados for your dSPACE platform, you need the acados libraries and header files in the correct format.These files can be created by cross-compiling the acados source code for the correponding dSPACE platform.Using a toolchain CMake file, the following steps are needed in order to create the necessary files:

In order to install the cross-compiled acados version, run:cmake --install ./If all these steps worked, you will find the two folders lib and include in buildDS1202/install.These are the folders you need to deploy acados on your dSPACE Platform.

Create a new folder 'dSPACE_Build_Folder_Name' (anywhere) and copy your Simulink model 'dSPACE_Model_Name'.slx, the dSPACE Makefile 'dSPACE_Model_Name'_usr.mk and the acados S-Function folder c_generated_code to this folder.

Your acados S-Function(s) are based on C code source files.These files are listed as SOURCES in the Matlab script make_sfun.m (and make_sfun_sim.m if the simulation S-Function is used too).Open the dSPACE Makefile 'dSPACE_Model_Name'_usr.mk and list all source files needed for the S-Functions, except for the ones which have the same name as the S-Functions.

Define the (relative) paths to the S-Functions and the C code source files in the dSPACE Makefile.These are the folder c_generated_code and any subfolder which contains C code source files, which were identified in the previous step.For the example in the previous step the entry in the dSPACE Makefile would look like this:

In order to compile your dSPACE Simulink model 'dSPACE_Model_Name'.slx use the rtwbuild command in Matlab or press Ctrl+B in Simulink.The Makefile should now integrate all the necessary files for the compilation of the acados S-Functions.

Here, an alternative workflow for the deployment of acados on a dSPACE Platform is described.This has been successfully tested with Matlab / Simulink R2018b on the DS1401 MicroAutobox-II (MABX2) and the DS1403 MicroAutobox-III (MABX3).

your dSPACE installation, and your project folder, do not contain spaces in their paths (all the paths you will use in the next steps should not contain any space).It is usually sufficient to copy-paste the compiler folder to a new one without spaces in it, without re-installing the whole dSPACE software suite)

The lines that contain the paths (line 1 - 17) to the compilers have to be adapted to fit your system.It is possible to locate the correct compiler path from the Simulink dSPACE build output (e.g. building 'dSPACE_Model_Name'.slx without acados S-Functions in it):

In order to install the cross-compiled acados version, run:cmake --install ./If all these steps worked, you will find the two folders lib and include in buildDS401/install (or buildDS1403/install).These are the folders you need to deploy acados on your dSPACE Platform.

if you rebuild the examples like wind_turbine_nx6 fitting to your problem you should be able to implement it in a simulink model without any source files. You just need the acados_solver_sfunction_ocp_model. c and -.mexw64 files.

If you want to use the simulink coder to go on another target system like dspace rt you will have to compile the libraries and source files again fitting to dspace, e.g. with toolchain-files. (see my post here or the issue un github).

PADERBORN, Germany and TEL AVIV, Israel, Dec. 14, 2023 dSPACE, one of the world's leading providers of solutions for simulation and validation, and Argus Cyber Security, a world leader in automotive cyber security, today announced a technology partnership aimed at streamlining the development and compliance of automotive embedded systems.

Through this partnership, the companies enable early-stage (shift left) cyber security testing. By integrating the Argus automation tool - Argus Fuzzing - with dSPACE's SCALEXIO Hardware-in-the-Loop (HIL) systems, dSPACE can now offer vehicle manufacturers and suppliers a continuous integration, delivery, and testing (CI/CD/CT) toolchain enhanced with cutting-edge cyber security testing capabilities from Argus.

As automotive systems grow in complexity, developers need to perform cyber security testing early and often to reduce the risks and costs of late-stage vulnerability discoveries. Accordingly, vehicle manufacturers and suppliers are looking to incorporate cyber security testing in their CI/CD/CT pipelines and related workflows. This shift left approach enables developers to increase product quality through more frequent tests, while shortening time-to-market by allowing for faster and cost-effective fixes. This trend accompanies the increased need for cyber security testing across the industry as a result of new regulations such as WP.29-UNR 155, ISO/SAE 21434 and the focus on software-defined vehicles.

"The partnership with Argus enables our customers to perform cybersecurity testing on our test platforms which have already been established for functional testing for many years. As the challenges in automotive cybersecurity continue to grow, mature test procedures become more important. Performing cybersecurity tests using our fully automated HIL systems, which are already highly integrated into our customers' processes, is a reasonable next step. That is why we are excited to partner with a strong and experienced cybersecurity service provider such as Argus", said Dr. Herbert Schtte, Executive Vice President Real-Time Test & Development Solutions.

The partnership enables dSPACE customers to accelerate development timelines and reduce testing personnel by combining cybersecurity testing with network, sensor, and fault simulations. Leveraging Argus' expertise gained through decades of cyber security research allows automotive manufacturers and suppliers to conduct cyber security testing more efficiently and scalable.

"Our partnership with dSPACE leverages the respective strengths and know-how of each company to set a new industry standard for cyber security testing," said Ran Ish-Shalom, VP Strategy and Product at Argus Cyber Security. "The integrated solution elevates the cost-effectiveness and scale at which automotive cyber security testing can be conducted, helping the industry deliver on the promise of cyber-secure automotive systems in an increasingly connected world."

c80f0f1006
Reply all
Reply to author
Forward
0 new messages