How can I generate code for Raspberry Pi without the device connected?

조회 수: 5(최근 30일)
Is it possible to generate code for the Raspberry Pi without being connected to the Pi? I would like to build the model and generate code, then deploy the executable to the Pi outside of the Mathworks external mode simulation framework. This will allow me to develop and troubleshoot the model without lugging the Pi around with me everywhere, and will also allow my (student) project team to perform HW and SW integration/testing with fewer devices.
I am using the Raspberry Pi Support Package.
When you attempt to build the model connection with components from the Simulink Support Package for Raspberry Pi Hardware without first establishing a Pi connection, the build process fails because it cannot connect to the Pi. I tried changing the Code Generation System target file to use Embedded Coder, and received a similar error.
  댓글 수: 1
Jon Boerner
Jon Boerner 2014년 10월 16일
I do not believe this is possible, but I am trying a couple of experiments (which I do not think will work). I will let you know how they turn out.

댓글을 달려면 로그인하십시오.

채택된 답변

Murat Belge
Murat Belge 2014년 10월 28일
Generating code for Raspberry Pi without a connection to the board is not possible. The Raspberry Pi support package uses the compiler / linker on the Raspberry Pi itself to build a Simulink model. You would not be able to compile / link the code without a Raspberry Pi.
In your use case, I would simulate the model in "Normal" mode in the development phase and deploy the model to Raspberry Pi hardware (i.e. either through External Mode or using Run on target hardware) when the model is ready. You do not have to be connected to the board for simulation. Is there something I am missing in your use case?
  댓글 수: 1
Christopher Schulenberg
Christopher Schulenberg 2014년 10월 28일
Thank you Murat for this explanation of the dependencies. In my use case, we are integrating model generated code with hand code (custom sensor data and communications interface). Therefore we have a need to separate code generation from compiling and linking, the workflow I had in mind was to generate the model code from Simulink, then import that code into an IDE for integration. In theory the code generation should not require a connection, but the callbacks of the Raspberry Pi support package validate the connection before code generation is allowed to proceed.
I guess the alternative would be to bring all of the hand code into Simulink via the Legacy Code Tool and do the code integration in the Simulink environment, this just precludes the use of an IDE to manage all of the code.

댓글을 달려면 로그인하십시오.

추가 답변(0개)


Find more on Simulink Support Package for Raspberry Pi Hardware 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!

Translated by