Simulating the data corruption between s12x and xgate

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Simulating the data corruption between s12x and xgate

470 Views
rahulkrishna
Contributor IV

Hi,

I am facing an issue  where the data received over CAN by Xgate and processed by the s12x. I am sending a proper value on CAN message on xgate but some how the s12x is reading as 0 or some invalid values. I am guessing some type of corruption of data between s12x and xgate and i am not sure as well. The problem is it happens once several hours or it may not happen so i cannot reproduce it easily. Just wanted to know if i can simulate the data corruption between s12x and xgate by sending huge number of can messages or some other way. Please advice.

Labels (1)
0 Kudos
2 Replies

396 Views
RadekS
NXP Employee
NXP Employee

Hi rahul,

How you share data between CPU and XGATE cores?

I suppose for now that you use shared RAM. Correct?

In that case you should use synchronization tools to drive access to these data – for example hardware semaphores.

Since CAN message typically contains more than one byte, there is high chance that simultaneous XGATE write and CPU read could cause data corruption.

Semaphores could be used for driving access to peripheral, variables in RAM,…

In attachment is example how to use semaphores.

BTW: which MCU you use?


I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

396 Views
HSW
NXP Employee
NXP Employee

S12X devices have a build-in trace buffer, which may help you debug your problem. You can set up a breakpoint, which is triggered whenever a zero is read from a specific address and the trace buffer can record either the execution flows or the memory accesses of CPU and XGATE leading up to the breakpoint.

0 Kudos