This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

fail to compile GPIO example

Hi all, I have a STM32F446RE. To learn how the GPIO works with standard periph library, I download the eample GPIO_IOToggle, but that code doesn't compile, so many errors. From the readme.txt, it seems that the code didn't test on F446x, that may need some modification of the code before we can run it. It took me couple hours to try but still no good.

So I copy a code, which is running good for my STM32F10 series, to a new folder. I replaced the old CMSIS and stdperiph driver with the new one for my STM32F4xx (STM32F4xx_StdPeriph_Driver). In 32F10 code about GPIO configuration, I have

-----------------------------------------------------------------
GPIO_InitTypeDef GPIO_InitStructure;

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD, ENABLE);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3|GPIO_Pin_4|GPIO_Pin_5|GPIO_Pin_6|GPIO_Pin_7|GPIO_Pin_8|GPIO_Pin_9;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
-----------------------------------------------------------------

But it doesn't compile. It said no RCC_APB2Periph_GPIOA, RCC_APB2Periph_GPIOB, RCC_APB2Periph_GPIOC, RCC_APB2Periph_GPIOD, GPIO_Mode_Out_PP and GPIO_Mode_IPU defined. I am not sure why is it. But if I replace APB2 with APB1, GPIO_Mode_Out_PP with GPIO_Mode_OUT, GPIO_Mode_IPU with GPIO_Mode_IN, this issue solved. But is it correct to do so?

After this issue gone, I got another series of compilation errors

identifier "FSMC_Bank1" is undefined
identifier "FSMC_Bank1E" is undefined
identifier "FSMC_BCR1_MBKEN" is undefined
identifier "FSMC_BCR1_MUXEN" is undefined
identifier "FSMC_BCR1_MTYP" is undefined
identifier "FSMC_BCR1_MWID" is undefined
identifier "FSMC_BCR1_FACCEN" is undefined
identifier "FSMC_BCR1_BURSTEN" is undefined
identifier "FSMC_BCR1_WAITPOL" is undefined
identifier "FSMC_BCR1_WRAPMOD" is undefined
identifier "FSMC_BCR1_WAITCFG" is undefined
identifier "FSMC_BCR1_WREN" is undefined
identifier "FSMC_BCR1_WAITEN" is undefined
identifier "FSMC_BCR1_EXTMOD" is undefined
identifier "FSMC_BCR1_ASYNCWAIT" is undefined
identifier "FSMC_BCR1_CBURSTRW" is undefined
identifier "FSMC_BTR1_ADDSET" is undefined
identifier "FSMC_BTR1_ADDHLD" is undefined
identifier "FSMC_BTR1_DATAST" is undefined
identifier "FSMC_BTR1_BUSTURN" is undefined
identifier "FSMC_BTR1_CLKDIV" is undefined
identifier "FSMC_BTR1_DATLAT" is undefined
identifier "FSMC_BTR1_ACCMOD" is undefined
identifier "FSMC_Bank1E" is undefined
identifier "FSMC_BWTR1_ADDSET" is undefined
identifier "FSMC_BWTR1_ADDHLD" is undefined
identifier "FSMC_BWTR1_DATAST" is undefined

and they all happens in the file STM32F4xx_StdPeriph_Driver\src\stm32f4xx_fsmc.c

Can someone help to identify this error and help me to fix it? Thanks.