Skip to main content
Associate II
Nov 11, 2026 2:04 PM UTC
Question

STM32C542RCT6 – Firmware Downloads Successfully but Does Not Start

Title: STM32C542RCT6 – Firmware Downloads Successfully but Does Not Start

Hello,

I am working on an STM32C542RCT6 project using STM32CubeMX2, STM32CubeIDE and CMake.

I am facing an issue where the firmware downloads and verifies successfully, but the application does not start.

The debugger stops at an unexpected address (0x0BF87944) and shows the message:

Break at address with no debug information available, or outside of program code.

I have checked the following:

  • Other firmware projects are downloading and running successfully on the same evaluation board.

  • ST-LINK programming is working.

  • The MCU is correctly selected as STM32C542RCT6.

  • The firmware download shows "Download verified successfully".

My linker script is named stm32c542xb_flash.ld, and I am not sure whether its memory configuration is correct for STM32C542RCT6. also i attached the cmakelist.txt and linkerscript check is ther any chnages neede there .

Could anyone help me verify the correct linker script, startup file, and heap/stack configuration for STM32C542RCT6?

Thank you.

6 replies

Andrew Neil
Super User
Nov 11, 2026 3:49 PM UTC

You haven’t said what board this in on.

 

How is the BOOT0 pin connected ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
harishDSTAuthor
Associate II
Nov 11, 2026 6:00 PM UTC

see  i am using the controller called stm32c542rct6 and evk is MUCLEO-C542RC ok the ssue i founs is when i add the freertos to the project even it is not coming to main before main itslef it jumping to the 0x0BF87944 u can see that in above pasted image when remove the freertos thing its working what is the issue and also i checked the other project which are working fine which dont have the freertos in that tis weill ruled out the board issue 

/**

******************************************************************************

* file : main.c

* brief : Main program body

* Calls target system initialization then loop in main.

******************************************************************************

*

* Copyright (c) 2025 STMicroelectronics.

* All rights reserved.

*

* This software is licensed under terms that can be found in the LICENSE file

* in the root directory of this software component.

* If no LICENSE file comes with this software, it is provided AS-IS.

*

******************************************************************************

*/

/* Includes ------------------------------------------------------------------*/

#include "main.h"

 

/* Private typedef -----------------------------------------------------------*/

/* Private define ------------------------------------------------------------*/

#include "mx_freertos_app.h"

/* Private macro -------------------------------------------------------------*/

/* Private variables ---------------------------------------------------------*/

/* Private functions prototype -----------------------------------------------*/

 

/**

* brief: The application entry point.

* retval: none but we specify int to comply with C99 standard

*/

int main(void)

{

/** System Init: this code placed in targets folder initializes your system.

* It calls the initialization (and sets the initial configuration) of the peripherals.

* You can use STM32CubeMX to generate and call this code or not in this project.

* It also contains the HAL initialization and the initial clock configuration.

*/

if (mx_system_init() != SYSTEM_OK)

{

return (-1);

}

else

{

/*

* You can start your application code here

*/

 

/* Create application tasks */

if (app_synctasks_init() != 0)

{

while (1)

{

/* FreeRTOS task creation error */

}

}

 

/* Start FreeRTOS scheduler */

vTaskStartScheduler();  → when i conneted this lines which i made bild than it wirking means it coming to main system_init is getting sucess and other thing working properly but when i add this snippet its jumping to random.

 

while (1)

{

 

}

}

} /* end main */

 

__WEAK __NO_RETURN void Reset_Handler(void)

{

__set_PSP((uint32_t)(&__INITIAL_SP));

 

__set_MSPLIM((uint32_t)(&__STACK_LIMIT));

__set_PSPLIM((uint32_t)(&__STACK_LIMIT));

 

SystemInit(); /* CMSIS System Initialization */ this is where i kept breakpoint at reset hanlder there when it calls the system init it is jumping to random when i add that snippet ok when remove than fine evrything is ok 

__PROGRAM_START(); /* Enter PreMain (C library entry point) */

}

 

tell me what may be the issue here is ther any freertos configuraiton muismatch is there or what also i attatched the freertosconfig.h also check once

Andrew Neil
Super User
Nov 12, 2026 9:45 AM UTC

Please see:

 

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Haithem Rahmani
ST Employee
Nov 12, 2026 9:31 AM UTC

Hi ​@harishDST 

Ineed,  there are some issues with the FreeRTOSConfig.h
in particular the following flags.
 

#define configENABLE_TRUSTZONE                        0U
#define configRUN_FREERTOS_SECURE_ONLY 1U
#define configENABLE_MVE 0U

the STM32C5 doesn’t have any security feature, thus the configRUN_FREERTOS_SECURE_ONLY   should be set to 0

check the FreeRTOSConfig.h below for reference.
https://github.com/STMicroelectronics/STM32CubeC5/blob/cadccf77d4e5033a5d823bbc4ac1503466e4563a/examples/middleware/freertos/mutex/NUCLEO-C562RE/generated/middleware/freertos/FreeRTOSConfig.h#L132

regards
haithem.
 

harishDSTAuthor
Associate II
Nov 16, 2026 12:22 PM UTC

ok its worked now after changing the heap memory allcoated to freertos reduced from the 16384 to 8192 but still i dont know i f want to givemore heap size to this i think main heap i have to increase but in mx2 i am not getting where to increase that 

Andrew Neil
Super User
Nov 16, 2026 12:44 PM UTC

ok its worked now after changing the heap memory allcoated to freertos  

Great, so I think that resolves this issue?

If so, please mark the solution on the post which provided the answer - not this one!

 

 i am not getting where to increase that 

That’s a new question - please start a new thread for that.

Please post a link here to the new thread - so people can find it.

In the new thread, you could post a link back to this one for reference.

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.