@@ -24324,11 +24324,11 @@ struct synopsys_enet_qos {
2432424324#define ETH_DESC_CNT 4 // Descriptors count
2432524325#define ETH_DS 4 // Descriptor size (words)
2432624326
24327- #define MG_8BYTE_ALIGNED __attribute__((aligned(8)))
24328- static volatile uint32_t s_rxdesc[ETH_DESC_CNT][ETH_DS] MG_8BYTE_ALIGNED ;
24329- static volatile uint32_t s_txdesc[ETH_DESC_CNT][ETH_DS] MG_8BYTE_ALIGNED ;
24330- static uint8_t s_rxbuf[ETH_DESC_CNT][ETH_PKT_SIZE] MG_8BYTE_ALIGNED ;
24331- static uint8_t s_txbuf[ETH_DESC_CNT][ETH_PKT_SIZE] MG_8BYTE_ALIGNED ;
24327+ #define MG_ETH_ATTR __attribute__((aligned(8), section(".eth_ram" )))
24328+ static volatile uint32_t s_rxdesc[ETH_DESC_CNT][ETH_DS] MG_ETH_ATTR ;
24329+ static volatile uint32_t s_txdesc[ETH_DESC_CNT][ETH_DS] MG_ETH_ATTR ;
24330+ static uint8_t s_rxbuf[ETH_DESC_CNT][ETH_PKT_SIZE] MG_ETH_ATTR ;
24331+ static uint8_t s_txbuf[ETH_DESC_CNT][ETH_PKT_SIZE] MG_ETH_ATTR ;
2433224332static struct mg_tcpip_if *s_ifp; // MIP interface
2433324333
2433424334static uint16_t eth_read_phy(uint8_t addr, uint8_t reg) {
@@ -24355,12 +24355,14 @@ static bool mg_tcpip_driver_stm32h_init(struct mg_tcpip_if *ifp) {
2435524355 uint8_t phy_conf = d == NULL ? MG_PHY_CLOCKS_MAC : d->phy_conf;
2435624356
2435724357 // Init RX descriptors
24358+ memset((char *) s_rxdesc, 0, sizeof(s_rxdesc)); // manual init
2435824359 for (int i = 0; i < ETH_DESC_CNT; i++) {
2435924360 s_rxdesc[i][0] = (uint32_t) (uintptr_t) s_rxbuf[i]; // Point to data buffer
2436024361 s_rxdesc[i][3] = MG_BIT(31) | MG_BIT(30) | MG_BIT(24); // OWN, IOC, BUF1V
2436124362 }
2436224363
2436324364 // Init TX descriptors
24365+ memset((char *) s_txdesc, 0, sizeof(s_txdesc)); // manual init
2436424366 for (int i = 0; i < ETH_DESC_CNT; i++) {
2436524367 s_txdesc[i][0] = (uint32_t) (uintptr_t) s_txbuf[i]; // Buf pointer
2436624368 }
0 commit comments