Tim,
I've read the example and documentation but I couldn't make it work yet.
I tried to modify the example 'DeviceIntegration' to flash a LED connected in a GPIO (PC7 as table 4 from User Manual).
- Apparently, the problem is that I'm not declaring this GPIO, I tried in many ways to declare it in 'ew_bsp_inout.c' but couldn't make it. I've called it LED_0 (custom name from cubemx), PC7 (STM32 Pin name from user manual), D0 (Pin name from user manual) and nothing.
- I added 'static void MX_GPIO_Init(void);' at the beginning of 'ew_bsp_inout.c' and changed the function 'EwBspConfigButton' to:
void EwBspConfigButton ( TButtonCallback aButtonCallback )
{
GPIO_InitTypeDef GPIO_InitStructure;
/* Enable GPIOI clock */
KEY_BUTTON_GPIO_CLK_ENABLE();
/* Configure PC7 pin as input floating */
GPIO_InitStructure.Mode = GPIO_MODE_OUTPUT_PP;
GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_LOW;
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
/* Enable and set EXTI Line Interrupt to the lowest priority */
HAL_NVIC_SetPriority( KEY_BUTTON_EXTI_IRQn, 8, 0 );
HAL_NVIC_EnableIRQ( KEY_BUTTON_EXTI_IRQn );
ButtonCallback = aButtonCallback;
}
which I got from the cubemx genereted code.
- On 'EwBspConfigLed' I wrote:
void EwBspConfigLed( void )
{
BSP_LED_Init( PC7 );
}
void EwBspLedOn( void )
{
HAL_GPIO_WritePin( PC7_GPIO_Port, PC7_Pin, GPIO_PIN_SET);
}
void EwBspLedOff( void )
{
HAL_GPIO_WritePin( PC7_GPIO_Port, PC7_Pin, GPIO_PIN_RESET);
}
- I'm getting the following error:
Compiling ../../../TargetSpecific/ew_bsp_inout.c
../../../TargetSpecific/ew_bsp_inout.c: In function 'EwBspConfigLed':
../../../TargetSpecific/ew_bsp_inout.c:144:1: error: too few arguments to function 'BSP_LED_Init'
BSP_LED_Init( PC7 );
^~~~~~~~~~~~
In file included from ../../../TargetSpecific/ew_bsp_inout.c:30:0:
../../../ThirdParty/STM32Cube_FW_F7/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery.h:306:11: note: declared here
void BSP_LED_Init(Led_TypeDef Led);
^~~~~~~~~~~~
../../../TargetSpecific/ew_bsp_inout.c: In function 'EwBspLedOn':
../../../TargetSpecific/ew_bsp_inout.c:164:22: error: 'PC7_GPIO_Port' undeclared (first use in this function); did you mean 'MX_GPIO_Init'?
HAL_GPIO_WritePin( PC7_GPIO_Port, PC7_Pin, GPIO_PIN_SET);
^~~~~~~~~~~~~
MX_GPIO_Init
../../../TargetSpecific/ew_bsp_inout.c:164:22: note: each undeclared identifier is reported only once for each function it appears in
../../../TargetSpecific/ew_bsp_inout.c:164:37: error: 'PC7_Pin' undeclared (first use in this function)
HAL_GPIO_WritePin( PC7_GPIO_Port, PC7_Pin, GPIO_PIN_SET);
^~~~~~~
../../../TargetSpecific/ew_bsp_inout.c: In function 'EwBspLedOff':
../../../TargetSpecific/ew_bsp_inout.c:184:22: error: 'PC7_GPIO_Port' undeclared (first use in this function); did you mean 'MX_GPIO_Init'?
HAL_GPIO_WritePin( PC7_GPIO_Port, PC7_Pin, GPIO_PIN_RESET);
^~~~~~~~~~~~~
MX_GPIO_Init
../../../TargetSpecific/ew_bsp_inout.c:184:37: error: 'PC7_Pin' undeclared (first use in this function)
HAL_GPIO_WritePin( PC7_GPIO_Port, PC7_Pin, GPIO_PIN_RESET);
^~~~~~~
../../../TargetSpecific/ew_bsp_inout.c: At top level:
../../../TargetSpecific/ew_bsp_inout.c:38:13: warning: 'MX_GPIO_Init' declared 'static' but never defined [-Wunused-function]
static void MX_GPIO_Init(void);
^~~~~~~~~~~~
make: *** [Obj/ew_bsp_inout.o] Error 1
- I'm probably doing some huge nonsense, if you can help me I'll be glad.
Thanks in advance,
Lucas