9 years, 11 months ago.

SPI5_BASE is undefined in PeripheralNames.h

I've exported the blink project from the online MBED compiler and imported it into Keil. When I try to build it, I get the following error:

mbed/TARGET_NUCLEO_F411RE/TARGET_STM/TARGET_NUCLEO_F411RE/PeripheralNames.h(58):
error:  #20: identifier "SPI5_BASE" is undefined

PeripheralNames.h contains the following code

typedef enum {
    SPI_1 = (int)SPI1_BASE,
    SPI_2 = (int)SPI2_BASE,
    SPI_3 = (int)SPI3_BASE,
    SPI_4 = (int)SPI4_BASE,
    SPI_5 = (int)SPI5_BASE
} SPIName;

If I remove the SPI_5 part of it, it compiles without problems.

typedef enum {
    SPI_1 = (int)SPI1_BASE,
    SPI_2 = (int)SPI2_BASE,
    SPI_3 = (int)SPI3_BASE,
    SPI_4 = (int)SPI4_BASE
} SPIName;

Am I doing something wrong with the exporting and importing into Keil?

I get this error, too. menu 'Project' -> 'Option for Target ...', 'Device' : STM32F401RCTx , Not 'F411RE' 411RE has 'SPI5' but 401RC not ?

posted by zhong pl 20 Jun 2015

1 Answer

9 years, 11 months ago.

I would check paths in the project, if they are set properly. Can you share the link to the example you exported? We can look at it.

Accepted Answer

Dear Martin, I don't know what the path should be like. The link to the repository is: http://developer.mbed.org/users/WilcoBonestroo/code/Nucleo_blink_led/

posted by Wilco Bonestroo 12 Jan 2015

Imported to the online compiler, exported to uvision - no error.

posted by Martin Kojtal 12 Jan 2015

I checked again, and it also works on my machine (uvision 5).

posted by Wilco Bonestroo 15 Jun 2015