Is it possible to use MBDT development along with a CAN bootloader for s32k148?

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use MBDT development along with a CAN bootloader for s32k148?

521 Views
Poley
Contributor III

Hi all,

I am developing models to be implemented onto a S32K148 uC and so far using the EVB dev kit it works well programming through Simulink.

My question is: Is it possible to build Simulink code and then flash the code over CAN using a bootloader? If so is this functionality already provided? I saw RAppID but it doesn't seem to support this device.

Thank you in advance, appreciate the help!

0 Kudos
12 Replies

505 Views
Poley
Contributor III

I saw on some posts that RAppID workd with s32k148 when you flash the .rbf that is included: "S32K148_S32DS_UART1_CAN0.rbf". I have put this onto my board with S32DS but when trying to do anything with RAppID it shows an error:

Poley_0-1616062502676.png

Vector kit has been added:

Poley_1-1616062540324.png

 

Where am I going wrong with this? I appreciate any help!

Also once working is it possible to set something like a device ID? so if I have for example 3 S32K148 board connected to the same CAN bus can I select which one I want to program? Thanks in advance!

0 Kudos

443 Views
mariuslucianand
NXP Employee
NXP Employee

Hi @Poley ,

The settings you are using seem to be right. Please also try checking the "AutoRead File" Option in the RappID bootloader utility.

Make sure that the evaluation board is externally powered up with 12V because otherwise, the CAN transceiver will not work. The procedure is like this. You have to reset the board from the button and within 5 seconds you have to press the Start bootloader button. 

Unfortunately, I don't have the proper tools right now to give it a try on my side. Keep me updated, and if this is not working I will try to contact the RAppId bootloader team.

Regards,

Marius

 

0 Kudos

423 Views
Poley
Contributor III

Hi @mariuslucianand 

Changing to auto-read does fix the CAN error, thank you.

The issue now is that the application does not work once flashed. I have it working when downloading straight from Simulink to board.

RAppID lets me click "Start Boot Loader" even when I haven't reset the board (Which is the first red flag I noticed). The APP progress them goes to 100% and completes but nothing happens on the board. 

Is this because RAppID is looking for S32K144 rather than S32K148? 

I would greatly appreciate help from the RAppID team to get this bootloader working for S32K148. I would also like to know if there is a way of selecting which board to program. My plan is to have a few S32K148 boards on the same CAN bus and want to be able to flash each of them whilst connected together.

Lasty, what application file should I be flashing? I have been trying the .mot that is in my Simulink build folder, is that right?

Poley_0-1616577351699.png

Thank you I really appreciate the help!

0 Kudos

413 Views
mariuslucianand
NXP Employee
NXP Employee

Hi @Poley 

I will send a question to the RAppId bootloader team for the addressing issue that you are mentioning.

For the board not booting into the sent application, Can you please check in your model that the Download interface is selected for "Serial". By selecting this option, the generated mot file uses another linker file and this is the one that has to be sent over the RAppId Bootloader app. Can just for testing purposes try as well downloading over serial (not over CAN, directly from our toolbox) to see if the generated mots file boots up once the Download Interface is serial?

mariuslucianand_0-1616581597300.png

Hope this helps,

Marius

0 Kudos

396 Views
Poley
Contributor III

Hi @mariuslucianand 

I can successfully (Program runs on board) download over serial using these settings:

Poley_0-1616584111513.png

Poley_1-1616584126378.png

Poley_2-1616584132361.png

So maybe something wrong with the linker? I also could have programmed the .rbf incorrectly as well as a guess

Also, how do I know if I have 192 or 256KB SRAM?

Thanks

 

0 Kudos

359 Views
Poley
Contributor III

Hi @mariuslucianand 

Did you manage to get a response on this? 

Thanks!

 

0 Kudos

309 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @Poley ,

Let's give it a try with another linker file. I hope this will solve the not booting for the code sent over CAN.

1. Please type the following command in Matlab:

winopen(fullfile(mbd_find_s32k_root, 'mbdtbx_s32k14x\src\linker\gcc'))

2. In the newly opened window file please replace (please back up the existing files first!) the attached linker files.

Then give it a try by sending the code over CAN using the RAppID bootloader.

 

0 Kudos

160 Views
Poley
Contributor III

Hi @mariuslucianand 

 

Do you know if there is any update on getting a CAN bootloader to work with the S32K148? 

 

Thanks!

0 Kudos

271 Views
Poley
Contributor III

Hi @mariuslucianand 

Thank you for your reply!

Unfortunately this does the same thing. Allows me to flash but not application code is running on the board once the download has completed. It also still allow me to "flash" the .mot even without pressing reset first which also to me shows that there is an issue.

Could this be me flashing the .rbf file onto the board incorrectly or would it not flash at all if I haven't done it properly?

I have noticed that the 192 version only shows up in linker options even with 256 selected as SRAM. How do I know whether I need the 192 or 256 linker file? And if it's 256, how do I get it to select that one as only 192 shows in linker list. Here is my config box:

Poley_0-1617700240977.png

Poley_2-1617700284937.png

 

Also, I seems to get an issue where I can only build once in Simulink, if I try and build again I get the following error in the diagnostic box, is this something you have seen before?

Poley_3-1617700297226.png

Thank you very much for the help!

0 Kudos

217 Views
Poley
Contributor III

Hi @mariuslucianand 

Just to add onto this I am now getting these errors when trying to build:

Poley_0-1617982161446.png

 

Do you have any idea why this would have just randomly started happening? Or the permission denied error before. It's not something silly like my Simulink version is it? Currently using 2020b.

Still no where with the CAN bootloader.

Thank you for the help!

0 Kudos

97 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @Poley ,

For the errors, have you tried deleting the generated code folders, or maybe the CPU selection has been switched. Please try this and see if it is doing the same. Otherwise, please reset the MATLAB Path (Set Path to default) and inside our toolbox folder, there is a script called mbd_s32k_path.m. After the path has been reset please run the mentioned script file.

Now, regarding the CAN bootloader, I've discussed with my colleag from RAppID bootloader, he tested on his side the generated code and on his setup the code ran but after a hard reset after the code has been deployed. Can you try resetting the board after the code has been deployed?

Regards,

Marius

0 Kudos

82 Views
Poley
Contributor III

Hi @mariuslucianand 

Is your colleague using a S32K148? And selecting S32K144 on RAppID bootloader?

I am still having the issue where it seems that no application code is running. I have just tried again after flash is complete and resetting doesn't help. I have used the reset button and fully unplugged the board to see if it comes on but no luck. It does allow me to flash again so the bootloader is still on the chip, maybe it's never leaving the bootloader to get to the application code?

To see if I am doing everything right I use this process to flash the bootloader code:

Poley_0-1620242688954.png

Poley_1-1620242716569.png

Poley_2-1620242742461.png

Poley_3-1620242755462.png

And the I click flash, this seems to be successful.

I then build my model using the following linker settings:

Poley_4-1620242900577.png

Lastly I take the generated .mot file from the Simulink build and add it to RAppID as shown:

Poley_5-1620242994540.png

This completes successfully but as I say it does not run any application code no matter how many times I reset. Is it possible to ask your colleague if I am doing anything obvious wrong? Or if nothing is wrong with my process do they have a simple Simulink model that they can test first, and I can see if I get the same result? (To see if it's something wrong with how I have set up my model)

Thanks for the help!

 

 

0 Kudos