Rte_read does not inherently guarantee that the data is available or up-to-date after the function call execution.
If you want the latest updated data to be available immediately after the RTE function call then it is recommended to use the rte_iread function. It ensures the read operation is complete before subsequent operations and also prevents compiler optimizations that might reorder memory operations. As you were using Rte_read which is unsynchronized and the data might not be available after the Rte_read execution call without any synchronization mechanisms.
In general, it is best not to use global variables across Software Components (SWCs) as it violates the AUTOSAR architectural principles of encapsulation and modularity.
If you want to adapt the legacy code to the AUTOSAR standard then,
Option 1: Use a shared data approach as both SWCs might reside in different partitions/ cores. You can create an independent SWC to store the shared data and map P and R ports accordingly to access it from multiple SWCs.
Option 2: Use NVRAM services and store common data in NVRAM blocks. You can access them via NvM_Read/NvM_Write APIs.