Move before starting scheduler to avoid race condition
- If a CAN message arrives during boot time ISR will fire and try to put data into xCAN1RxQueue. At that time queue is NULL: calling RTOS APIs on NULL handles will cause a HardFault
This commit is contained in:
+1
-1
@@ -110,7 +110,6 @@ int main(void)
|
|||||||
MX_SDIO_SD_Init();
|
MX_SDIO_SD_Init();
|
||||||
|
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
CAN_Logger_Init(&hcan1, &hcan2);
|
|
||||||
/* USER CODE END 2 */
|
/* USER CODE END 2 */
|
||||||
|
|
||||||
/* Init scheduler */
|
/* Init scheduler */
|
||||||
@@ -185,6 +184,7 @@ int main(void)
|
|||||||
/* USER CODE END RTOS_EVENTS */
|
/* USER CODE END RTOS_EVENTS */
|
||||||
|
|
||||||
/* USER CODE BEGIN 3 */
|
/* USER CODE BEGIN 3 */
|
||||||
|
CAN_Logger_Init(&hcan1, &hcan2);
|
||||||
/* USER CODE END 3 */
|
/* USER CODE END 3 */
|
||||||
|
|
||||||
/* Start scheduler */
|
/* Start scheduler */
|
||||||
|
|||||||
Reference in New Issue
Block a user