Hi,
I am using S32 Ds 3.5 IDE and using the PEMicro Multilink Universal Debugger to debug S32K312 MCU. I am able to debug successfully but unable to run or flash the code into the MCU. Help me to run or flash the program using the same debugger or suggest any other way to flash the program into the MCU.
Thanks.
Solved! Go to Solution.
I have tried a variation of the code I shared with you, using LPUART1 and the same pins (PTD14 and PTD15) that you're using, and it works correctly. I am attaching it so you can try it on your side and let me know if you see the same behavior.
- RomanVR.
Hi @RomanVR ,
I have used s32k312(MQFP 100 pin package) NXP controller which is on our custom board, and using S32 DS 3.5 for programming the MCU. I could be able to print UART logs continuously in debug mode, but the same code is getting failed after 10 seconds if the MCU is powered off and turned on again. I have used UART1 (PTD 13 & PTD14, Baud rate is 9600)and need to verify whether the there is an issue in code or bin file or in the custom board hardware. I have shared the corresponding bin file please check with your EVAL board.
Thanks.
Could you help me to create a new post with this issue?
I will gladly help you there with your problem.
- RomanVR.
It is important to consider that when you debug your code with PEMicro Multilink Universal Debugger, your MCU is also being flashed, therefore in order to help you I will need more details about your issue.
Note: Please take into account that you can use any example that adjusts to your RTD version. If you would like to run one with another RTD version, you will have to download and install that version of the RTD.
Best Regards! - RomanVR.
Hi Roman,
I am unable to run the examples from the link you've given. I was only debugging these days and this is the first time I've tried to flash the program.
I used PE Micro Debugger for debugging. For your reference I'll provide you the debug and run configuration settings.
For Debug:
1. Select project -> Build Config -> Set Active Build as Debug Flash -> Build project.
2. Debug config -> Select GDB PE Micro Debugger interface ->Set up configurations as follows
For Run :
1. Select project -> Build Config -> Set Active Build as Release Flash -> Build project.
2. Run config -> Select GDB SEGGER J-Link Debugging ->Set up configurations as follows
ERROR: Error while launching command: --version
I didn't find GDB PE Micro Debugger interface in the run config, so I used J-Link to flash the program and got error.
If I'm not wrong for debugging, Debug Flash build is used and for Flashing the program Release Flash build is used. In the same way, for debugging, debug config is used and for flashing Run config is used.
Correct me If I'm wrong.
Thanks.
The release version of .elf file doesn't contain any symbols and debug information and that is why you're having trouble at flashing your MCU, so please try to use the "Debug" configuration on the Debug Config window and try to flash with this new configuration and tell us if it helped.
Refer to this community thread: how could I use release with s32ds . It has information related to the topic that may be useful to you.
-RomanVR.
I understand what you want to do, and as per my understanding of what you're telling me, you're now able to run your program successfully in debug mode. So, as I was trying to explain previously, when you use the Debug Configuration, you're also flashing your MCU, since the debug tool helps you load the program into the flash/ram and run it either all at once or step-by-step. Now that you're able to debug and, therefore, flash your MCU, once you turn it on again, the program should already be loaded and executing in your MCU without needing any additional intervention.
To verify that the program is indeed running, I suggest testing it with a simple blinking LED example. This will allow you to see that after debugging and flashing, the MCU is indeed running the program after a reset or power-on reset. If the LED blinks, it confirms that the code is correctly loaded and executing.
- RomanVR.
Hi @RomanVR
Thanks that you've understood my query. I would like you to know that for the verification of the program execution after flashing, there are many ways we've used.
I'll mention few, 1. Pwm pulses will be generated 2. Uart logs print via TeraTerm 3. MCU will not power off ( There's an exception in the board, that by default CAN signal control the power consumption of the MCU, the MCU turns off after 5 mins. To prevent that we'll modify some registers through the code. )
My observation is that after running the program in debugging mode, the code works fine. But when the MCU board is turned off and powdered up, the program doesn't execute continuously. There are no pwm pulses generated. But the MCU doesn't power off, which means the CAN registers are modified. I also observed that the UART log in TeraTerm exactly stops after 9th iteration. This indicates that the program is in the flash memory trying to execute, but it stops.
As per your explanation, the program should work fine as it does in the debug mode.
What may be the possible reasons for this.
Thanks.
Could you please provide one of the verification codes where you have observed the issue, so we can test it on our side? Additionally, could you share the RTD version that you are currently using for this purpose?
Also, could you provide more details about your CAN code implementation? From my understanding, the code is designed to turn off the board after 5 minutes without receiving any CAN message. Correct me if I'm wrong.
Lastly, could you please confirm whether you are using a custom board or an EVB for this implementation?
- RomanVR.
Hi @RomanVR
We are using a custom board and have installed RTD version 3.0 and 4.0
And by default the CAN IC is in standby mode which turns off the MCU after 5 minutes. So we make the CAN IC to run in normal mode by modifying the registers via SPI lines of the MCU, which allows the MCU to be in on state until the external power supply is off.
I have tested a basic UART functionality code, which runs fine in the debug mode using the PE Micro Debugger. I have generated a bin file and used that to flash into the MCU via JLink Plus using the JLink commander.
I observed that the code starts executing and stops after sometime. Hope you understood. Suggest me any other tools or software to flash the MCU. Also let me know why the code fails to run continuously.
I will attach the code below.
Thanks.
I have tested your UART test code on the S32K312EVB-Q172 and it works successfully both in debug mode and without it. After a reset or power-on reset, the code runs continuously without any problems.
The only modification I made was changing the LPUART instance to LPUART[6], which allows the use of the debugger's USB cable as a UART serial port. I suggest you try running the same code on your side (since it worked on mine) and let me know if it works for you.
To flash the code I used both the PE Micro Debugger and the onboard debugger to load the firmware onto the board.
- RomanVR.
Hi @RomanVR
I don't have an EVAL board right now. I cannot test the code you've given, because LUART6 pins is used for other functions. Could you please tell me why it is not working using LPUART1. I need to use LPUART1 as per the requirement. Let me know if LPUART1 may be the reason for the flash error.
Thanks.
I have tried a variation of the code I shared with you, using LPUART1 and the same pins (PTD14 and PTD15) that you're using, and it works correctly. I am attaching it so you can try it on your side and let me know if you see the same behavior.
- RomanVR.