cancel
Showing results for 
Search instead for 
Did you mean: 

Using the Freertos CORTEX_M4F_STM32F407ZG-SK with stm32f401cc (black pill v2).

Manny
Associate III

Hello,

I wanted to use the CORTEX_M4F_STM32F407ZG-SK demo of free rtos with stm32f401cc. In the past I have used this demo with stm32f405rg, I have changed the PLL setting for 84Mhz as:

// in stm32f4xx.h

#define HSE_VALUE  ((uint32_t)25000000)

// in system_stm32fxx.c

/* PLL_VCO = (HSE_VALUE or HSI_VALUE / PLL_M) * PLL_N */

#define PLL_M   25

#define PLL_N   336

/* SYSCLK = PLL_VCO / PLL_P */

#define PLL_P   4

/* USB OTG FS, SDIO and RNG Clock = PLL_VCO / PLLQ */

#define PLL_Q   7

I am using IAR(and changed the mcu to stm32f401cc), but when I run the code, it jumps directly to the HardFault_Handler without going through main. I am using FreeRTOSv202104.00 version.

1 REPLY 1

Check SystemInit() code.

Make sure it enables FPU.

Look at what instructions fault, the CPU has registers.

Use the debugger to step in from Reset_Handler, it unchecked "run to main()" type options.

Check initial stack pointer is within RAM of MCU​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..