Regarding the main issue of your support request, let me give you some hints that will provide some explanation into the behaviour you were experiencing:
General advice for initialization specification
The general advice (you can check more here: https://www.mathworks.com/help/autosar/ug/autosar-software-components.html#bvg3rfo-1) for using those IRT subsystems is to model complex logic required by your SWC in response to a system event like startup, shutdown, or reset. Think of this as "what does my component need to do to initialize itself?" Usually this would mean writing internal states or reading some value from NVRAM, but I suppose you could want to share that result with a downstream component. In contrast, the InitVal setting on the ComSpec answers a different, systems-level question: "What does the receiver get if it happens to read invalid data?" This includes both data never sent or data intentionally invalidated by the sender.
Initialization behaviour details
I will give the details for when the InitVal comes into play vs the C-code initialization, so it is possible for you to decide if and how you would like to specify these:
ComSpec Initval comes into play for two cases:
- The RTE gives this value to a receiver if no value has been written to that data element since ECU (or Partition) start
- The RTE gives this value to a receiver if it receives an invalidated data element (assuming the receiver has "handleInvalid" set to "replace")
Note that if both the sender SWC and receiver SWC specify a different InitVal for the same data element, the receiver SWC wins. This makes sense, because the InitVal is only ever used on the receiver side. Last, if no InitVal is set by the sender or receiver, the RTE will assume an InitVal of 0.
In contrast, the C-code initialization has a very basic meaning: when the RTE schedules the runnable_init method, that runnable writes out a specific value (e.g. 69) to the data element in question; you decide what system events trigger this data write by mapping that runnable_init to different AUTOSAR events, like maybe a mode switch event or initialization event.
Things to consider are SWCs connected by an S-R port but running in different Partitions/ECUs. If the receiver Partition/ECU resets, but the sender Partition/ECU does not, the "data received" status will reset on the receiver's Partition/ECU, since a separate RTE runs on each Partition/ECU) until the next time the sender sends data on that port.