Clear Filters
Clear Filters

dSPACE Memory Alignment Error

13 views (last 30 days)
Rodney on 30 Aug 2022
Answered: Prateekshya on 27 Dec 2023
My DS1005 multi-board dSPACE system recently had its companion PC upgraded to MATLAB r2019b and ControlDesk 7.1. Since upgrading, I have been unable to get any Simulink model to download, with the MATLAB diagnostic window issuing the following error:
LOADING APPLICATION "Debug_Local.sdf" ...
PLATFORM: ds1005
*** ERROR: Memory alignment error (double word alignment required).
Could not download real-time application: C:\Experiments\MATLAB Files\ENME303_DS1005\Debug_Local\debug_local.ppc.
An error occurred while loading the application.
DsErrorHandling: Panic! Format string 'The Clib Wrapper is not initialized.' for code 0x2711 starts with invalid character 'T'. Expecting '%'!
*** Stopped RTI build procedure for model: Debug_Local.
Error:The call to rti1005_make_rtw_hook, during the after_make hook generated the following error:
*** Stopped RTI build procedure
The build process will terminate as a result.
Caused by:
*** Stopped RTI build procedure
Note that the model builds without error - it is when downloading to the DS1005 that the problem occurs. The Simulink model "Debug_Local" consists of a DS2001 A/D block, memory store with write, and that is all.
Prior to software upgrade, the multi-board system performed flawlessly for ten years, so the problem is clearly a MATLAB/Simulink software configuration issue, rather a hardware problem. I have read dSPACE FAQ 239, which describes a procedure for determining the cause of memory errors, but due to the fact that my Simulink model is the simplest possible, its suggestions do not seem relevant here.
Searching the web for help, there is mention of a memory alignment option in MATLAB, but only for a specific toolbox (which I do not have), rather than for the MATLAB core product. Is anyone able to provide a suggestion as to how I may resolve this memory alignment issue?

Answers (1)

Prateekshya on 27 Dec 2023
Hi Rodney,
The error message you're encountering indicates that there is an issue with the memory alignment for the real-time application being downloaded to the DS1005 board. This is a requirement for the processor used in the dSPACE hardware, which expects variables, especially of type double, to be aligned to memory addresses that are multiples of the size of the variable.
Here are some steps you can take to resolve this issue:
  • Ensure that you have the latest updates for MATLAB, Simulink, RTI (Real-Time Interface), and ControlDesk, as well as any relevant patches for dSPACE software that might address this issue.
  • The memory alignment issue might be related to the compiler settings used for generating the real-time application. Check the dSPACE documentation for the recommended compiler settings for your version of MATLAB/Simulink and ensure they match.
  • Verify that the dSPACE configuration settings are correct. Ensure that the Simulink model configuration parameters are correctly set.
  • If the issue persists, you might want to consider replacing "double" data types with "single" or fixed-point types to see if that resolves the alignment issue. However, it can affect the precision and behavior of your model.
  • As a last resort, if the issue is urgent and cannot be resolved in a timely manner, consider reverting to the previous version of MATLAB and ControlDesk that was known to work with your system.
  • Since the model builds without error, the issue is likely related to the configuration of the build process for real-time execution. Carefully check all settings related to the build process and consult the dSPACE documentation for any known issues with MATLAB r2019b and ControlDesk 7.1.
I hope this helps!


Find more on Multicore Processor Targets in Help Center and File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!