Skip to main content
HNall.1
Associate III
August 17, 2020
Question

Running application in "Release mode causes errors"

  • August 17, 2020
  • 20 replies
  • 10788 views

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.0693W000003PSBYQA4.png

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.

This topic has been closed for replies.

20 replies

HNall.1
HNall.1Author
Associate III
August 23, 2020

Hi @TDK​ , @Community member​ , @Rados?aw​ 

Particularly for this problem i have created a STM32 Project by including below simpler code in main.c file.[@TDK​  I found no issues in actual source project thats way i have created simpler project to showcase this issue]

#include <stdio.h>
 
int main(){
 
	int a=10, b=20;
	printf("Sum=%d \n", a+b);
	return 0;
}

Here also i'm facing the samw prolem. It was running perfectly fine in Debug mode. But in release mode i'm seeing below error.

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_a10292.srec
 File : ST-LINK_GDB_server_a10292.srec
 Size : 4920 Bytes
 Address : 0x08000000 
 
 
Erasing memory corresponding to segment 0:
Erasing internal memory sector 0
Download in Progress:
 
 
File download complete
Time elapsed during download operation: 00:00:00.359
 
 
 
Verifying ...
 
 
 
 
Download verified successfully 
 
 
Debugger connection lost.
Shutting down...
 

Thank you,

Hari

waclawek.jan
Super User
August 23, 2020

In mcu, you never return from main().

JW

PHill.1
Visitor II
April 30, 2021

Most of the STM32 MCUS have in place execution, that is instructions are executed directly from flash, so you typically dont loade the whole application into memory.