I'm trying to program the STM32F446 using the CubeMX code generator and the uVision 5 IDE on Windows 10 in order to use the CAN bus.
I've configured my CubeMX project for the STM32-F446RE Nucleo board. I have PA12 configured as CAN1TX and PA11 configured as CAN1RX. The rest of the pins are on default for the STM32-F446RE Nucleo board. I've generated the code for the uVision 5 IDE.
To get started, I'm trying to follow the instructions on how to use the HAL and driver by following the instructions in the comments of stm32f4xx_hal_can.c as well as the instructions on page 120 of the HAL documentation DocID025834 Rev 5. This page gives the following instructions:
- Enable the CAN controller interface clock using __HAL_RCC_CAN1_CLK_ENABLE() for CAN1, __HAL_RCC_CAN2_CLK_ENABLE() for CAN2 and __HAL_RCC_CAN3_CLK_ENABLE() for CAN3 In case you are using CAN2 only, you have to enable the CAN1 clock.
- CAN pins configuration **Enable the clock for the CAN GPIOs using the following function: __GPIOx_CLK_ENABLE() ** .... The first substep of step 2 is the problem. I cannot find the function __GPIOx_CLK_ENABLE(). I've noticed in some other forum that there may be an alternate name for the function, __HAL_RCC_GPIOx_CLK_ENABLE(); but it is not recognized by the IDE either. Am I missing an include file? Is the "x" supposed to be replaced by some number like the pin number of the pin I want to use? If so, what format should the pin be expressed?
To my further confusion, I've looked at various youtube videos and none of them seem to mention the steps above mentioned in the HAL manual.
I have installed on my IDE the following, amongst others: Generic: ARM::CMISS-Driver version 2.3.0 and 2.2.0, ARM::CMISS version 5.4.0 and version 5.3.0. Device Specific info: Keil::STM32F4xx_DFP version 2.13.0. Keil::STM32NuceloBSP version 1.6.0.
I've been looking around for information but without success, and would very much appreciate your help.