Hi Raghu,
To get from C-code to Simulink blocks/models, we are using TLC (Target Language Compiler - see the pdf attached).
To create a custom block is quite easy. Let us suppose you wish to build your own Simulink Library with custom blocks for a specific processor.
STEP1: Create a Simulink Library model

STEP2: Create a slblocks.m file in the same folder to describe various parameters of the library. This is how you make it visible in Simulink Standard Libraries list. Let us presume you want Simulink to display your collection of blocks as "CustomMBDT" library
% SLBLOCKS Defines the block library for a specific Toolbox or Blockset.
function blkStruct = slblocks
blkStruct.Name = ['Custom MBDT' sprintf('\n')];
blkStruct.OpenFcn = 'CustomMBDT';
blkStruct.MaskDisplay = '';
Browser(1).Library = 'CustomMBDT';
Browser(1).Name = 'CustomMBDT';
Browser(1).IsFlat = 0;
Browser(1).Choice = 1;
blkStruct.Browser = Browser;
end
This is how it will look:

STEP3: Add a standard S-function Simulink block into your customMBDT.mdl file

Now comes the tricky parts: you need to create your own User Interface and Custom Code when this S-function block is used in a model.
STEP4: Create or associate a S-Function Level 2 file with your block. This will tell Simulink what are the inputs/outputs and other various parameters of your block.

E.g.: supposing i want to create a Simulink block that allow to read a GPIO. The block has no input ports but it has 1 output ports which i'll define as Boolean.
static void mdlInitializeSizes(SimStruct *S)
{
ssSetNumSFcnParams(S, 0);
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S)) {
return;
}
ssSetNumInputPorts(S, 0);
ssSetNumOutputPorts(S, 1);
ssSetOutputPortWidth(S, 0, 1);
ssSetOutputPortDataType(S, 0, SS_BOOLEAN);
ssSetNumSampleTimes(S, 1);
ssSetNumRWork(S, 0);
ssSetNumPWork(S, 0);
ssSetNumModes(S, 0);
ssSetNumNonsampledZCs(S, 0);
ssSetNumIWork(S, 0);
ssSetNumContStates(S, 0);
ssSetNumDiscStates(S, 0);
ssSetOptions(S, SS_OPTION_USE_TLC_WITH_ACCELERATOR |
SS_OPTION_SFUNCTION_INLINED_FOR_RTW |
SS_OPTION_WORKS_WITH_CODE_REUSE |
SS_OPTION_DISALLOW_CONSTANT_SAMPLE_TIME |
SS_OPTION_RUNTIME_EXCEPTION_FREE_CODE |
SS_OPTION_CAN_BE_CALLED_CONDITIONALLY |
SS_OPTION_CALL_TERMINATE_ON_EXIT);
}
STEP5: create a MEX file from the c file used as S-Function. You can used the default LCC compiler to create the mex file: mex myfile.c
STEP6: attached a TLC file with the same name as the S-Function so that you can inject whatever code you wish when the block is used. It is very impfrtant that the TLC file has the same name as the S-function C file and also to contain the syntax as first line below.
%implements io_input "C"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% function executes once per block type before code generation begins
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%function BlockTypeSetup(block, system) void
%%user include files
%<LibAddToCommonIncludes("pins.h")>
%endfunction
Inside this file, you can have any function supported by the TLC (see the attachment). It allows you to add include files, inject code in various places in the Simulink generated files, etc.
E.g. If you need to call your custom driver implemented in C:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%% function executes at each step
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%function Outputs(block, system) Output
%assign pinInfo = FEVAL("io_pin_info", block.Name)
%with pinInfo.user_config
/* GPI%<port>%<pin> signal update */
%<LibBlockOutputSignal(0,"","",0)> = (PINS_DRV_ReadPins(%<pt>) >> %<pin>) & 0x01;
%endwith
%endfunction
STEP7: build your own User Interface to allow custom code customization. Use right click on the block and select Edit Mask to implement your own user interface.

This will show something like this:

STEP8. Save the block into the Simulink custom library model you have created at step 1 and you should have your own block that allows you to call your custom code into the Simulink environment.

This is the basic flow that allows you to call any custom code into a Simulink environment. You can find attached an example for this part.
In respect with the other questions:
I can see that the RappID is not available for this microcontroller.
We can't help you with that. You need to contact the S32Design Studio team via a NXP Official Support and ask for that support to be enabled.
I can also see that as a consequence, most likely FreeMaster would also not be available.
FreeMASTER should not be an issue. The FreeMASTER embedded driver can be easily ported on any MPC platform.
(C to simulink to C for this controller). We're willing to make the developmental efforts ourselves. But I am stuck with get this workflow clear in my head. Does it mean, that we need to develop our own tool to flash (from Simulink), to debug in SIL/PIL mode?
The easiest way to do that, would be to start from an NXP existing toolbox like MPC574xP since it contains all the additional TLC files for e200 code generation. You will face some issues since not all the m-file are available for end-user but starting from MPC574xP should give you an idea about what you need to change or implement by yourself.
Hope this help!
Daniel