MCSXTE2BK142

cancel
Showing results for 
Search instead for 
Did you mean: 

MCSXTE2BK142

946 Views
hayaoki7
Contributor III

Dear sir,

I am thinking of using the MCSXTE2BK142 to turn a motor.
The question is, can I write the program to S32K142 from MATLAB directly with the SCI bootloader?
Or is it possible to write to S32K142 with SCI using another tool?

Best regards

22 Replies

585 Views
mariuslucianand
NXP Employee
NXP Employee

Hello hayaoki7‌,

Yes, you can directly program the board from Simulink using NXP MBDT for S32K1xx Toolbox by using RappID bootloader. I have attached the bootloader RBF file that has to be programmed on the board. It uses LPUART0 pins PTC2 and PTC3. 

If you have any questions related, adriantudor‌ can help you!

Hope this helps,

Marius

585 Views
hayaoki7
Contributor III

Hello 

Thanks for telling me how.
"MCSXTE2BK142" is a digikey and it takes about 2 weeks for delivery.
So I will try "MCSXTE2BK142" after about 2 weeks.
Please give us your advice again.

Best regards

hayaoki7

0 Kudos

583 Views
adriantudor
NXP Employee
NXP Employee

Hi hayaoki7,

To flash MCSXTE2BK142 directly from MBDT you need first to flash the ".rbf" file, that Marius-lucian Andrei has sent you, using SWD or JTAG interface. For SWD programming you can reuse an S32K144EVB (if you already have one). After that, to flash the MCSXTE2BK142 board directly from MBDT Simulink, you need a USB to UART (5V TTL) interface. And it will be easier for you to have a push-button for the Reset pin if you want to flash the board from MBDT.

Best regards,

Adrian

0 Kudos

583 Views
hayaoki7
Contributor III

Thanks Andrei

To be able to write directly from Simulink,
"MCSXTE2BK142" must first write the RBF file to S32K through SWD from openSDA in S32K144EVB.
Do you understand this?

If Simulink is not possible directly, can you use another SCI_Bootloader program and only SCI?
SCI can easily isolate the PC and the target microcomputer. You can also use FreeMaster with that pin, reducing the number of ports used for debugging and writing.

If you don't have such a feature yet,
Is there a function to write only with SCI in the development plan of S32K MBT?

Best regards,
hayaoki7

0 Kudos

585 Views
constantinrazva
NXP Employee
NXP Employee

Hello hayaoki7 ,

We are currently working on adding support in our toolbox for this new part -- adriantudor‌ can explain how to change the bootloader and if you need to do any other changes in order to use MCSXTE2BK142 directly from our toolbox in Simulink.

Kind regards,

Razvan.

347 Views
hayaoki7
Contributor III

Dear Sir

I connected serial to the FMT terminal of MCSXTE2BK142 and built it.
Result
"Loss Communication with CCP MCU.
Please cycle power and try again. "
I got a timeout error and could not write.

The MATLAB version is R2020B.
Is the cause of the error the version of MATLAB?
Please tell me how to resolve.

Best regards
hayaoki7

 

0 Kudos

339 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @hayaoki7 ,

Reading the previous entries in this thread you tried before to program the mentioned board. The loss communication appeared when you've switched to R2020b? Was it working with previously Matlab versions?

The flashing algorithm uses serial and there should have nothing to do with the Maltab versions. Steps to check:

1. Make sure that you have flashed the correct RBF, the one mentioned in this thread.

2. Make sure that the USB2Serial converter that you are using, is connected to the right RX and TX pins. Also the same GND level is required.

3. Make sure that in the S32K142 config block you have selected the right COM port.

Hope this helps,
Marius 

0 Kudos

326 Views
hayaoki7
Contributor III

Hello Marius

Thank you for your answer.

 

1. Make sure that you have flashed the correct RBF, the one mentioned in this thread.

-------------------------------------------------- ---------------------------------------------

I thought MBDT4.2 could be downloaded as it is. Therefore, S32K142_S32DS_UART0_CAN0.rbf is not written.How do you write this file?Please tell me how to write.

-------------------------------------------------- ----------------------------------------------

2. Make sure that the USB2Serial converter that you are using, is connected to the right RX and TX pins. Also the same GND level is required.

-------------------------------------------------- --------------------------------------------
The USB serial converter is made by FTDI.
-------------------------------------------------- --------------------------------------------

3. Make sure that in the S32K142 config block you have selected the right COM port.

-------------------------------------------------- --------------------------------------------------
Set the COM port appropriately in the MBD_S32K1xx_Config_Information block.
-------------------------------------------------- -------------------------------------------------

Best regards
hayaoki7

0 Kudos

313 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @hayaoki7 

Let's treat them point by point.

mariuslucianand_0-1613466780927.png

1. To flash the rbf file, you have to use a JTAG/SWD probe on the SWD Debugger Connector (with yellow on the above board). As my colleague mentioned before, If you don't have a dedicated JTAG/SWD probe, you can reuse an S32K14x Evaluation board to act like flasher tool. In both cases, you have to open the S32DS for ARM and flash the rbf file from S32DS. You have to do this only once and then de Serial bootloader is on the board. Tell me what hardware you have and I can guide you through all the steps.

2. The FTDI is the right tool, you need to connect it to the FreeMaster UART Connector.

3.  That's great. When the rbf file will be flashed on the board, the Serial deployment should work as expected.

Hope this helps,

Marius

 

0 Kudos

303 Views
hayaoki7
Contributor III

Hello Marius

Thank you for your answer.

I have an S32K142EVB. You can write by connecting the cable to the J14 terminal of the board and connecting the SWD of MCSXTE2BK142 to the end. Remove S32K142 from S32K142EVB to make it available. I ordered a cable for SWD so I think I can try serial boot next week.

Best regards

Hayaoki7

0 Kudos

299 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @hayaoki7 ,

That sounds really good! The J14 is the right JTAG connection.

Just one thing I want to clarify here: when you say "Remove S32K142 from S32K142EVB to make it available." You should start by removing the J107. In this way, the S32K142 will not be powered. Removing J107 should be enough.

Hope this helps,

Marius

0 Kudos

279 Views
hayaoki7
Contributor III

Hello Marius、

Is there any documentation on how to use S32DS to write an RBL file to the target S32K? As a preparation, I removed the jumper of J107 and connected the SWD cable.

Best regards、
hayaoki7

0 Kudos

272 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @hayaoki7 ,

There are the steps:

1. Open the S32DS for Arm 2.1.

2. Press the flash from file button

mariuslucianand_0-1613989009385.png

3. In the new configuration, select the .rbf file as C/C++ Application, browse the .rbf file

mariuslucianand_1-1613989118596.png

4. go to Debugger tab, select OpenSDA, right target and in the the GDB executable type the following:

${S32DS_ARM32_TOOLCHAIN_DIR}/bin/${arm32_cross_prefix}gdb${arm32_cross_suffix}

mariuslucianand_2-1613989232933.png

5. Press Flash. 

This should be enough.

Hope this helps,

Marius

0 Kudos

253 Views
hayaoki7
Contributor III

Hello Marius,

Jumper J107 removal, 'S32K142EVB: J14 === MCSXTE2BK142: J4'  are connected. I started Flash Configurations using S32DS_ARM2.2. The connection is as shown in the photo. An error was displayed. Am I doing something wrong? please tell me.

Best regards.,
hayaoki7

hayaoki7_0-1614148494431.png

hayaoki7_1-1614148529789.png

hayaoki7_2-1614148552985.pnghayaoki7_3-1614148585042.png

 

0 Kudos

247 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @hayaoki7 ,

My guess is that the green board, the MCSXTE2BK142 is not powered up the S32K142 has to be powered up because it will be not powered over the JTAG cable.

But if you do so, basically the  you will also power up the controller on the S32K142 board and we don't; want that. So, there are two more steps that have to be made:

1. take off the jumpers from the J10 as well.

2. Unsolder the R117. This way the VDD that comes on the SWD J14 will not end up to the MCU from the board as well.. IN the future, if you solder the J15 you will be able to use again the MCU on the board.

Hope this helps,

Marius

0 Kudos

230 Views
hayaoki7
Contributor III

Hello Marius,

I removed J10. R117 is not removed. The two boards S32K142EVB: USB, MCSXTE2BK142: DC24V.
I turned on the power to the two boards. I did Flash. After that, the Debugger Console is displayed and nothing goes from Continuing. Is the RBL file written? please tell me.

Best regards,
hayaoki7

hayaoki7_0-1614240929158.png

hayaoki7_1-1614240958710.png

 

 

0 Kudos

224 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @hayaoki7 ,

I've tried to replicate your setup. I don't have the MCSXTE2BK142 so I've used another evaluation board. So let me describe the steps:

1. You have to desolder the R117 from the board. The R117 is a 0Ohm resistor and it is mounted in parallel with the J15. Over this 0Ohm resistor, the MCU is powered up so you have to make sure the MCU on the evaluation board is turned off. In the future, you solder a 2x1 header to the J15, and using a jumper you can use back the MCU on the board.

2. The J10 has to be connected in 2-3. The J10 selects the VDD that comes over the Jtag cable from the MCSXTE2BK142. It routes the VDD to the level shifters used by the OpenSDA.

3. The J107 has to be unconnected. 

Usi===142 details.png

Using this setup I was able to program the second MCU successfully. With this setup (EVB connected over JTAG cable), you can use the OpenSDA from the EVB as if it were mounted on the MCSXTE2BK142 so you can even program the board directly from Simulink as if you were programming the EVB board.

If you flash the RBF file using S32DS, you can then disconnect the JTAG cable and program the board over Serial using RappId bootloader. This is the test that the flashing was successfull. 

For the serial connection, you still need to use the USB2Serial on your Motor Control board connected to the header marked by you with TX and RX.

Hope this helps,

Marius

 

0 Kudos

195 Views
hayaoki7
Contributor III

Hello Marius,

You can now write directly from Simulink. thanks you.

A new problem has been found. That is, the writing speed of the program is very slow. It takes about 5 minutes to write the sample model ‘PMSM_OpenLoop_MCSXTE2BK142.mdl’. Is there a way to make it faster? The time was the same when I ran it with RAppID BL Tool.exe. Will CAN be faster?

Best regards
hayaoki7

0 Kudos

149 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @hayaoki7 ,

If the programming takes to long, if you keep the EVB connected to the MCSXTE2BK142 board, you can use while developing the algorithm the OpenSDA approach for programming if this is faster. Time will be the same as if you were using the OpenSDA approach.

Hope this helps,

Marius

0 Kudos

121 Views
hayaoki7
Contributor III

Hello Marius,

In the near future, I would like you to increase the program writing speed by increasing the version of RAppID BL Tool. However, for now, I write the program with open sda. Thank you for the serial boot.

Best regards
hayaoki7

0 Kudos