I am developing a serial echo program on the Raspberry pi (RPi) hardware i.e RPi is connected to an external microcontroller over the serial line (RX TX crossed), The external controller sends a byte of data that is received by RPi and re-transmitted back (like an echo).
I am using the matlab support package for RPi to do the same. Currently, I have written a .m file script to use the built in serial functions read() and write() to implement the requirement.
mypi = raspi()
myserialdevice = serialdev(mypi,'/dev/ttyAMA0',9600,8,'none',1)
myserialdevice.Timeout = 1000
serialdata = read(myserialdevice,1);
The RPi is connected to MATLAB via an ethernet cable, I want to run the RPi as a standalone system not connected to the PC (MATLAB). How can I burn the .m file to the target device(RPi) ? Do i need to convert to a simulink model ?