Model-Based Design Tool on custom pcb

cancel
Showing results for 
Search instead for 
Did you mean: 

Model-Based Design Tool on custom pcb

Jump to solution
347 Views
Contributor II

Hello all,

actual I'm using the Evalboard with S32K144 on it, together with the Model Based Design Toolbox for Matlab/Simulink. And this works great!

Now I have designed a custom PCB with the S32K144 on it. And I have routed out the SWD and the UART Interface.

Is there a way to us the Model Based Design Toolbox?

My Plan is to use the Evalboard as an OpenSDA Interface to program my custom pcb.

I already routed out the Interfaces from the evalboard, but it don't work.

How do I have to modify my Evalboard to do this?

Do I Need a Bootloader or something for the S32K on the custom pcb?

I hope someone can help. Maybe some of you made already something like this?!

Thank you,

Felix

1 Solution
42 Views
Contributor II

Hello Marius,

i made it work!

I tried a lot, actual I'm not able to say what was the problem. But now I can program the S32K on the custom ECU over open SDA.

At the end I removed the resistors R122 and R127. As you said, to use jumpers on J106 and J8 should have the same effect. And I connected SWD Dio, SWD CLK, GND, Reset and VDD from the J124 to the customboard.

Additional I removed R61 and R62 and soldered cables towards the UARTS. So I can use the external mode also.

Thank you for your help!

View solution in original post

7 Replies
42 Views
NXP Employee
NXP Employee

Hello felix.boeckmann@zf.com‌,

For openSDA you don't really need to flash anything, it will deploy the code on the target. You can also try to test the board using the S32Design Studio because you should be sure that the mcu is powered up and running. 

For the Bootloader you need to flash the rbl file from the  {AddOns\S32K\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\BootLoader\RBF_Files}. It should be flashed with the S32 Design Studio over SWD/JTAG.

But consider firstly using an USBtoSerial on PC6 and PC7, was tested, should work directly from Simulink.

If I were you, I would try firstly to access the mcu using the openSDA or an external JTAG/SWD from the S32DS just to be sure that the pcb design is fine and the processor is up and running. 

Consider also sending me (in private if it is not public) your schematic to have a look on what's there. 

Hope this helps,

Marius

0 Kudos
43 Views
Contributor II

Hello Marius,

i made it work!

I tried a lot, actual I'm not able to say what was the problem. But now I can program the S32K on the custom ECU over open SDA.

At the end I removed the resistors R122 and R127. As you said, to use jumpers on J106 and J8 should have the same effect. And I connected SWD Dio, SWD CLK, GND, Reset and VDD from the J124 to the customboard.

Additional I removed R61 and R62 and soldered cables towards the UARTS. So I can use the external mode also.

Thank you for your help!

View solution in original post

42 Views
NXP Employee
NXP Employee

Hello felix.boeckmann@zf.com‌,

I'm glad to hear that and thank you for sharing your solution!

Best Regards,

Marius

0 Kudos
42 Views
Contributor II

Hello,

sorry for the late reply and thanks for your answer!

I tried out the second way. But it doesn't work. Simulink is building and seems to do, but on the pcb nothing happens.

I also soldered out the R122 and R127.

Do I need to do something with the S32K on the custom board?

In the next step I will try the first way you mentioned.

0 Kudos
42 Views
NXP Employee
NXP Employee

Hi felix.boeckmann@zf.com‌,

I am sorry to hear that!

The first approach should work flawlessly.

pastedImage_1.png

For what you tried, now having a more closely look on the EVB schematic, the pcb designers provided the J105(RST), J106(DIO), J8(CLK) jumpers, but not populated. By default (as you can see in the image below) they are connected, so instead of desoldering R122 and R127 you can just break their links and use the jumpers pin 1 to connect to the target. But where you connect the SWD wires does not affect the functionality.

However, what I am wondering right now, is whether you have connected or not the GND between the boards, this is very important. And also, you need to be sure that the V_TGTMCU has the same voltage with the one that the slave controller has, 5V. The thing is the OpenSDA works at 3V3 logic level while the S32K144 runs at 5V. The 74LVC2T45GM works as a level shifter so it should be powered both ends. Last to be checked is if the J104 on the EVB has the right connection (2-3) and if the RST pin triggers the slave controller you need to flashed.

You can also try to use the S32Design Studio to see if you can connect to the slave controller over the OpenSDA on the EVB board. 

Hope this helps,

Marius

0 Kudos
42 Views
Contributor II

Hello Marius,

thank you for your reply. So I checked some things. The GND ist connected and also the Voltage drives from the Evalboard (form the JTAG Header). So I think this should be the right one. Also I proved all signals out of the header.

I checked something else: Instead of the 8MHz we used a 40MHz quartz for the custom pcb. Of course I changed the settings in the configuration block. But could this cause a problem? I thought the open SDA has his own quartz, so I didn't expected problems, but this is also a 8MHz.

An another question: for openSDA I really don't need to put a bootloader or something on the S32?

Parallel I tried out the serial connection with the rappid bootloader. But when I wanted to put the bootloader with the bootloader tool on the S32K (and CANcaseXL) I got the failure "ccp communication error".

Is there a solution for that?

0 Kudos
42 Views
NXP Employee
NXP Employee

Hello felix.boeckmann@zf.com‌,

Nice to hear that you are using our toolbox on your custom PCB!

I think there are 2 ways of using our MBDT toolbox on your custom PCB:

1. The easiest way is to use the RappID bootloader. This means that you need to flash the rbf file that comes with our toolbox {AddOns\S32K\Toolboxes\NXP_MBDToolbox_S32K1xx\code\tools\BootLoader\RBF_Files} on the MCU.

After that you need to select in the config block the Serial way of downloading the generated code on the target like in the image attached. 

pastedImage_6.png

But this bootloader uses the UART 1 pins PTC6/PTC7. What pins have you routed out?

For more info, please have a look on this topic (even it is for MPC5744P, the procedure is the same) https://community.nxp.com/message/1102835?commentID=1102835#comment-1102835

2. If you really want to use the OpenSDA from the EVAL Board, I think you need to consider connecting the pins from J14 (from the EVB schematics) to your custom PCB: RST/DIO/CLK pins. Don't forget about the GND!

pastedImage_1.png

But if you connect them directly, now you have two MCUs connected to the same openSDA so you need to break the DIO and CLK signals connection with the MCU from the EVB. You can do this by removing the 0R resistors R122 and R127 according to the S32K144EVB-Schematic, page 3.

Hope this helps you!

Marius