Browse Source

更新MCU工程(iram版本和sram-nos版本)
优化MCU app阶段初始化emmc流程(若失败则拉低拉高复位脚,重试3次)。

helen 3 tháng trước cách đây
mục cha
commit
46c063aaec

+ 14 - 2
amt630hv160-mcu/amt630hv160-mcu-iram/src/main.c

@@ -491,8 +491,20 @@ static void MainTask(void *pvParameters)
 #endif
 #endif
 
-#if CPU_DEVICE_TYPE_SELECT == EMMC_FLASH
-	if (EMMC_Init()) {
+#if DEVICE_TYPE_SELECT == EMMC_FLASH || CPU_DEVICE_TYPE_SELECT == EMMC_FLASH
+	int retries = 3;
+
+retry:
+	if (EMMC_Init() && retries--) {
+		printf("EMMC Reinit\n");
+		/* 此处修改为自身平台EMMC的复位脚操作,复位拉低时间参考颗粒规格书要求 */
+		GPIO_DirectionOutput(131, 0);
+		TIMER_Mdelay(10);
+		GPIO_DirectionOutput(131, 1);
+		TIMER_Mdelay(10);
+		goto retry;
+	}
+	if (retries < 0) {
 		printf("EMMC_Init fail!\n");
 		vTaskDelete(NULL);
 		return;

+ 14 - 2
amt630hv160-mcu/amt630hv160-mcu-sram-nos/src/main.c

@@ -251,8 +251,20 @@ int main(void)
 #endif
 #endif
 
-#if CPU_DEVICE_TYPE_SELECT == EMMC_FLASH
-	if (EMMC_Init()) {
+#if DEVICE_TYPE_SELECT == EMMC_FLASH || CPU_DEVICE_TYPE_SELECT == EMMC_FLASH
+	int retries = 3;
+
+retry:
+	if (EMMC_Init() && retries--) {
+		printf("EMMC Reinit\n");
+		/* 此处修改为自身平台EMMC的复位脚操作,复位拉低时间参考颗粒规格书要求 */
+		GPIO_DirectionOutput(131, 0);
+		TIMER_Mdelay(10);
+		GPIO_DirectionOutput(131, 1);
+		TIMER_Mdelay(10);
+		goto retry;
+	}
+	if (retries < 0) {
 		printf("EMMC_Init fail!\n");
 		while(1);
 	}