I'm currently writing a C++-based program for the RW612. I have integrated some of the functions in the original board.c into my own Board object, which has a .CPP source file. I have properly declared the functions inside my own header file:
#ifdef __cplusplus
extern "C" {
#endif
/* Configures static voltage compensation and sensors, and in XIP case, change
* FlexSPI clock to a stable source before clock tree (such as PLL and Main
* clock) update. */
void BOARD_ClockPreConfig(void);
/* Updates FlexSPI clock source and set flash to full speed. */
void BOARD_ClockPostConfig(void);
/* Configure FlexSPI clock source and divider when using XIP flash. Must run
* in RAM. */
AT_QUICKACCESS_SECTION_CODE(void BOARD_SetFlexspiClock(FLEXSPI_Type *base, uint32_t src, uint32_t divider));
/* De-initializes XIP flash. Must run in RAM. */
AT_QUICKACCESS_SECTION_CODE(void BOARD_DeinitFlash(FLEXSPI_Type *base));
/* Initializes XIP flash. Must run in RAM. */
AT_QUICKACCESS_SECTION_CODE(void BOARD_InitFlash(FLEXSPI_Type *base));
#ifdef __cplusplus
} // extern "C"
#endif
However, when I compile, I get an error that both BOARD_ClockPreConfig() and BOARD_ClockPostConfig() have previously been defined with C++ linkage:
Errors showing conflicting C/C++ linkage
I examined clock_config.h to locate the prototypes for those two functions:
Function prototypes in clock_config.h
The problem is that those two prototypes (and the AVPLL config extern declaration) are not placed inside an extern "C" { } declaration. Several things in clock_config.h do appear within an extern "C" { }, but those items do not, and it throws off the compiler. This is additionally frustrating because clock_config.h is automatically generated by MCU Config Tools, so I have to either disable re-generation of clock_config.h or manually edit in an extern "C" { } declaration each time I re-generate code.
Please fix this defect in MCU Config Tools for the RW612. Thank you.
Dana M.