Skip to main content
Visitor II
January 22, 2025
Question

Error in Generated Code from MEMS

  • January 22, 2025
  • 2 replies
  • 504 views

Hello,

I'm pretty new to this, but bear with me... 

Generating configuration code for NUCLEO-H732FX which includes MEMS.  In app_mems.c the generated code appears to attempt initializing the virtual COM out with an incorrectly formed call:

 /* Initialize Virtual COM Port */
 BSP_COM_Init(COM1);

returning:

Description Resource Path Location Type
too few arguments to function 'BSP_COM_Init' app_mems.c /first_test/MEMS/App line 168 C/C++ Problem

the declaration in stm32h7xx_nucleo.c seems to confirm the incorrect call:

#if (USE_BSP_COM_FEATURE > 0)
/**
 * @brief Configures COM port.
 * @PAram COM COM port to be configured.
 * This parameter can be COM1
 * @PAram COM_Init Pointer to a UART_HandleTypeDef structure that contains the
 * configuration information for the specified USART peripheral.
 * @retval BSP error code
 */
int32_t BSP_COM_Init(COM_TypeDef COM, COM_InitTypeDef *COM_Init)

 I suppose I could try editing the generated code, but any other workarounds that don't require editing would be greatly appreciated!

 

 

2 replies

Ghofrane GSOURI
Technical Moderator
January 23, 2025

Hello @TheMentat 

First let me thank you for posting.

Are you sure about the board part number  "NUCLEO-H732FX"  ?

I would appreciate it if you could provide your IOC 

GhofraneGSOURI_0-1737621477653.png

I will be waiting for your feedback.

THX

Ghofrane

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
Andrew Neil
Super User
January 28, 2025

@TheMentat wrote:

In app_mems.c the generated code appears to attempt initializing the virtual COM out with an incorrectly formed call:


How is COM1 defined?

It could be a macro, so it could define both parameters?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.