When you have message like "... does not exist", it looks that directory "blocks" is not on the MATLAB path. It should be, because it is done in function "setup_customtarget_arduino.m" on first functional line and next this path is saved:
result = savepath;
Try to run "setup_customtarget_arduino.m" again.
This is strictly AVR-based Arduino with IDE version 1.0.5. This cannot be working with Due because of different MCU, different compiler and mainly, different internal structure of IDE 1.5.x.
If there will be more interest, we can consider port for Arduino Due.
I have never seen before this message. In principal, last task of the makefile (arduino_ec.tmf) is line 248 with this content:
@echo ### Created $(PRODUCT) successfully (or it was already up to date)
The first part of that message is like sign that makefile process went smoothly to the end. There can be stdout flushing problem, e.g. the last part of the text is still in buffer.
Please try following steps:
1. Go to directory with generated code, e.g. it can be like “mymodel_arduino”.
2. Open here DOS command window.
3. Run BAT file like “mymodel.bat” – the name depends on name of the model; there is only one BAT-file. Path to this file cannot be used, DOS window needs to be opened in folder where is the BAT file located.
4. This file was generated and was invoked by Embedded Coder to build the project
5. Observe, if you will see on the last line the messages like “### Created mymodel successfully ...”
6. If you can see that, Simulink is not receiving this part of the message
7. If you not see that, there is issue in template makefile “arduino_ec.tmf”
Anyway, it looks like the HEX file was created, only this message has not arrived to Simulink.
In my case original model is working, newly created model employing SR04 block from library is working. Problem can appear when original library was manipulated (library itself, S-Function or TLC file). If you want to investigate, look for the file "sfunar_hcsr04.tlc". There is line like:
%assign errTxt = "Unsupported function parameter: %<mode>"
From here you have your error message. You wrote that the message is "untitled_ConstP.HCSR04_p4". This is really strange, because this values is coming from the S-Function as numeric parameter and expected value is between 1 to 3, coming originally from the dialog.
Please check your installation and recompile all S-Functions again.