cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX code generation error

Intector
Senior

Hello everyone,

I'm sitting over here working on one of my projects and found that STM32CubeMX generated code with an error. My project uses the STM32H7R3L8H6H MCU with Ethernet activated in the connectivity. I have my project set to "generate individual files" because I like it more that way. However, the file "eth.c" contains an error at the beginning of the file: 

#if defined ( __ICCARM__ ) /*!< IAR Compiler */

#pragma location=0x24020000
ETH_DMADescTypeDef  DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
#pragma location=0x24020080
ETH_DMADescTypeDef  DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */

#elif defined ( __CC_ARM )  /* MDK ARM Compiler */

__attribute__((at(0x24020000))) ETH_DMADescTypeDef  DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */
__attribute__((at(0x24020080))) ETH_DMADescTypeDef  DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */

#elif defined ( __GNUC__ ) || defined ( __ARMCC_VERSION )) /* GNU Compiler */

ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDescripSection"))); /* Ethernet Rx DMA Descriptors */
ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDescripSection")));   /* Ethernet Tx DMA Descriptors */

#endif
ETH_BufferTypeDef Txbuffer[ETH_TX_DESC_CNT * 2U];
ETH_TxPacketConfigTypeDef TxConfig;

The second closing bracket in line 13 shouldn't be there.

Can anyone at STM please take care of that? I know it's easy to correct on my end, but it's super annoying to have to do this every time the code is generated.

Also, why would STM32CubeMX generate all the code for the different compiler cases if I select "STM32CubeIDE" as Toolchain / IDE in my project settings?

Intector_0-1737398906247.png

It makes things much more cluttered, making the code hard to read.

I'm looking forward to an error-free STM32CubeMX.

 

And never forget:

"Always be yourself. Unless you can be a pirate. Then always be a pirate."

 

1 ACCEPTED SOLUTION

Accepted Solutions
STTwo-32
ST Employee

Hello @Intector 

Thank you so much for reporting this typo. I've escalated internally for correction on the coming releases (under internal ticket number 200905)

Best Regards.

STTwo-32

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.

View solution in original post

1 REPLY 1
STTwo-32
ST Employee

Hello @Intector 

Thank you so much for reporting this typo. I've escalated internally for correction on the coming releases (under internal ticket number 200905)

Best Regards.

STTwo-32

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.