MMC - Ethernet conflict H735 Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

hybridA
Posts: 37
Joined: Wed Jan 12, 2022 7:15 am
Has thanked: 10 times
Been thanked: 5 times

MMC - Ethernet conflict H735

Postby hybridA » Fri Dec 22, 2023 10:33 pm

I have Ethernet and uSD card on one of my boards.
There seems to be a conflict between these two. I can either get Ethernet to work or MMC, but not both.
I found some information online that said Ethernet RAM has to start at 0x24000000, and my tests confirm that.

I can't mount the SD card, unless I comment out macInit() in hal.c and lwipInit() in my ethernet initialization code.
I'm using MMCD1 on SPI3.

hybridA
Posts: 37
Joined: Wed Jan 12, 2022 7:15 am
Has thanked: 10 times
Been thanked: 5 times

Re: MMC - Ethernet conflict H735

Postby hybridA » Sat Dec 23, 2023 12:21 am

Well seems like the issue is cache management.
My ram layout:

Code: Select all

    ram0   (wx) : org = 0x24000000, len = 16k       /* AXI SRAM no-cache*/
    ram1   (wx) : org = 0x24004000, len = 304k      /* AXI SRAM cached */
    ram2   (wx) : org = 0x30000000, len = 32k       /* AHB SRAM1 + SRAM2 */
    ram3   (wx) : org = 0x30004000, len = 16k       /* AHB SRAM2 */
    ram4   (wx) : org = 0x38000000, len = 16k       /* AHB SRAM4 */
    ram5   (wx) : org = 0x20000000, len = 128k      /* DTCM-RAM */
    ram6   (wx) : org = 0x00000000, len = 64k       /* ITCM-RAM */
    ram7   (wx) : org = 0x38800000, len = 4k        /* BCKP SRAM */
   
    /* RAM region to be used for data segment.*/
    REGION_ALIAS("DATA_RAM", ram1);
    REGION_ALIAS("DATA_RAM_LMA", flash0);

    /* RAM region to be used for BSS segment.*/
    REGION_ALIAS("BSS_RAM", ram1);

    /* RAM region to be used for the default heap.*/
    REGION_ALIAS("HEAP_RAM", ram1);

    /* RAM region to be used for nocache segment.*/
    REGION_ALIAS("NOCACHE_RAM", ram0);

    /* RAM region to be used for eth segment.*/
    REGION_ALIAS("ETH_RAM", ram0);
   
   


Once I modified STM32_NOCACHE_RASR from 16K to 128K I got both SD card and Ethernet working:

Code: Select all

/*
 * Memory attributes settings.
 */
#define STM32_NOCACHE_ENABLE                TRUE
#define STM32_NOCACHE_MPU_REGION            MPU_REGION_6
#define STM32_NOCACHE_RBAR                  0x24000000U
#define STM32_NOCACHE_RASR                  MPU_RASR_SIZE_128K


While the SD card mounts and I can successfully send ethernet packets, the whole thing crashes after a minute and ends in a _unhandled_exception. So while it's closer it's still not fully working

User avatar
Giovanni
Site Admin
Posts: 14458
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: MMC - Ethernet conflict H735  Topic is solved

Postby Giovanni » Sat Dec 23, 2023 7:32 am

Hi,

Try checking for stack overflows.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 10 guests