MPC5744 does not allow me to flash same model that I can do with S32K144EVB !!!

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

MPC5744 does not allow me to flash same model that I can do with S32K144EVB !!!

1,431 Views
bcelikte
Contributor III

Hi there,

I have a BMS model that I can flash to S32K144EVB. I can do execution time check, accuracy check and so on without a problem. But when I try to use MPC5744 with same model under the specifications with this link (https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/MPC5744P-and-MC33771-Configuration/m-p/107... ) The code is generating, and I can see the percentage bar of Bootloader and it is flashing without any problem. However, when I try to look some profiler results or outputs with Freemaster, MPC5744 is not giving any response, no LED is lighting. I believe it stuck for some reason, so reset couple of times but nothing is changed. Do you have any suggestion to overcome this?

Btw, I could flash same models for S32K144EVB and MPC5744 before for some other BMS models. I am using them as reference.

6 Replies

1,373 Views
bcelikte
Contributor III

Hi @mariuslucianand 

The code generates and mot file reaches the board. Yes "get values" part is the same that you sent in the mentioned post.

Like you said, I comment out everything first but LED part and the board is working well. Then I uncomment subsystems in order to find bottleneck and at some point it stuck again. However, the subsystems that board can handle before it stuck gave me the higher profiling than S32K144 ( I have changed the profiler constant already because of its clock freq.). For example at S32K144 profiler of function is 5ms, exactly same function at MPC5744 profiler is 45ms. I have checked again and again the profiler constant, data types, any anomaly at function, but nothing, they are identical. Isn't it weird? Shouldn't MPC5744 powerful than S32K144, previous study that I did to compare exactly same algorithm on different boards did not give me that. 

So I have two question now

1- How can I make the model - which can be run on S32K144 - runnable on MPC5744?

2- Shouldn't MPC5744 faster than S32K144?

Thanks.

0 Kudos

1,340 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @bcelikte ,

The blocks in both S32K and MPC toolboxes are not compatible and shouldn't work to for example use the S32K block for the MPC blocks. However, in order to migrate a model from a toolbox to another, you have to change all the blocks starting with the main config block, but the algorithm should remain the same. So only the inputs and outputs blocks controlling the hardware have to be changed, simply because the hardware is different.

Now, the profiler block uses a timer in order to calculate the time for some functions' execution so indeed the timers frequencies are different. On S32K144 we talk abut a 20Mhz timer, while on the MPC5744P is 100Mhz.

1- How can I make the model - which can be run on S32K144 - runnable on MPC5744?

As I have described above, you should change first the main config blocks, and then all the blocks related to S32K1 have to be switched with the ones for the MPC5744P but the algorithm stays the same.

2- Shouldn't MPC5744 faster than S32K144?

MPC5744P runs at 200Mhz while the S32K144 at 80Mhz.

Regards,

Marius

 

0 Kudos

1,334 Views
bcelikte
Contributor III

Hi @mariuslucianand 

Thanks for the reply. I did whatever you said before but it didn't work. However, I finally find out the cause and it needed algorithm change contrary to what you said.

In my model, I am using embedded MATLAB script. It takes a AxB matrix as an input and change couple of elements of matrix after calculations and then release it with an output. It works with S32144 but MPC5744 doesn't allow me to that. What I did is changing the algorithm, now I am releasing the necessary elements from MATLAB script and with SIMULINK "Alignment" block I am replacing the relevant elements of AxB matrix outside of the MATLAB script. It does basically same thing, but figuring it out was nightmare. I don't know the cause of it, but the only change that allow me to work is this. You can try on your end also for both board and compare it. 
Thanks.

1,330 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @bcelikte,

I am glad that you have figured it out!

Maybe the cause for changing the algorithm is the endianness: the S32K144 is Little Endian, while the MPC5744P is Big Endian architecture. Another cause might be the Row-Major and Column-Major Array Layouts different from C to MATLAB.

Regards,

Marius

0 Kudos

1,326 Views
bcelikte
Contributor III

Hi @mariuslucianand ,

I don't think that is about MATLAB to C Row-Major and Column-Major Array Layouts difference. It wouldn't be run on S32K144 also if it was that.

But little and big endian can be the issue. I am wondering that how "Alignment" block handle that then. Anyways, thanks again.

0 Kudos

1,414 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @bcelikte,

If the code is generated well and the mot file reaches on the board, indeed there might be an issue with the execution order of some and the application can get stuck at some point. Are you running the same example I've sent to you in the mentioned post?

What I would do would be to start first testing with the gpio example from our toolbox just to validate the hardware. With this simple example, you should be able to test that the setup is fine, you have the right connections and the board works.

After that, I would try to check the FreeMaster. Again, we have a very simple example for FM. With this one, you can check if the UART connection is set right. Be aware that the MPC5744P rev E has different pins connected to the onboard USB to Serial, so please check the schematic.

Once the setup has been validated, consider commenting blocks until the FreeMaster connection works, and with this method, you can find the source of the issue.

Also, be aware of the bootloader usage. Please connect the FreeMaster after a couple of seconds after powering the board, otherwise, it will remain inside the bootloader. Try checking to see if the led blinks without the FreeMaster connection.

Hope this helps,

Marius

0 Kudos