I'm struggling to get the CAN working on a project I'm working on with the STM32F446ZET6. With the project below (CastletRestart) i just get a flat line of 3.3V high on the TX line for CAN1, this is being tested in loop back mode, with the TUT_CAN_F446 project the can works (downloaded from a tutorial) in loopback mode, as far as i can see ive replicated everything across but it still isnt working.
Its likely to be something silly and i do apologise for this being the case but i cannot see what ive missed having reviewed the code countless times.
P.s. i am aware the Tutorial project is targeted at a different micro, but the CAN1 ports are the same.
/* 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_CAN1_Init(); //MX_CAN2_Init(); MX_ADC1_Init(); /* USER CODE BEGIN 2 */ HAL_ADC_Start_IT(&hadc1); HAL_CAN_Start(&hcan1); /* USER CODE END 2 */
/* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */
/* 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_CAN1_Init(); //MX_CAN2_Init(); MX_ADC1_Init(); /* USER CODE BEGIN 2 */ HAL_ADC_Start_IT(&hadc1); HAL_CAN_Start(&hcan1); /* USER CODE END 2 */
/* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */