You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/12 23:22:42 UTC

[GitHub] [incubator-nuttx] pkarashchenko opened a new pull request, #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

pkarashchenko opened a new pull request, #7584:
URL: https://github.com/apache/incubator-nuttx/pull/7584

   ## Summary
   Add FS automount driver for SD Card.
   
   This is the first step to remove `BOARDIOC_SDCARD_SETNOTIFYCB`
   
   ## Impact
   New feature
   
   ## Testing
   Pass CI
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#discussion_r1064096312


##########
boards/arm/cxd56xx/spresense/src/cxd56_sdcard.c:
##########
@@ -351,14 +349,30 @@ int board_sdcard_initialize(void)
 #endif
 
 #ifdef CONFIG_MMCSD_HAVE_CARDDETECT
+  /* Configure Interrupt pin with internal pull-up */
+
+  cxd56_pin_config(PINCONF_SDIO_CD_GPIO);
+
   /* Initialize Card insert status */
 
-  g_sdhci.inserted = false;
+  g_sdhci.inserted = board_sdcard_inserted(0);
 
-  /* Configure Interrupt pin with internal pull-up */
+  /* Enable SDC if card is inserted */
+
+  if (g_sdhci.inserted)
+    {
+      /* Card Detect = Present, Write Protect = disable */
+
+      putreg32(0, CXD56_TOPREG_IOFIX_APP);
+
+      board_sdcard_enable(NULL);
+    }

Review Comment:
   Maybe it is better just to call `board_sdcard_detect_int` instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] pkarashchenko commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1375575339

   @masayuki2009 instead of adding a new config I can add SD card automount to all existing configs with `CXD56_SDIO=y`. @masayuki2009 what do you think?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [incubator-nuttx] pkarashchenko commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #7584:
URL: https://github.com/apache/incubator-nuttx/pull/7584#issuecomment-1317507335

   @SPRESENSE have you had a chance to try this changes?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] xiaoxiang781216 commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1337079592

   @jerpelea @masayuki2009  could you help verify the change?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] pkarashchenko commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1337063145

   @SPRESENSE maybe you can recommend me the board (send me link to the board), so I can purchase it locally and try changes by myself?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] masayuki2009 commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1340215147

   @pkarashchenko 
   
   I added the following configs to `spresense:rndis`
   
   ```
   CONFIG_CXD56_SDCARD_AUTOMOUNT=y
   CONFIG_FS_AUTOMOUNTER=y
   CONFIG_FS_AUTOMOUNTER_DRIVER=y
   ```
   
   However, the sd card was not mounted.
   
   ```
   NuttShell (NSH) NuttX-3.6.1
   nsh> uname -a
   NuttX  3.6.1 f590b13f0a-dirty Dec  7 2022 09:36:05 arm spresense
   nsh> ps
     PID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK   STACK   USED  FILLED COMMAND
       0     0   0 FIFO     Kthread N-- Ready              00000000 001000 000384  38.4%  Idle Task
       1     1 224 RR       Kthread --- Waiting  Semaphore 00000000 001992 000300  15.0%  hpwork 0x2d053ad0
       2     2 100 RR       Kthread --- Waiting  Semaphore 00000000 001992 000300  15.0%  lpwork 0x2d053ae8
       3     3 100 RR       Task    --- Running            00000000 003024 001444  47.7%  spresense_main
       4     4 200 RR       Task    --- Waiting  MQ empty  00000000 000976 000456  46.7%  cxd56_pm_task
       6     6 100 RR       Task    --- Waiting  Semaphore 00000000 002008 000620  30.8%  telnetd
   nsh> mount
     /mnt/spif type smartfs
     /proc type procfs
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] jerpelea commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
jerpelea commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1337178882

   @xiaoxiang781216 I cant test until next week 
   @masayuki2009 can you please test the code?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] masayuki2009 commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1376601236

   @pkarashchenko 
   
   >@masayuki2009 @jerpelea finally I was able to finalize this PR and test with spresense board. Could you please try spresense:nsh_automount config at your end?
   
   I confirmed that `spresense:nsh_automount` works with my board.
   
   >@masayuki2009 instead of adding a new config I can add SD card automount to all existing configs with CXD56_SDIO=y. What do you think? But now it is either FS automount or a driver callback, but not both. So maybe we need to make changes in few steps.
   
   I think that adding a new config for automount is enough so far.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] pkarashchenko commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1340476600

   @masayuki2009 thank you very much for spending time on this. So I will need to wait some time until I get the board and will debug it "on the desk".


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] pkarashchenko commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1374667736

   @masayuki2009 @jerpelea finally I was able to finalize this PR and test with spresense board. Could you please try `spresense:nsh_automount` config at your end?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] masayuki2009 merged pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
masayuki2009 merged PR #7584:
URL: https://github.com/apache/nuttx/pull/7584


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] jerpelea commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
jerpelea commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1337180112

   > @SPRESENSE maybe you can recommend me the board (send me link to the board), so I can purchase it locally and try changes by myself?
   
   @pkarashchenko please contact me by mail 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [nuttx] masayuki2009 commented on pull request #7584: boards/cxd56xx/spresense: add fs automount driver for SD Card

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on PR #7584:
URL: https://github.com/apache/nuttx/pull/7584#issuecomment-1340211655

   @pkarashchenko 
   
   ```
   CC:  board/cxd56_sdcard.c
   board/cxd56_sdcard.c: In function 'board_sdcard_disable':
   board/cxd56_sdcard.c:205:7: warning: unused variable 'ret' [-Wunused-variable]
     205 |   int ret;
         |       ^~~
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org