SVC call causing hard fault

sgilbert wrote on Wednesday, January 10, 2018:

It’s possible but I don’t think so.

the peripherals are configured before the kernel is started with the standard cubeMX generated calls but the interrupts I didn’t think were started until later in the user code. There’s no user code between the set up routines and the call to the RTOS kernel.

/* 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();
 MX_DMA_Init();
 MX_ADC1_Init();
 MX_CRC_Init();
 MX_DAC_Init();
 MX_I2C1_Init();
 MX_I2C2_Init();
 MX_SPI1_Init();
 MX_SPI4_Init();
 MX_UART4_Init();
 MX_USART1_UART_Init();
 MX_TIM7_Init();

 /* USER CODE BEGIN 2 */

//  while(1)
//  {
//	  HAL_GPIO_WritePin(GPIOE, GPIO_PIN_9, GPIO_PIN_SET);
//	  HAL_GPIO_WritePin(LED_Battery_out_GPIO_Port, LED_Battery_out_Pin, GPIO_PIN_RESET);
//	  HAL_Delay(1000);
//	  HAL_GPIO_WritePin(GPIOE, GPIO_PIN_9, GPIO_PIN_RESET);
//	  HAL_GPIO_WritePin(LED_Battery_out_GPIO_Port, LED_Battery_out_Pin, GPIO_PIN_SET);
//	  HAL_Delay(1000);
//  }

 /* USER CODE END 2 */

 /* Call init function for freertos objects (in freertos.c) */
 MX_FREERTOS_Init();

 /* Start scheduler */
 osKernelStart();