STM32H743 以太网驱动 问题

发布于 2020-09-14 20:15:52

微信截图_20200914201308.png
STM32H系列外设驱动已经支持了,什么时候更新呢?现在的版本调用以太网还是报错呢
image.png

查看更多

关注者
0
被浏览
1.1k
7 个回答
HappyTime
HappyTime 2020-09-15

H7的以太网还不支持,我可以发给你一份。

我心永恒~
我心永恒~ 2020-09-15

昨天公众号发布文章提到了支持了,但是目前RT-Thread Studio里的包貌似还没有更新呢

Ghazi
Ghazi 2020-09-15

要吗 我也可以发一份给你 嘿嘿

wujialing4000
wujialing4000 2020-09-17

你好,H7的以太网我没有移植成功,可以发一份参考一下吗?十分感谢。邮箱是wujialing3000@163.com

fovery
fovery 2020-09-22

我用了上面的驱动,出现如下问题:
开启drv_eth.c中的DRV_DEBUG,才可以在插拔网线时自动获得到IP,但是ping不通网关。

不知道有没有人遇到过?
捕获.PNG

Mestic英
Mestic英 2020-11-23

多谢大佬的驱动,白嫖党感激不尽,嫖完后,还增加修改了两个地方:
1、board.c增加MPU的配置

void MPU_Config(void)
{
  MPU_Region_InitTypeDef MPU_InitStruct;

  /* Disable the MPU */
  HAL_MPU_Disable();

  /* Configure the MPU attributes as Device not cacheable
     for ETH DMA descriptors */
  MPU_InitStruct.Enable = MPU_REGION_ENABLE;
  MPU_InitStruct.BaseAddress = 0x30040000;
  MPU_InitStruct.Size = MPU_REGION_SIZE_256B;
  MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
  MPU_InitStruct.IsBufferable = MPU_ACCESS_BUFFERABLE;
  MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
  MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
  MPU_InitStruct.Number = MPU_REGION_NUMBER0;
  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
  MPU_InitStruct.SubRegionDisable = 0x00;
  MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

  /* Configure the MPU attributes as Normal Non Cacheable
     for LwIP RAM heap which contains the Tx buffers */
  MPU_InitStruct.Enable = MPU_REGION_ENABLE;
  MPU_InitStruct.BaseAddress = 0x30044000;
  MPU_InitStruct.Size = MPU_REGION_SIZE_16KB;
  MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
  MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
  MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
  MPU_InitStruct.IsShareable = MPU_ACCESS_SHAREABLE;
  MPU_InitStruct.Number = MPU_REGION_NUMBER1;
  MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1;
  MPU_InitStruct.SubRegionDisable = 0x00;
  MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;

  HAL_MPU_ConfigRegion(&MPU_InitStruct);

  /* Enable the MPU */
  HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
}

2、修改drv_common.c

void hw_board_init(char *clock_src, int32_t clock_src_freq, int32_t clock_target_freq)
{
    extern void rt_hw_systick_init(void);
    extern void clk_init(char *clk_source, int source_freq, int target_freq);

#ifdef SCB_EnableICache
    /* Enable I-Cache---------------------------------------------------------*/
    SCB_EnableICache();
#endif

#ifdef SCB_EnableDCache
    /* Enable D-Cache---------------------------------------------------------*/
    SCB_EnableDCache();
#endif
    extern void MPU_Config(void);
    extern void CPU_CACHE_Enable(void);
    SCB->VTOR = QSPI_BASE;
    MPU_Config();    // 增加MPU配置函数
    CPU_CACHE_Enable();
    /* HAL_Init() function is called at the beginning of the program */
    HAL_Init();

3、修改link.lds编译连接脚本(让DMARxDscrTab、DMATxDscrTab、Rx_Buff连接到指定内存地址上)

MEMORY
{
ROM (rx) : ORIGIN =0x90000000,LENGTH =512k
RAM (rw) : ORIGIN =0x24000000,LENGTH =512k
RAM_D2_SRAM3 (xrw) : ORIGIN = 0x30040000, LENGTH = 32K    /* 增加MEMORY */
}
    .bss :
    {
        . = ALIGN(4);
        /* This is used by the startup in order to initialize the .bss secion */
        _sbss = .;

        *(.bss)
        *(.bss.*)
        *(COMMON)

        . = ALIGN(4);
        /* This is used by the startup in order to initialize the .bss secion */
        _ebss = . ;
        
        *(.bss.init)
    } > RAM
    __bss_end = .;
    _end = .;
    /* 增加连接脚本 */
    .lwip_sec (NOLOAD) : 
    {
        . = ALIGN(4);
        *(.RxDecripSection) 
        *(.TxDecripSection)
        *(.RxArraySection) 
        . = ALIGN(4);
    } > RAM_D2_SRAM3

    /* Stabs debugging sections.  */
    .stab          0 : { *(.stab) }
    .stabstr       0 : { *(.stabstr) }

附上参考工程
https://github.com/MysticChan/rtt_stm32h7_eth.git

role_2099
role_2099 2021-02-18

大侠们,请教一下,最新的4.0.3对H7以太网支持的怎么样?

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览