Yes, this approach is correct. The question is why you are getting HSE_SRV_RSP_INVALID_PARAM. I would step this down to the HSE_IP_ServiceRequest to check the HSE descriptor and address which is sent to MU. And I would try to disable the cache completely to see if it makes a difference.
What to force to RAM:
HSE_IP_ServiceRequest – be aware that this function calls some other functions.
This is the critical part of code inside the function when using synchronous mode:
if (HSE_IP_REQTYPE_SYNC == pRequest->eReqType)
{
/* Convert from microseconds to ticks */
u32TimeoutTicks = OsIf_MicrosToTicks(pRequest->u32Timeout, (OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);
/* Send the service request to HSE */
Mu_Ip_SetTxRegister(Hse_Ip_apMuBase[u8MuInstance], u8MuChannel, (uint32)pHseSrvDesc);
/* Read the current value of the counter */
u32CurrentTicks = OsIf_GetCounter((OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);
/* Wait for the HSE response */
while ((FALSE == Mu_Ip_IsResponseReady(Hse_Ip_apMuBase[u8MuInstance], u8MuChannel)) && (u32ElapsedTicks < u32TimeoutTicks))
{
/* Update the elapsed ticks, current ticks will be updated too by the OsIf function */
u32ElapsedTicks += OsIf_GetElapsed(&u32CurrentTicks, (OsIf_CounterType)HSE_IP_TIMEOUT_OSIF_COUNTER_TYPE);
}
The Mu_Ip… functions are inlined, so there’s no problem. But OsIf functions from BaseNXP module are not inlined, so you need to move them to RAM too. I recommend to step the function to see that all the code executed in this area is running from RAM. Or you can check the map file as well.
Regards,
Lukas