Producing Embedded Controller using RealTime Workshop

Hi,
I getting seriously stuck trying to understand Real Time Workshop.
For a project at university, I am trying to move our MATLAB/Simulink based control algorithms onto on-board processors, namely Gumstix Overo COM's. They run a version of command line Linux and are not suited to running the Simulink models within the Matlab Environment.
Currently we are having to manually translate our Simulink models into C++ code, but I understand it is possible to produce C++ source code directly from within Simulink using the RTW.
I have succeeded in doing this, but the generated source code won't compile using g++ or the 'make' command once the files are on the Overo COM's. The only thing I can reliably produce at the moment is a *.exe which isn't suitable for the target system.
I'm sure there is something really fundamental that I'm doing wrong, but I can't seem to find a good guide or help file to describe exactly how to do what I'm trying to do.
Host Environment: Windows x64 Laptop
Target Environment: Gumstix Overo Fire (Linux & ARM Cortex-A8 OMAP3530 Processor)
Thanks in Advance.

 采纳的回答

Did you make sure that you have transported all files for building on another target? See Relocating Code to Another Development Environment

8 个评论

No I hadn't. But I had got around it by copying the missing files from my computer when they came up as compiling errors. Thanks for the advice, at least I know the proper way to do that and that I was heading in the right direction.
I'm still getting errors though. I'm not sure what I should be looking at to fix this. ..
root@overo:~/Test_20110222_ert_rtw# make Test_20110222
g++ Test_20110222.cpp -o Test_20110222
/usr/lib/gcc/arm-angstrom-linux-gnueabi/4.3.3/../../../crt1.o: In function `_start':
init.c:(.text+0x30): undefined reference to `main'
/tmp/ccl2H2y9.o: In function `Test_20110222_step':
Test_20110222.cpp:(.text+0x16c): undefined reference to `rt_UpdateTXYLogVars'
Test_20110222.cpp:(.text+0x2f4): undefined reference to `Test_20110222_P'
/tmp/ccl2H2y9.o: In function `Test_20110222_terminate': Test_20110222.cpp:(.text+0x614): undefined reference to `rt_StopDataLogging'
/tmp/ccl2H2y9.o: In function `Test_20110222_initialize':
Test_20110222.cpp:(.text+0x65c): undefined reference to `rt_InitInfAndNaN'
Test_20110222.cpp:(.text+0x81c): undefined reference to `rt_StartDataLoggingWithStartTime'
collect2: ld returned 1 exit status
make: * [Test_20110222] Error 1
Did you modify the makefile for the Linux platform? The one generated for Windows probably uses LCC or MSVC. The compilation command that you use:
g++ Test_20110222.cpp -o Test_20110222
may not be sufficient for compilation. For example, there may be other object/library files to link against. Try and imitate how the build is done on Windows.
Hi,
Thanks for the help.
I thought that the compilation command looked a little short. I've had a look through the makefile, but I'm not sure I understand a lot of it. Can you offer any advice as to what I should be changing?
Thanks
Tom
Set Verbose Build http://www.mathworks.com/help/toolbox/rtw/ref/bq259jx-1.html#bq26cg_-1 to 'on' on Windows, to see what the exact build command used is.
Hi all, I'm building and Simulink block using Simulink code generator by VC++ 2010, now I have some unresolved symbols when linking. Some body could tell me how to find these symbols in which libraries: rt_StartDataLoggingWithStartTime, rt_UpdateTXYLogVars.
Hi, I meet the same question. Have you solved your problem? Which libraries are they in?
I also meet the same question, do you have the better solution?
I too have a linking error for rt_StartDataLoggingWithStartTime, rt_UpdateTXYLogVars. Please tell us what library contains them. I actually need to compile this for ARM, so if I would prefer access to the source code.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by