1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
说明: 开发板:硬石YS-H7Pro, 芯片stm32h743iit6 \ | / RT - Thread Operating System |
|
相关推荐
4个回答
|
|
RTT Studio 使用的编译器是 GCC 所以在drv_eth.c 中使用到
#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 这里的以太网描述符指定了固定的地址,所以需要修改联检文件,这个可以参考 ART-Pi 另外一下几点也请注意: 内存堆的选择 MPU 的配置 如果还有疑问请追问,如果帮助到你请采纳。 |
|
|
|
按你说的都去设置了,还是不行。 /* * Copyright (c) 2006-2018, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2019-04-14 whj4674672 first version */ #include #include "stm32h7xx.h" #include "board.h" int mpu_init(void) { MPU_Region_InitTypeDef MPU_InitStruct; /* Disable the MPU */ HAL_MPU_Disable(); /* Configure the MPU attributes as WT for AXI SRAM */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.BaseAddress = 0x20000000; MPU_InitStruct.Size = MPU_REGION_SIZE_128KB; MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE; MPU_InitStruct.IsCacheable = MPU_ACCESS_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); #ifdef BSP_USING_SDRAM /* Configure the MPU attributes as WT for SDRAM */ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.BaseAddress = 0xC0000000; MPU_InitStruct.Size = MPU_REGION_SIZE_32MB; MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE; MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE; MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE; MPU_InitStruct.Number = MPU_REGION_NUMBER1; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0; MPU_InitStruct.SubRegionDisable = 0x00; MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE; HAL_MPU_ConfigRegion(&MPU_InitStruct); #endif #ifdef BSP_USING_ETH /* Configure the MPU attributes as Device not cacheable for ETH DMA descriptors and RX Buffers*/ MPU_InitStruct.Enable = MPU_REGION_ENABLE; MPU_InitStruct.BaseAddress = 0x30040000; MPU_InitStruct.Size = MPU_REGION_SIZE_32KB; 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_NUMBER2; MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL1; MPU_InitStruct.SubRegionDisable = 0x00; MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE; HAL_MPU_ConfigRegion(&MPU_InitStruct); #endif // /* Configure the MPU attributes as WT for QSPI */ // MPU_InitStruct.Enable = MPU_REGION_ENABLE; // MPU_InitStruct.BaseAddress = 0x90000000; // MPU_InitStruct.Size = MPU_REGION_SIZE_8MB; // MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS; // MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE; // MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE; // MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE; // MPU_InitStruct.Number = MPU_REGION_NUMBER3; // MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0; // 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); /* Enable CACHE */ SCB_EnableICache(); SCB_EnableDCache(); return RT_EOK; } INIT_BOARD_EXPORT(mpu_init) |
|
|
|
我说的几点注意,你并没有检查:
内存堆的选择。请选择 axi sram. MPU 的配置. 抄ART-Pi 另外关于 STM32H7 上使用 LWIP 可以参考我的 blog 了解一下 必备的知识。 |
|
|
|
谢谢,已解决。
修改ram地址段(之前也使用过0x24000000,不过报cpu错误,怀疑是地址问题才改回0x20000000,现在发现是cache被我重复使能造成),不报dma发送错误了,不过还是ping不通; 拷贝的原来keil工程的eth_msp初始化里面缺少中断使能,加上就可以ping通了; |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
529 浏览 0 评论
AI模型部署边缘设备的奇妙之旅:如何在边缘端部署OpenCV
2000 浏览 0 评论
tms320280021 adc采样波形,为什么adc采样频率上来波形就不好了?
1174 浏览 0 评论
1674 浏览 0 评论
1439 浏览 0 评论
74758 浏览 21 评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 02:54 , Processed in 0.533553 second(s), Total 47, Slave 39 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号