I'm developing the MPC5741P. I want to download the elf/hex file to the hardware ECU automatically.
For example, i do not want to select Debug Configuration dialog, all these configurations can be runned automatically.
So S32 Design Studio hase any API for me to download automatically?
已解决! 转到解答。
Hi,
in attachment is post_built.bat script which is working for me. You need to start separate terminal windows:
Add script into post build steps in project properties:
Here is result:
If you need to close these terminal windows automatically (after timeout for example 30 sec)- you can use windows batch commands:
timeout /t 30
taskkill /im powerpc-eabivle-gdb.exe
taskkill /im pegdbserver_power_console.exe
hope it helps.
Jiri
Hi,
you can use command line for elf upload. If you add commands into .bat file - you can execute this file as post build step.
https://community.nxp.com/message/1048305
Hope it helps.
Jiri
Hi, Jiri
Before I make a mistake.
Now I connect the board to the PC with PE Micro MULTILINK UNIVERSAL.
Method 1:
I ues the following commands:
target remote localhost:7224
load E:\download/examples_r2015.elf
but something error:
The error message(Japanse) means: You tried to connect a drive to a directory on a drive that is already connected.
Method 2:
In S32 Design Studio installed path(C:\NXP\S32DS_Power_v2017.R1\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_1.7.2.201709281658\win32), I execute following command:
pegdbserver_power_console.exe -startserver -device=MPC5744P
Then I execute the commands I descriped in Method 1, the cmd figure is shown as following:
I don't know the difference between above two methods.
And another question, in method 2, When I see the message (Transfer rate: 4 KB/sec, 882 bytes/write.)
Does it mean that the program is uploaded into the board? The program is running ? If I want to stop the run of program, I just use 'stop' in CMD window?
Hi,
the error is probably caused by backslash in your load command - E:\ . The gdb client comes from Linux where is used normal slash for directory separator. It should work with load E:/download/examples...
Yes, program was uploaded into device. Here is summary of most common commands:
Linux Tutorial - GNU GDB Debugger Command Cheat Sheet
Hope it helps.
Jiri
HI Jiri
Now I connect the board to the PC with PE Micro MULTILINK UNIVERSAL.
I ues the following commands:
target remote localhost:7224
load E:\download/examples_r2015.elf
but something error:
The error message(Japanse) means: You tried to connect a drive to a directory on a drive that is already connected.
So my question is : how to specify the already connected target?
Hi Jiri
I think start gdb server is needed before I upload the .elf into the board.
But here is a question.
As you do, I need to open two cmd window when I use commands to upload the program manually.
Step1
Start gdb server. (I could not close the dos window before I open an another dos window to execute step2)
Step2
open an another dos window to enter gdb mode to execute following commands:
powerpc-eabivle-gdb --command=E:/download/my_commands.txt
So how can I do the above steps in one script?
For example, I write test1.bat for step1 and test2.bat for step2.
I also write test.bat to call test1.bat and test2.bat.
The result is dos window is always as following:
The scripte is still in test1.dat, can not run to test2.dat.
Hi,
in attachment is post_built.bat script which is working for me. You need to start separate terminal windows:
Add script into post build steps in project properties:
Here is result:
If you need to close these terminal windows automatically (after timeout for example 30 sec)- you can use windows batch commands:
timeout /t 30
taskkill /im powerpc-eabivle-gdb.exe
taskkill /im pegdbserver_power_console.exe
hope it helps.
Jiri
Hi, Jiri.
Thank you for your answer.
By your method, I have some trouble.
I use the command to flash the .elf into the MPC5741P board with PE micro MULTLINK UNIVERSAL.
commands I used are as following:
target exec E:\download/examples_r2015.elf
load E:\download/examples_r2015.elf
but something error occurs:
so how can i download the .elf file into the board and debug the program.
Is there any document I can read related with the command?