2020-08-17 04:20 AM
Hi all,
I'm trying to profile my application which running on STM32F469IH6 micro-controller.
I'm able to run the application in debug mode and able to see the timings of the applications.
But In generally running application in release mode will have more optimizations included compared with the debug mode. But If I run the application in Release mode then i'm encountered with below error.
Below is log at the time of running application in release mode:
STMicroelectronics ST-LINK GDB server. Version 5.6.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
-------------------------------------------------------------------
STM32CubeProgrammer v2.5.0-RC1
-------------------------------------------------------------------
ST-LINK SN : 066DFF535254887767171939
ST-LINK FW : V2J37M26
Board : 32F469IDISCOVERY
Voltage : 3.27V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x434
Revision ID : Rev A
Device name : STM32F469xx/F467xx
Flash size : 2 MBytes
Device type : MCU
Device CPU : Cortex-M4
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a09660.srec
File : ST-LINK_GDB_server_a09660.srec
Size : 676208 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 9]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:12.201
Verifying ...
Download verified successfully
Debugger connection lost.
Shutting down...
Thanks in advance.
2020-08-17 05:57 AM
If your application runs fine in Debug, but not in Release, this typically indicates there is an bug somewhere that doesn't get tripped by Debug mode. This could be due to reading uninitialized data, a race condition, or something else. There is not catch-all solution. You'll need to debug the program and determine where/what is causing the issue.
Just because it works in Debug mode doesn't not indicate there are not bugs.
Your log shows the program was downloaded successfully. No information there.
2020-08-17 06:54 AM
Hi @TDK ,
I don't see any issue in the code.
I feel this could be an configuration issue. Did you see similar issue earlier.
Also, Is there any specific things i need to configure for release mode.
I ran the application in Release mode again in Verbose mode. Please find the attached log.
STMicroelectronics ST-LINK GDB server. Version 5.6.0
Copyright (c) 2020, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
LogFile Name : C:\Users\hp\STM32CubeIDE\workspace_1.4.0\ActivityRecognition1\Release\st-link_gdbserver_log.txt
Logging Level : 31
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Enabled
SWD Debug : Enabled
InitWhile : Enabled
Target connection mode: Under reset
Hardware watchpoint supported by the target
COM frequency = 4000 kHz
ST-LINK Firmware version : V2J37M26
Device ID: 0x434
PC: 0x80012b0
ST-LINK device status: HALT_MODE
ST-LINK detects target voltage = 3.27 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
Waiting for debugger connection...
Waiting for connection on port 61234...
Accepted connection on port 61234...
Debugger connected
Enter STM32_AppReset() function
NVIC_DFSR_REG = 0x00000008
NVIC_CFGFSR_REG = 0x00000000
------ Switching to STM32CubeProgrammer -----
-------------------------------------------------------------------
STM32CubeProgrammer v2.5.0-RC1
-------------------------------------------------------------------
Log output file: C:\Users\hp\AppData\Local\Temp\STM32CubeProgrammer_a07124.log
ST-LINK SN : 066DFF535254887767171939
ST-LINK FW : V2J37M26
Board : 32F469IDISCOVERY
Voltage : 3.27V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x434
Revision ID : Rev A
Device name : STM32F469xx/F467xx
Flash size : 2 MBytes
Device type : MCU
Device CPU : Cortex-M4
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a07124.srec
File : ST-LINK_GDB_server_a07124.srec
Size : 676208 Bytes
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 9]
Download in Progress:
�������������������������������������������������� 0%
����������������������� 47%������������������������ 95%��� 100%
File download complete
Time elapsed during download operation: 00:00:12.355
Verifying ...
Read progress:
�������������������������������������������������� 50%
� 2%� 4%� 6%� 8%� 10%� 12%� 14%� 16%� 18%� 20%� 22%� 24%� 26%� 28%� 30%� 32%� 34%� 36%� 38%� 40%� 42%� 44%� 46%� 48%� 50%� 52%� 54%� 56%� 58%� 60%� 62%� 64%� 66%� 68%� 70%� 72%� 74%� 76%� 78%� 80%� 82%� 84%� 86%� 88%� 90%� 92%� 94%� 96%� 98%� 100%
Download verified successfully
------ Switching context -----
Target connection mode: Under reset
Hardware watchpoint supported by the target
COM frequency = 4000 kHz
ST-LINK Firmware version : V2J37M26
Device ID: 0x434
PC: 0x80012b0
ST-LINK detects target voltage = 3.27 V
ST-LINK device status: HALT_MODE
ST-LINK device initialization OK
handle_vCont_c, continue thread
ST-LINK device status: RUN_MODE
Debugger connection lost.
Shutting down...
Also Please find the entire log from this link.
Thanks,
Hari
2020-08-17 07:14 AM
If you mean 'no source available for main()' is an error, it's not.
It's just the result of stripping symbol information from the application binary, which is usually done for release builds.
If you need (debug) symbols also for release builds you've to adjust the linker flags accordingly (e.g. remove the -s option for GCC toolchain).
I don't know if there is also a Cube config item for that. I don't use Cube.
2020-08-20 09:10 AM
2020-08-20 09:13 AM
2020-08-20 12:18 PM
> I don't see any issue in the code.
> Also, Is there any specific things i need to configure for release mode.
You're looking for a magic solution. The only reason something can work in Debug but not in Release is if there's a bug somewhere. Focus on that instead.
Your log looks completely normal and has no error messages. I don't see why you're attaching it.
2020-08-21 01:58 AM
hi @TDK ,
Thanks for your response.
My application size was greater than RAM size. Please find the attached screenshot. This could be the reason it was failing in Release mode. Can you confirm on this?
If this is the reason for failing in release mode, then how it was running in Debug mode? (or) Is this expected?
2020-08-21 06:18 AM
Hello. Problem that source file can't be found can be related to missing debug information. Check your compiler settings for release.
2020-08-21 06:58 AM
> My application size was greater than RAM size. Please find the attached screenshot.
Why do you think that? The screenshot shows your application is using 1.13% of the total available RAM. Doesn't seem like it's too big to me. If you overflow a region, the linker will give you an error.