S32K142 - MC24 Flashing error through S32DS and Matlab issue

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

S32K142 - MC24 Flashing error through S32DS and Matlab issue

Jump to solution
2,653 Views
DarioZanni
Contributor II

Good morning,
I'm a thesist student and I bought this hardware:
- Board: NXP MCSXTE2BK142
- UART adapter: FDTI UMFT230XB-01
- J-Link SEGGER adapter: NXP LPC-Link 2
The goal is to program the board through a simulink file for FOC motor control drive but i'm starting with a simple red led (D1) turning on.
I first connected both JTAG and UART cables and I uploaded the rbf file in the board with S32DS v.2.2 clicking on the flash button, setting as in picture "1.jpg" then I clicked on "Flash" and, after J-Link V.7.62 terms of use accepting, I obtain that the debugging will freeze at "starting target cpu . . ." in "2.txt".
After some time I tried to disconnect the board and then errors appear.
However, I then reconnected JUST the UART cable to USB and I tried to build the Simulink file Verify_SW_HW_Setup.slx (here zipped) with the set-up showed in “3.jpg” but when I build it, the errors contained in "4.txt" appears.
Can someone help me?
Thanks in advance.
Dario

0 Kudos
1 Solution
2,550 Views
DarioZanni
Contributor II

I solved the problem by restarting the board when requested (after BAM) by short-circuit the pin 10 of the JTAG connector (reset pin) with the GND and pressing "ok" in the restart request within 5 sec. 

View solution in original post

0 Kudos
4 Replies
2,633 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @DarioZanni ,

Forst of all I would recommend you to have a look at the following thread https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/MCSXTE2BK142/m-p/1078629 

Here the other customer was using an S32K142 to flash the board, but it is not necessary in your case.

Anyway, there are multiple issues you have reported:

1. Step 1 is to flash the rbf file. It should work with the J-Link as well, please check on the S32DS community for similar posts as well.

2. For flashing the code, if step 1 is successful, you shall also check the below option. When the MCU boots up, it enters the bootloader flashed la step1, and waits around 5 seconds to receive a new flash file. Otherwise, it will start executing the one existing. IF you check the below checkbox, it will ask you to manually reset the board,  so you will have time to synchronize this process, by resetting the board and pressing the ok button.

mariuslucianand_0-1645790683077.png

3. Building process. According to the attached log, somehow you're using the lcc64 compiler, which is not something you can use for cross-compiling the generated code to run on our target.

C:/PROGRA~1/MATLAB/R2020b/sys/lcc64/lcc64/bin/lcc64

  I've seen in your config block that you have selected the GCC compiler. Have you changed the environment variable to switch it to lcc?

Regards,

Marius

0 Kudos
2,551 Views
DarioZanni
Contributor II

I solved the problem by restarting the board when requested (after BAM) by short-circuit the pin 10 of the JTAG connector (reset pin) with the GND and pressing "ok" in the restart request within 5 sec. 

0 Kudos
2,598 Views
DarioZanni
Contributor II

.slx file

0 Kudos
2,565 Views
DarioZanni
Contributor II

Hi and thank you so much for fast reply.

For what concern the compiler, I just followed passages as in this post: https://community.nxp.com/t5/Model-Based-Design-Toolbox-MBDT/Module-1-Environment-Setup/td-p/734725 but this time I also installed MinGW-w64 C/C++ Compiler in Matlab (am I wrong? Do I have to uninstall it?). I do want to use GCC compiler but I don't know how (i thought it was included in mbd toolbox since i have the folder called "gcc-6.3-arm32-eabi"). I've seen that in my simulink configuration parameters NOW there is the compiler as in "compiler.jpg" and before there was llc64 as you correctly noticed.

For what concern the rbf bootloader file flashing, I saw the thread you linked but and i followed it to firstly flash the .rbf file but the first strange thing was that the process stopped at "Starting target CPU..."
Now I will do the steps again following you and I will attach photos. This time I will try to use S32 DS for ARM2018.R1

1) Flashing .rbf file as in "flash.pdf" and obtain the following console messages on S32DS "console.txt" (another way could be to flash with J-Link flash lite and I've done but the following errors appears in the same way)
2) Disconnected the board
3) Connect just the UART cable

4) Opened .SLX file but this time I checked the box as you suggested to me. The problem is that even if it could stop before to reset (and it never ask to reset), I don't know how to reset since i don't have any button (board photo in "board.jpg")

5) Build and now (after changed the compiler) the error seems different, as it is in "codebuild.txt" (attached in next post because of the max 5 files to attach)

Please help me, i don't really know how to proceed..

Have a nice day, Dario

0 Kudos