Download code created with MBDT for S32K to UM11310 HV Battery management system?

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

Download code created with MBDT for S32K to UM11310 HV Battery management system?

1,366 Views
cjjohnson
Contributor I
  • System: Windows 10 
  • MATLAB Version: 2020a 
  • NXP Model-Based Design Toolbox for S32K1xx MCUs, version 4.2.0
  • UM11310 HV Battery management system

I'm trying to download code created with Simulink to the UM11310 HV Battery management system. This has a JTAG port but no serial port. So far, I haven't been successful. Are there any procedures on this?

0 Kudos
6 Replies

1,355 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @cjjohnson ,

Unfortunately, from the Simulink environment, you can only download the code either via USB and OpenSDA. So for now, you have to manually download the generated elf using the S32DS for ARM.

To do that, please install the S32DS for ARM alongside with the S32SDK for S32K1xx. You don't have to import the whole generated code in the S32DS. You can follow these steps:

1. Open S32DS for ARM

2. File -> New -> S32DS project from example. Choose hello_world_s32k144

mariuslucianand_0-1604570528475.png

3. once the project has been imported, go to flash button, Browse for the generated .elf, check Disable autobuild

mariuslucianand_1-1604570868742.png

4. Go to the next tab, Debugger, make sure you have a JTAG probe connected to the S32K and  detected( I am using the OpenSDA).

5. Press the Flash button, and now the code should run on the S32K.

 

Hope this helps,

Marius

 

 

1,347 Views
ranulf
Contributor IV

@mariuslucianandThank you for your help. I got an error on step 5, after pressing Flash. Unfortunately, the information in the error message was not very helpful. I am using the USB Multilink.

Flash error.png

I tried to flash a few times after changing different options. I got the same error message after every attempt. There were 2 device options for the S32K144 and I tried them both.

Flash config.png

1,341 Views
ranulf
Contributor IV

@mariuslucianandAn internet search got me to the following NXP community answer.  https://community.nxp.com/t5/S32K/Error-while-launching-command-version/m-p/689231/highlight/true

That seemed to change something and now I get a different error message.

PE Error.png

0 Kudos

1,333 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @ranulf ,

I usually get this error when the controller is not powered up or the JTAG probe is connected reversed. In any case, the probe can not access the controller. So please check first the power. Also, Multilink has two LEDs, I think both of them has to be powered up when the connections are fine.

From the screenshots attached, the controller selection seems to be fine.

I had a look at the HV BMS User manual here https://www.nxp.com/docs/en/user-guide/UM11310.pdf

Chapters 4 and 5 describe how to configure the hardware and also how to test a C code example. Can you please give this a try? If this code example works, we can start flashing the generated code from Simulink.

Hope this helps,

Marius

 

 

 

1,326 Views
ranulf
Contributor IV

Thank you @mariuslucianand

It turns out that the orientation of one of the plugs for the cable connecting the board to the Multilink was reversed.  Good suggestion. The correct orientation is shown in the photo. I have now loaded simple Simulink code that flashes the LED. It works!

UM11310 JTAG Plug Orientation.jpg

 

1,317 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @ranulf 

I am so glad it works and my suggestion got to you so fast!

For this setup, I hope this article can be a good starting point. It explains how to perform data acquisition on the TPL bus. You only have to check (and change them, if needs be) the two SPI peripherals pins that connect S32K with the MC33664 and should work.

https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/BMS-amp-MBDT-MC33771B-MC33772B-TPL-communi... 

Regards,

Marius