S32K118 Failed to connect MBDT

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

S32K118 Failed to connect MBDT

Jump to solution
3,923 Views
NPXLONG
Contributor III

Hi @mariuslucianand,

I was trying to flash the S32K118 EVB based on MBDT.  However, before I started to use MATLAB/Simulink MBDT, I have practice how to use S32 arm studio to flash the S32K118 jumpstart firmware and utlizing the freemaster to monitor the (ADC and led control) performance 1st. This ensures the S32K118 evaluation board has no communication issues.

However, I tried a few examples for MBDT S32K11X  called "GPIO_ISR_control_s32k11x" and to perform (built and code generation) based on "embedded coder" in Matlab/Simulink. I have properly setting the target connection between download interface and openSDA drive.  Anyway, I manage to generate the C-script and Elf file these parts have no issue, but I cannot successfully load the program into the S32K118 using Matlab/Simulink. I also double checked the baudrate on device manager to ensure there's no mismatch.

I have implemented the same code generation method using other MCU such as TI C2000 and Arduino which working properly as expected.

After that, I keep trying on another example which called "flash_bam_download_s32k118" (See attached). But this required to load the "S32K118_Bootloader.rbf" which can be found the file path from  "MBDTOOLBOX" -> "BOOTLOADER" -> "RBF_FILES" so I selected the " S32K118_S32DS..xxx.rbf".

I opened the S32 Studio for ARM to flash the rbf file by selecting on top of the Tab lists "Flash from file" and entered to the flash configuration page to flash the .rbf. I suspected that did I implemented the proper way to flash the rbf file to S32K118?

@mariuslucianand  I wish if you can provide some of the procedure on how to flash the bootloader based on this example "flash_bam_download_s32k118". Additionally, I also hope that to know on how to load the program code using embedded coder for this example "GPIO_ISR_control_s32k11x".

I read through many articles on the MBDT community but still cannot solved the issues yet.

I was placing an order last two days ago for the BMS development kits such as S32K144EVB+MC33771TPL/33772+14battemulator +6Battemulator. However, I really wish if I can familiar with more MBDT examples and features before my BMS hardware development kits arrive at that time.

Best Regards,

0 Kudos
1 Solution
3,894 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @NPXLONG 

There are two ways of deploying the generated code on the S32K1xx evbs:

1. Using OpenSDA

When you connect the board to the host PC a new drive PC should appear on your Computer ( I don't have right now an S32K118, I will use S32K116). If not, please contact your System administrator, or try another USB port ( we faced this issue before)

mariuslucianand_0-1607501089070.png

Now, using this method, Simulink will copy the .mot generated file (is generated automatically from the .elf) into this drive and the Open SDA chip on the board will flash the controller. From your screenshot, you are using this in the gpio_ISR_control example. Also, on the S32K118 make sure you select the 64 pin package, I think this one is on the board.

 
 

Also, just for testing, you can copy-paste by hand the .mot file on the mounted disk.

2. using RappId bootloader.

Indeed you have to flash that .rbf file on the board using the S32DS. This bootloader uses the UART connected to the USB to wait for the program on the serial for a couple of seconds after boot. In Simulink, the following settings must be performed:

 

image.png

Make sure that you have the Download code after build and Boot Assist Module ... checked. The first one is obvious what it does, but the second one, is very important. If will show a popup just before the code flashing process will start asking you to press the EVB reset button and within 5 seconds to press Ok on the popup window.

Hope this helps,

Marius

 

 

View solution in original post

0 Kudos
5 Replies
3,895 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @NPXLONG 

There are two ways of deploying the generated code on the S32K1xx evbs:

1. Using OpenSDA

When you connect the board to the host PC a new drive PC should appear on your Computer ( I don't have right now an S32K118, I will use S32K116). If not, please contact your System administrator, or try another USB port ( we faced this issue before)

mariuslucianand_0-1607501089070.png

Now, using this method, Simulink will copy the .mot generated file (is generated automatically from the .elf) into this drive and the Open SDA chip on the board will flash the controller. From your screenshot, you are using this in the gpio_ISR_control example. Also, on the S32K118 make sure you select the 64 pin package, I think this one is on the board.

 
 

Also, just for testing, you can copy-paste by hand the .mot file on the mounted disk.

2. using RappId bootloader.

Indeed you have to flash that .rbf file on the board using the S32DS. This bootloader uses the UART connected to the USB to wait for the program on the serial for a couple of seconds after boot. In Simulink, the following settings must be performed:

 

image.png

Make sure that you have the Download code after build and Boot Assist Module ... checked. The first one is obvious what it does, but the second one, is very important. If will show a popup just before the code flashing process will start asking you to press the EVB reset button and within 5 seconds to press Ok on the popup window.

Hope this helps,

Marius

 

 

0 Kudos
3,855 Views
NPXLONG
Contributor III

Hi @mariuslucianand,

Thanks for answering my question. I received a S32K144 evaluation board from NXP SG today. So I was swapping the S32K144EVB for testing the "gpio_s32k144" MBDT example. However, I still facing the communication issues between Method 1 and Method 2.

1) OpenSDA 

I have properly set the OpenSDA to F drive at MBD_S3214x_Config. While I perform the code generate the .mot file will be auto saved it on my F drive (See attachement - Drive_mot). You can review my settings on this example (See attachment - MBDT). It supposed to load the program after execute the code generation and the S32K144 should auto toggle the RGB -  Blue LED (PTD0) according to the state-flow implementation. However, I realized that near the "reset SW button" there's a RED LED was hold-on after the code generation is executed. By the way, S32K144 still does not respond to the program code that I loaded. 

2) Rappld bootloader.

Another example called "flash_bam_S32k144. I was also trying to use the Rappld bootloader utility to import .rbf file and the .rbf documents was provided by the mathworks the file path is called " .........mathwork/......../tools/bootloader/RBF files" (see attachment - RBD_Files). I clicked on the browser button and selected the rbf file called " S32K144_S32DS_UART0_CAN0.rbf" (see attachment - RappBL). The operation setup, I tried three operation setup either " Read MCU memory" , "Erase flash only" and "Erase and Program" when I press the start bootloader button and the bar status will loading for a few seconds and then popping out a power cycle error messages (See attachment - cycle_power_error).

I tried to implement both methods, but it doesn't seems working properly. I have been struggling these issues more than 3 days or above. I hope that I can solve the problem before my full sets of BMS and motor control development kits that arrive next week.

Best Regards,

0 Kudos
3,827 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @NPXLONG 

Let's focus first on the OpenSDA, and for now, let's use the GPIO example.

"there's a RED LED was hold-on after the code generation is executed" if the red LED (next to the reset button) is continuously turned on, this means that the MCU is continuously in the reset state.

First, let's validate the generated code by using S32DS. Please flash the Simulink generated elf (you will find it in the generated _ert folder) on the S33k board using the S32DS. And let's see if the program runs as expected. If it works, you can try to power cycle the board, and should run again and then you can try to copy paste again the code and see if everything works.

The second thing I am interested in is to open two files from the mounted device:

1. LASTSTAT.TXT - I am interested in the status

2. SDA_INFO.HTM you would get a webpage with similar content as below.

image.png

image.png

 

Waiting for your reply,

Marius

0 Kudos
3,808 Views
NPXLONG
Contributor III

Hi @mariuslucianand ,

Thanks for your helping Marius. I think I solved the problem for my S32K118 EVB. I can establish the communication issues between Simulink and S32K118EVB now.

However, I wish to know the second method as well on how to flash the brf using S32 Design studio. I always facing the issue when I flash the brf or elf always stucked at 99% loading. I will send you details screenshot on next reply threads.

Finally, I received my new development kits for S32K144 + BMS boards. I will give a try on the Simulink soon. Will ask you more question later  Thanks.

Regards,

0 Kudos
3,814 Views
NPXLONG
Contributor III

Hi @mariuslucianand,

Thanks for your supporting my case issues. I would like to further investigate with you about the S32K144 board as I received the Evaluation board from NXP SG today.

1) Using OpenSDA

Now I was trying to run the "GPIO_s32k144" (see attachment - MBDT) and try to auto toggle the Blue LED (PTD0) based on the existing stateflow. I executed the code generation using embedded coder but still not working as expected. I am confirmed that there's no system administrator issue for my USB port. As you can seen that, I can auto generate the .mot file on the F: drive in my case (see attachment - Drive_MOT). Probably should I change to other Drive name ?

 

2) Flash Bootloader

For the second example which is flash_bam_S32k144, as you mentioned this is the second method using UART instead of OpenSDA. I used the Rapp BL utility to flash the S32K144 board (See attachment - RappBL). @mariuslucianand may you please help me check whether my setting is correct? the .rbf files is obtained from the  " ......\tools\BootLoader\RBF_Files" (see attachment - RBF_files). When I clicked the start bootloader button always and few second later will pop-out the cycle power error message even I press the restart button more than 5 seconds and press okay still doesn't working. (See attachement - Power_Cycle_Error).

I have been struggling these issues more 3 days or above. Both connection method wont work for me,  only the S32 design studio and Freemaster can program the S32K118 or S32K144 boards. 

Hope I can solved the problem to run my BMS development and motor control kits.

Best Regards,

0 Kudos