RDVCU5775EVM Upload Simulink Code Problem

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

RDVCU5775EVM Upload Simulink Code Problem

Jump to solution
1,245 Views
MuhammedAhmet
Contributor II

Hello  everyone

I upload the code I generated from Simulink to the device via USB Multilink and see that it works.

but it never works again when I press reset on the device.

what could be the reason for this?

 

 

0 Kudos
1 Solution
1,205 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @MuhammedAhmet 

Most likely the boot process after restart is affected by the linker file. The linker file we provide in our toolbox is designed to work with the RAppID bootloader, but since you are downloading the code using Multilink, we must change the linker file.

1. Please go to Matlab and type the following command

winopen(fullfile(mbd_find_mpc_root, 'mbdtbx_mpc577x\src\linker\gcc')) 

2. In the newly opened window, please paste the attached linker file (extract it from archive).

mariuslucianand_0-1617349859129.png

3. Type the following command and please replace the p code attached to the archive.

winopen(fullfile(mbd_find_mpc_root, 'mbdtbx_mpc\mscripts\config'))

4. Open your model, select the MPC5775B mcu, then go to Build Toolchain, uncheck the "Default Target Memory Definitions" and in the dropdown please select the newly added MPC57775B_flash_multi.

mariuslucianand_1-1617350967426.png

 

Now you can build and flash the code using USB Multilink.

Hope this helps,

Marius

 

View solution in original post

5 Replies
1,189 Views
MuhammedAhmet
Contributor II

Hello @mariuslucianand 

 Thank you it worked. I have one more question;

When the device is in normal mode, it works for a second or two and goes to sleep.

KL15 connected +12V  ==>  The result does not change.

How can I run the device in normal mode?

 

 

0 Kudos
1,171 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @MuhammedAhmet 

Can you please describe what you are trying to do? Are you trying to communicate over CAN?

Also, is the J1 connected, so the SBC is in debug mode?

Regards,

Marius

0 Kudos
1,167 Views
MuhammedAhmet
Contributor II

Hello @mariuslucianand 

There is a simple code. 

Yes J1 connected. Works fine in connected state  

but when not connected SBC does not work.

0 Kudos
1,154 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @MuhammedAhmet 

The SBCs behavior is quite normal. When you have the J1 connected, it will run in debug mode and will not reset the MCU. But when the J1 is not connected, the SBC will be active and at some point its watchdog will be enabled and it will reset the MCU.

Now you have two options:

1. Keep the J1 connected and the SBC in Debug mode as long as you want to develop your application.

2. If you want to use the SBC in your application, this has to be configured via the SPI protocol. Now, we do not provide blocks in MBDT for this SBC, but, on the NXP website you will find the C driver for this SBC here: https://www.nxp.com/products/power-management/pmics-and-sbcs/safety-sbcs/grade-1-and-grade-0-safety-... 

You can use this C driver code in the Simulink model by inserting custom code. To help you with that, we have the following article which describes the custom code insertion process.

https://community.nxp.com/t5/NXP-Model-Based-Design-Tools/How-to-use-your-own-C-code-in-our-Toolbox-...

Hope this helps,

Marius

1,206 Views
mariuslucianand
NXP Employee
NXP Employee

Hello @MuhammedAhmet 

Most likely the boot process after restart is affected by the linker file. The linker file we provide in our toolbox is designed to work with the RAppID bootloader, but since you are downloading the code using Multilink, we must change the linker file.

1. Please go to Matlab and type the following command

winopen(fullfile(mbd_find_mpc_root, 'mbdtbx_mpc577x\src\linker\gcc')) 

2. In the newly opened window, please paste the attached linker file (extract it from archive).

mariuslucianand_0-1617349859129.png

3. Type the following command and please replace the p code attached to the archive.

winopen(fullfile(mbd_find_mpc_root, 'mbdtbx_mpc\mscripts\config'))

4. Open your model, select the MPC5775B mcu, then go to Build Toolchain, uncheck the "Default Target Memory Definitions" and in the dropdown please select the newly added MPC57775B_flash_multi.

mariuslucianand_1-1617350967426.png

 

Now you can build and flash the code using USB Multilink.

Hope this helps,

Marius