cancel
Showing results for 
Search instead for 
Did you mean: 

Stm32f103CbTbA Bluepill board "<signal handler called>() at 0xfffffff9"

ronaksm
Visitor

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.

8 REPLIES 8

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

 

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 */
}

 

what happens if you single-step through that code?

When I single step, the LED turns OFF from ON condition. HAL_Delay() -> HAL_GetTick()  are the last set of functions that I am able to single step. I have further debugged and it seems the uwtick variable is not getting updated. It always remains zero. I am using SysTick for Timebase.

gbm
Lead III

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

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.

ronaksm
Visitor

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.


@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