AT32f413cbt6 SDIO

[复制链接]
 楼主| 杨旭666 发表于 2022-5-24 15:50 | 显示全部楼层 |阅读模式
你好,关于AT32F413cbt6,我在应用SDIO时遇到一些问题,在官方的例程“sd_mmc_card”的基础上,修改sdio 的引脚为GPIOA 的GPIO_PINS_2 | GPIO_PINS_3 | GPIO_PINS_4 | GPIO_PINS_5 | GPIO_PINS_6 | GPIO_PINS_7:以下为修改的代码段:
  /* gpioc and gpiod periph clock enable */
  crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);

  gpio_pin_remap_config(SDIO1_GMUX_0111,TRUE);
  /* sdio periph clock enable */
  crm_periph_clock_enable(CRM_SDIO1_PERIPH_CLOCK, TRUE);

  gpio_init_struct.gpio_drive_strength = GPIO_DRIVE_STRENGTH_STRONGER;
  gpio_init_struct.gpio_mode = GPIO_MODE_MUX;
  gpio_init_struct.gpio_out_type = GPIO_OUTPUT_PUSH_PULL;
  gpio_init_struct.gpio_pins = GPIO_PINS_2 | GPIO_PINS_3 | GPIO_PINS_4 | GPIO_PINS_5 | GPIO_PINS_6 | GPIO_PINS_7;
  gpio_init_struct.gpio_pull = GPIO_PULL_NONE;
  gpio_init(GPIOA, &gpio_init_struct);


其他没有改变,然后上电跑起来在sd_power_on()里边发完cmd8后,发cmd55时返回SD_ILLEGAL_CMD,整个初始化过程都用示波器监测cmd引脚,和时钟引脚,没有看到数据输出,请问是我IO口配置有问题吗?
      
      下载视频         


muyichuan2012 发表于 2022-5-26 16:57 | 显示全部楼层
使用gpio_pin_remap_config(SDIO1_GMUX_0111,TRUE);前先要把IOMUX时钟开启
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

10

帖子

0

粉丝
快速回复 在线客服 返回列表 返回顶部