瀏覽代碼

[BSP] change em folder; fix mnt issue

BernardXiong 3 年之前
父節點
當前提交
bfc12cd29f

+ 2 - 2
bsp/imx6ull-artpi-smart/applications/init_em.c

@@ -21,12 +21,12 @@
 int em_init(void)
 {
     int count = 5;
-    char *em_cmd = "/bin/em.elf &";
+    char *em_cmd = "/services/em.elf &";
 
     while (count --)
     {
         int fd;
-        fd = open("/bin/em.elf", O_RDONLY);
+        fd = open("/services/em.elf", O_RDONLY);
         if (fd >= 0)
         {
             close(fd);

+ 13 - 13
bsp/imx6ull-artpi-smart/applications/init_sdtask.c

@@ -61,7 +61,7 @@ _remount:
 void filesysytem_try_unmount(char *mount_point)
 {
     struct stat filestat = {0};
-    LOG_I("unmount(\"%s\");",  mount_point);
+    LOG_I("unmount(\"%s\");", mount_point);
     if ((dfs_file_stat(mount_point, &filestat) >= 0) && (S_ISDIR(filestat.st_mode)))
     {
         dfs_unmount(mount_point);
@@ -72,7 +72,7 @@ static void sd_task_entry(void *parameter)
 {
     volatile unsigned int *IN_STATUS;
 
-    IN_STATUS = (volatile unsigned int *)rt_ioremap((void *)0x2190030, 4); //cd status
+    IN_STATUS = (volatile unsigned int *)rt_ioremap((void *)0x2190030, 4); // cd status
 
     int change = 0;
     while (1)
@@ -89,27 +89,28 @@ static void sd_task_entry(void *parameter)
             *IN_STATUS = (0x80);
             change = 2;
         }
-        if(change > 0)
+        if (change > 0)
         {
-            LOG_D("sdio host change: %d",  change);
+            LOG_D("sdio host change: %d", change);
             mmcsd_wait_cd_changed(0); // clear
-            host_change();  // send cd change to host
+            host_change();            // send cd change to host
 
             int result = mmcsd_wait_cd_changed(RT_TICK_PER_SECOND);
             if (result == MMCSD_HOST_PLUGED)
             {
                 LOG_D("mmcsd change pluged");
-                filesysytem_try_mount("sd0","/sd","elm",0);
-            }else
-            if(result == MMCSD_HOST_UNPLUGED)
+                filesysytem_try_mount("sd0", "/mnt/sd0", "elm", 0);
+            }
+            else if (result == MMCSD_HOST_UNPLUGED)
             {
                 LOG_D("mmcsd change unpluged");
-                filesysytem_try_unmount("/sd");
-            }else{
-                LOG_I("mmcsd wait_cd_changed %d",result);
+                filesysytem_try_unmount("/mnt/sd0");
+            }
+            else
+            {
+                LOG_I("mmcsd wait_cd_changed %d", result);
             }
         }
-
     }
 }
 
@@ -130,5 +131,4 @@ int sd_task_init(void)
     return RT_EOK;
 }
 INIT_APP_EXPORT(sd_task_init);
-
 #endif

+ 5 - 5
bsp/imx6ull-artpi-smart/applications/mnt.c

@@ -19,8 +19,8 @@ int mnt_init(void)
 #ifdef RT_USING_SDIO2
     rt_thread_mdelay(500);
 
-    int part_id = 3;
-    if (dfs_mount("emmc","/","elm",0,(void *)part_id) != 0)
+    int part_id = 0;
+    if (dfs_mount("emmc0", "/", "elm", 0, (void *)part_id) != 0)
     {
         rt_kprintf("Dir / emmc mount failed!\n");
         return -1;
@@ -30,10 +30,10 @@ int mnt_init(void)
         rt_kprintf("emmc file system initialization done!\n");
     }
 
-    part_id = 1;
-    if (dfs_mount("sd0","/sd","elm",0,(void *)part_id) != 0)
+    part_id = 0;
+    if (dfs_mount("sd0", "/mnt/sd0", "elm", 0, (void *)part_id) != 0)
     {
-        rt_kprintf("Dir / sd0 mount failed!\n");
+        rt_kprintf("Dir /mnt/sd0 mount failed!\n");
         return -1;
     }
     else

+ 3 - 3
bsp/imx6ull-artpi-smart/drivers/drv_eth.c

@@ -514,7 +514,7 @@ static void phy_detect_thread_entry(void *param)
     }
     else
     {
-        LOG_E("PHY Link down, please check the cable connection and link partner setting.");
+        LOG_W("PHY Link down, please check the cable connection and link partner setting.");
     }
 
     while(1)
@@ -564,14 +564,14 @@ static int imx6ul_eth_init(void)
         state = eth_device_init(&(_imx6ul_eth_device[idx].parent), _imx6ul_eth_device[idx].mac_name);
         if (RT_EOK == state)
         {
-            LOG_E("emac device init success");
+            LOG_I("emac device init success");
         }
         else
         {
             LOG_E("emac device init faild: %d", state);
             state = -RT_ERROR;
         }
-        
+
         rt_sprintf(link_detect,"link_d%d",_imx6ul_eth_device[idx].mac_num);
         /* start phy link detect */
         rt_thread_t phy_link_tid;