cancel
Showing results for 
Search instead for 
Did you mean: 

CubeMx generates incorrect Ethernet initialization code for dual-core MCU

Michael98006
Associate III

When I generate a new project in CubeMx 5.3.0 for the STM32H745I-DISCO board for IAR toolchain with default peripheral initialization, I get the following code for the CM7 core:

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

#pragma location=0x30040000

ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */

#pragma location=0x30040060

ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */

#pragma location=0x30040200

uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_MAX_PACKET_SIZE]; /* Ethernet Receive Buffers */

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

__attribute__((at(0x30040000))) ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT]; /* Ethernet Rx DMA Descriptors */

__attribute__((at(0x30040060))) ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT]; /* Ethernet Tx DMA Descriptors */

__attribute__((at(0x30040200))) uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_MAX_PACKET_SIZE]; /* Ethernet Receive Buffer */

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

ETH_DMADescTypeDef DMARxDscrTab[ETH_RX_DESC_CNT] __attribute__((section(".RxDecripSection"))); /* Ethernet Rx DMA Descriptors */

ETH_DMADescTypeDef DMATxDscrTab[ETH_TX_DESC_CNT] __attribute__((section(".TxDecripSection")));  /* Ethernet Tx DMA Descriptors */

uint8_t Rx_Buff[ETH_RX_DESC_CNT][ETH_MAX_PACKET_SIZE] __attribute__((section(".RxArraySection"))); /* Ethernet Receive Buffers */

#endif

ETH_TxPacketConfig TxConfig; 

This code is only applicable to the CM4 core and causes compiler errors when building FW for the CM7 core. CubeMx shouldn't be adding this code for the CM7 core.

Can we get ST to remove it from CubeMx in the next release?

0 REPLIES 0