Hi Ashu Biz,
The workflow that you are trying to follow is possible but with a few modifications.
During build of the project inside MATLAB, there are certain environment variables and build information that is used to generate and build code which is not available outside MATLAB. So, you might not be able to build the code outside the MATLAB environment but it is possible to flash and debug the code using other tools like Atmel Studio.
For debugging your code in Atmel studio, follow the following steps:
- In your Simulink model, open Configuration Parameters, and go to Code Generation pane. In the "Build configuration" drop down, select "Debug".
- In Atmel studio, go to File -> Open -> Open Object File For Debugging
- In the "Select the Object File to Debug" input, select the elf file generated by the model and click next.
- In the next window, select the device and click finish.
Once you load the object file into the ide, all the libraries and dependencies required for debugging will be resolved automatically.
Now you can flash and debug the code from IDE.
Please note that you will not be able to build the code from ide because of the reason mentioned earlier. But it is possible to bulid the code inside MATLAB by using gmake command.
Hope this helps!