Weird error with blockset on HW. Critical fault if not fixed.

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

Weird error with blockset on HW. Critical fault if not fixed.

1,158 Views
Poley
Contributor V

Hi,

I am getting some very weird results when running my application code on my S32K148EVB.

I have my CAN receive blocks that read 80 messages on CAN2. This contains voltage data 176 cells this is then put into a 16x11 matrix of cells. I find the min and max including the index by using the following MATLAB function:

Poley_0-1626560294478.png

The issue I am seeing is the value for Min cell volt seems to flash to 0V a lot throughout runtime. I am using CANalyzer to send the CAN messages containing cell voltage so I know that the minimum cell is a solid 3.4v continuously.

Poley_1-1626560436219.png

 Occasionally it's for more than 1 CAN sample time, for example it happens here for 3 steps with is 300ms overall:

Poley_2-1626560512280.png

Sometimes the output goes to 3.2V, but only ever those 2 values, 0V and 3.2V:

Poley_3-1626560616707.png

What could be causing this? I really need help on this as have the wrong voltage that much really isn't good. My guess is that the CAN receive is some how malfunctioning. I also transmit the total sum of all cell voltages coming straight in from CAN and that also drops lower when this dip happens, therefore has to be something to do with that surely?

I have attached my model.

Thanks in advance!

 

 

0 Kudos
4 Replies

1,112 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @Poley ,

I had a look at your model but I cannot generate code because of some dependencies missing. However, because the code from 1 is executed on interrupt, while the code for 2 is executed every 0.005 seconds, the step time, and also the order of the generated code could be different from the order you expect to get the code generated, I would expect to see that at the Tn to get data handled from the Tn-1 and at some point, the data to not be available and the minimum to be applied on 0 arrays. I am glad that by changing some blocks you now are not seeing the 0 values. 

mariuslucianand_0-1626981650079.png

Regarding the external mode, seems to be an issue with the communication. Does the generated code ends on the board and it is successfully flashed? I wonder if there is some resource like UART or GPIO shared with the External Mode communication (UART).

Regards,

Marius

Regarding the external mode, 

0 Kudos

1,105 Views
Poley
Contributor V

Hi @mariuslucianand 

The code flashes and runs. Am I doing it right?

I click on "Hardware" tab and the select this button:

Poley_0-1626987821568.png

 

Then select Control Panel -> Connect and that's where it fails. 

I can't see what could be blocking the communication?

Thanks!

0 Kudos

1,118 Views
Poley
Contributor V

Looks like it was my triggered CAN receive block. I had it separate which block to run by message buffer. Taking the time and making 85 CAN trigger blocks for each individual ID seems to fix the issue. Not 100% sure why and not sure why external mode still doesn't work.

0 Kudos

1,146 Views
Poley
Contributor V

Also @mariuslucianand Could you please have a quick look as to why this model doesn't work in external mode? I get the following error:

Poley_0-1626694452459.png

The model runs in external if I just have some LED logic set up but doesn't with the current logic in, I don't understand why it wouldn't.

Thanks!

0 Kudos