LinuxIP Communication using CASP
This example project demonstrates how to establish communication between the target board that supports LinuxIP block such as Raspberry Pi-4 or any Linux platform target supported by CASP and the host (native) PC. We try to generate a sine wave source and transfer it from the target board to the host PC through WiFi and plot the signal on the host PC. UDP protocol is used for communicating between the target board and the host PC.
Hardware Required
Raspberry Pi-4 is used in this project. However, any similar platform supported by CASP can be used.
Description
Connect the target and host through WiFi as shown in below figure
Following are the steps to properly program Raspberry Pi-4 Target.
· Setup the target board as shown in our video tutorial ‘Single Board Computers’. Link: https://youtu.be/IlJL3tXhdeA
· Run CASP and load the ‘target_model’ project.
· Open Home->Simulation->Setup Simulation Parameters menu item. Under TargetHW->General tabs set ‘Remote Build/Deploy IP Address’ parameter to the IP address of the target and set ‘Target Hardware ID’ as explained in our video tutorial.
· Click Run button to build and run on the target board. Screen shot of the target after successful execution is shown below
Following are the steps to run the native model on the native PC
· Load the ‘native_model’ project.
· With the target board available on the same network where the host PC is present, click on Home->Simulation->Configure Simulation IO menu item.
· ‘Configure Simulation Hardware’ window will open. Under Native Nodes and GPIO Device Nodes, change the IP addresses marked in the below figure (by double clicking on the item) to respective local and device IP addresses.
· Click on ‘Connect Device’ button and check the ‘Online Data’ check box. The program should now communicate with the target. Target board is now available as end point ‘EP0’ to the native model. Native model can use this end point to connect to respective IOs of the target.
· Click on ‘Save’ button to save the configuration and close the window.
· Run the model by clicking on the Run button. A simulation panel window should open and communicate with the board.
· Screen shot of the target and native simulation panel windows is shown in below figure.
References
Please go through our video tutorials, tutorial projects and CASP main documentation for getting started with CASP.