I am working on data serialization with S32K142/144 micro controller . I am using this controller for CAN specific applications. And in which i realized "data serialization " should restrictively followed .
So,i have gone thorough alot-off posts and documentations.
after all i have still one doubt , as for any peripheral resister access , we should follow "read after write".
As in below example, during accessing of LPTMR0_CSR.
// Declare dummy variable to store the read of the LPTMR0_CSR register
volatile int dummy_var
/**** STEP #1 ****/
// Clear the flag; enable interrupts; enable the timer
Hi, I had to modify this comment. DSB instruction serialize all explicit memory accesses. But it doesn’t serialize peripheral writes, in this case, we need to do Read-After-Write sequence to be sure the writes are complete before we can proceed with execution of subsequent instructions. We can use ISB instruction to flush the pipeline if needed.