Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

boards/cxd56xx/spresense: add fs automount driver for SD Card #7584

Merged
merged 1 commit into from Jan 10, 2023

Conversation

pkarashchenko
Copy link
Contributor

@pkarashchenko pkarashchenko commented Nov 12, 2022

Summary

Add FS automount driver for SD Card.

This is the first step to remove BOARDIOC_SDCARD_SETNOTIFYCB

Options to enable functionality:

CONFIG_CXD56_SDCARD_AUTOMOUNT=y
CONFIG_FS_AUTOMOUNTER=y
CONFIG_FS_AUTOMOUNTER_DRIVER=y

Impact

New nsh_automount configuration added

Testing

Tested with spresense board

@pkarashchenko
Copy link
Contributor Author

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

@pkarashchenko
Copy link
Contributor Author

@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?

@xiaoxiang781216
Copy link
Contributor

@jerpelea @masayuki2009 could you help verify the change?

@xiaoxiang781216 xiaoxiang781216 marked this pull request as ready for review December 5, 2022 10:14
@xiaoxiang781216 xiaoxiang781216 linked an issue Dec 5, 2022 that may be closed by this pull request
@jerpelea
Copy link
Contributor

jerpelea commented Dec 5, 2022

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

@jerpelea
Copy link
Contributor

jerpelea commented Dec 5, 2022

@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

@masayuki2009
Copy link
Contributor

@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;
      |       ^~~

@masayuki2009
Copy link
Contributor

@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

@pkarashchenko
Copy link
Contributor Author

@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".

@pkarashchenko pkarashchenko marked this pull request as draft December 8, 2022 11:26
@pkarashchenko pkarashchenko force-pushed the cxd56_automount branch 4 times, most recently from 2178bc7 to e232d6c Compare January 7, 2023 23:52
@pkarashchenko pkarashchenko marked this pull request as ready for review January 8, 2023 00:18
@pkarashchenko
Copy link
Contributor Author

@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?

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
@pkarashchenko
Copy link
Contributor Author

pkarashchenko commented Jan 9, 2023

@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.

@masayuki2009
Copy link
Contributor

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

BOARDIOC_SDCARD_SETNOTIFYCB callback from OS into application
4 participants