Skip to main content
Associate
January 8, 2025
Solved

Stm32f103CbTbA Bluepill board "() at 0xfffffff9"

  • January 8, 2025
  • 3 replies
  • 1228 views

Moved from 'Feedback' forum - which is reserved for posts about the forum itself.


I am simply trying to blink onboard LED on PC13. When I run without any breakpoints the stack looks as follows:

ronaksm_0-1736330027868.png

I have 2 bluepill boards and the result is similar on both of them.

Best answer by ronaksm

Found the problem: The Boot0 pin had to be kept at 0 even for debugging and then it worked. I don't know whether such setting is as expected.

3 replies

Andrew Neil
Super User
January 8, 2025

Note that the Blue Pill (and other colours) is not an ST product, and almost certainly does not contain a genuine STM32.

Need some more details on what, exactly, your doing, what tools you're using, etc:

https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

 

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.
ronaksmAuthor
Associate
January 8, 2025

I am using Stm32CubeIDE. Below is the simple code that I am trying to run.

int main(void)
{

 /* USER CODE BEGIN 1 */

 /* USER CODE END 1 */

 /* MCU Configuration--------------------------------------------------------*/

 /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
 HAL_Init();

 /* USER CODE BEGIN Init */

 /* USER CODE END Init */

 /* Configure the system clock */
 SystemClock_Config();

 /* USER CODE BEGIN SysInit */

 /* USER CODE END SysInit */

 /* Initialize all configured peripherals */
 MX_GPIO_Init();
 /* USER CODE BEGIN 2 */
 uint32_t l_i_ui32 = 0;
 /* USER CODE END 2 */

 /* Infinite loop */
 /* USER CODE BEGIN WHILE */
 while (1)
 {
	 l_i_ui32++;
	 HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_13);
	 HAL_Delay(100);
 /* USER CODE END WHILE */

 /* USER CODE BEGIN 3 */
 }
 /* USER CODE END 3 */
}

 

Andrew Neil
Super User
January 8, 2025

what happens if you single-step through that code?

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.
gbm
Principal
January 8, 2025

Just wild guess, maybe incorrect: your BluePill may contain F103C6 chip and your project was created for F103C8. Check what happens if you set the RAM size in the linker script (.LD file in main project folder) to 10K instead of 20K.

 

Another idea: try to set the breakpoint in SysTick_Handler and check if it is called.

My STM32 stuff on github - compact USB device stack and more: https://github.com/gbm-ii/gbmUSBdevice
ronaksmAuthor
Associate
January 8, 2025

It is indeed a F103C6 and I had created a completely new project with F103C6. However, the stack is still the same. Additionally, I have placed the breakpoint in SysTick_Handler and the PC never jumps to that address. Is there any other setting in CubeMx that has to be done for SysTick apart from Timebase source : SysTick? Nvic_Systick is by default enabled and cannot be disabled which seems correct and we should get IRQ.

ronaksmAuthorBest answer
Associate
January 8, 2025

Found the problem: The Boot0 pin had to be kept at 0 even for debugging and then it worked. I don't know whether such setting is as expected.

Andrew Neil
Super User
January 8, 2025

@ronaksm wrote:

Found the problem


Great - so please mark that as the solution:

https://community.st.com/t5/community-guidelines/help-others-to-solve-their-issues/ta-p/575256

 


@ronaksm wrote:

 I don't know whether such setting is as expected.


You'd have to seek out the actual manufacturer of the chip (unlikely to be genuine ST), and ask them.

This might help you with identifying the chip:

https://mecrisp-stellaris-folkdoc.sourceforge.io/bluepill-diagnostics-v1.6.html#diags-1-6

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.