Skip to content

drivers/mtd_sdcard: add mtd_sdcard_default module #19216

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

Merged
merged 7 commits into from
Feb 5, 2023

Conversation

benpicco
Copy link
Contributor

@benpicco benpicco commented Jan 30, 2023

Contribution description

Copy & pasting MTD SDCard config between boards gets old really quick.
Provide the generic config via the mtd_sdcard_default module so the boards don't have to provide it anymore.

Testing procedure

tests/vfs_default should still work on any of the affected boards.

Issues/PRs references

@benpicco benpicco requested a review from gschorcht January 30, 2023 13:30
@github-actions github-actions bot added Area: boards Area: Board ports Area: drivers Area: Device drivers labels Jan 30, 2023
@benpicco benpicco added the Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation label Jan 30, 2023
@gschorcht
Copy link
Contributor

Kconfig changes for the affected boards and the driver are missing.

@gschorcht
Copy link
Contributor

BTW, while crawling through the dependencies, I wonder why some of these boards provide a feature sdcard_spi while others of them do not. I also wonder why sdcard_spi does not require the sdcard_spi feature. For example, it makes no sense to flash tests/driver_sdcard_spi on an arduino-due. It simply fails at init. So it seems to me to be reasonable to define a feature sdcard_spi that is provided by boards that are equipped with an SD-card interface and is required by module sdcard_spi.

@gschorcht
Copy link
Contributor

Kconfig should probably be cleaned up a bit with this PR. We have HAS_SDCARD_SPI which is supposed to indicate that an configuration for the SPI SD-Card is present, and HAVE_SDCARD_SPI which is supposed to indicate that the SD-Card SPI interface is present, which is a bit confusing 🤔 remote-revb and waspmote-pro select both of them, while sensebox_samd21 and waveshare-nrf52840-eval-kit select none of them. IMHO, HAS_SDCARD_SPI should indicate the feature that SPI SD-Card interface is present and the second one isn't needed anymore if I'm right.

@gschorcht
Copy link
Contributor

Kconfig changes for the affected boards and the driver are missing.

😕

Was your reaction really to be understood as being confused or surprised?

@benpicco
Copy link
Contributor Author

I'm not surprised, just not very enthusiastic about it 😅

@gschorcht
Copy link
Contributor

I'm not surprised, just not very enthusiastic about it

We should definitely define an app.config.test in tests/vfs_default to see what is missing in Kconfig. Also the current master works differently with TEST_KCONFIG=1 than without.

bors bot added a commit that referenced this pull request Feb 1, 2023
19193: rust: Update dependencies, use riot-wrappers from git r=benpicco a=chrysn

### Contribution description

As riot-wrappers has advanced a bit since it was last released, Rust modules are switched to using it from git again. (This is a regular ping-pong between testing the latest release in RIOT master, and using released support crates when they're current).

This primarily updates riot-wrappers, which has accumulated several compatible changes. Several other crates receive updates as well.

### Testing procedure

* Green CI

### Issues/PRs references

Changes on the riot-wrappers side:

* RIOT-OS/rust-riot-wrappers#17
* RIOT-OS/rust-riot-wrappers#22
* RIOT-OS/rust-riot-wrappers#29
* RIOT-OS/rust-riot-wrappers#30

[edit: added:]

This also serves to help preparing a 0.8.1 release of riot-wrappers, which performs some deprecations so that a breaking 0.9 change can be done more effortlessly later on.

19214: cpu/gd32v: add periph_spi support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_spi` support and is one of a bunch of PRs that complete the peripheral drivers for GD32VF103.

The driver is a modified version of the driver for STM32F1 with some changes that were necessary to get it working on GD32V.

### Testing procedure

`tests/periph_spi` as well as a test with any SPI sensor should work. `tests/driver_sdcard_spi` should work on `sipeed-longan-nano`.

### Issues/PRs references

Depeneds on PR #19216 

Co-authored-by: chrysn <chrysn@fsfe.org>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
@benpicco benpicco force-pushed the mtd_sdcard_autoconf branch from bf12577 to 0284e61 Compare February 2, 2023 01:13
@benpicco
Copy link
Contributor Author

benpicco commented Feb 2, 2023

Already works on sipeed-longan-nano with tests/vfs_default:

2023-02-02 02:13:21,766 # main(): This is RIOT! (Version: 2023.04-devel-262-g0284e61-mtd_sdcard_autoconf)
2023-02-02 02:13:21,767 # mount points:
2023-02-02 02:13:21,767 # 	/sd0
2023-02-02 02:13:21,767 # 
2023-02-02 02:13:21,767 # data dir: /sd0
> ls /sd0
2023-02-02 02:13:25,093 # HELLO.TXT	18 B
2023-02-02 02:13:25,094 # total 1 files

@benpicco
Copy link
Contributor Author

benpicco commented Feb 2, 2023

bors try

bors bot added a commit that referenced this pull request Feb 2, 2023
@bors
Copy link
Contributor

bors bot commented Feb 3, 2023

try

Build failed:

@gschorcht
Copy link
Contributor

Hm, the Kconfig issues still remain 😉

@benpicco
Copy link
Contributor Author

benpicco commented Feb 3, 2023

Yea I just wanted to see what fails

@benpicco benpicco force-pushed the mtd_sdcard_autoconf branch from 0284e61 to 02a15a0 Compare February 3, 2023 16:08
@benpicco benpicco changed the title drivers/mtd_sdcard: add mtd_sdcard_autoconf module drivers/mtd_sdcard: add mtd_sdcard_default module Feb 3, 2023
@github-actions github-actions bot added the Area: sys Area: System label Feb 3, 2023
bors bot added a commit that referenced this pull request Feb 3, 2023
@bors
Copy link
Contributor

bors bot commented Feb 3, 2023

try

Build failed:

Copy link
Member

@maribu maribu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice clean up

@gschorcht
Copy link
Contributor

nice clean up

👍 Yes, but still requires the Kconfig changes 😉

@gschorcht
Copy link
Contributor

nice clean up

+1 Yes, but still requires the Kconfig changes wink

That's why I hadn't approved it yet.

@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Feb 5, 2023
@benpicco benpicco added the CI: no fast fail don't abort PR build after first error label Feb 5, 2023
bors bot added a commit that referenced this pull request Feb 5, 2023
@@ -26,6 +26,7 @@ LOW_MEMORY_BOARDS := \
nucleo-f302r8 \
saml10-xpro \
saml11-xpro \
sipeed-longan-nano \
Copy link
Contributor

@gschorcht gschorcht Feb 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately, this board has not enough memory 😟

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea you can only have either nanocoap_vfs or nanocoap_dtls on this one.

@bors
Copy link
Contributor

bors bot commented Feb 5, 2023

try

Build succeeded:

@benpicco
Copy link
Contributor Author

benpicco commented Feb 5, 2023

Looks like CI is happy, should I squash? 😇

@gschorcht
Copy link
Contributor

Congratulations 🚀 Yes, please squash.

@benpicco benpicco force-pushed the mtd_sdcard_autoconf branch from c6f9cee to f78cdbb Compare February 5, 2023 18:06
@benpicco benpicco added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Feb 5, 2023
@riot-ci
Copy link

riot-ci commented Feb 5, 2023

Murdock results

✔️ PASSED

f78cdbb boards/sipeed-longan-nano: make use of mtd_sdcard_default

Success Failures Total Runtime
6851 0 6851 10m:29s

Artifacts

@benpicco benpicco added CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR and removed CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Feb 5, 2023
@benpicco
Copy link
Contributor Author

benpicco commented Feb 5, 2023

bors merge

bors bot added a commit that referenced this pull request Feb 5, 2023
19088: boards: add esp32s3-pros3 support r=benpicco a=gschorcht

### Contribution description

This PR provides the support for [ESP32 ProS3](https://esp32s3.com/pros3.html#home) board from Unexpected Maker.

This board doesn't have a USB-to-Serial chip on board. Therefore, USB Serial/JTAG is used for STDIO and the board is flashed via the USB Seral/JTAG interface by default.

### Testing procedure

Flashing `tests/shell` should work.

### Issues/PRs references

19216: drivers/mtd_sdcard: add mtd_sdcard_default module r=benpicco a=benpicco



Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Co-authored-by: Benjamin Valentin <benpicco@beuth-hochschule.de>
Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
@bors
Copy link
Contributor

bors bot commented Feb 5, 2023

Build failed (retrying...):

@gschorcht
Copy link
Contributor

Unrelated error

bors merge

@bors
Copy link
Contributor

bors bot commented Feb 5, 2023

Already running a review

@bors
Copy link
Contributor

bors bot commented Feb 5, 2023

Build succeeded:

@bors bors bot merged commit ebc869a into RIOT-OS:master Feb 5, 2023
@benpicco benpicco deleted the mtd_sdcard_autoconf branch February 5, 2023 22:47
bors bot added a commit that referenced this pull request Feb 7, 2023
19240: tools/doccheck: add simple exclude to doccheck r=benpicco a=kfessel

while doccheck runs for #19228 and #19220, i saw some spikes in memory consumption, turned out that was `grep -Evf dist/tools/doccheck/exclude_patterns` using about 2GB RAM. This PR changes that.

### Contribution description

add `exclude_simple`  to `doccheck` drived from `exclude patterns`
`sort`ed and `uniq`ued the simple excludes
removes no longer needed patterns from `exclude patterns`

simple excludes are string rules (no patterns just strings) 
how to apply these:
in this PR: 
*remove the path and line number from the rule
* that made some of them doubles of each other
* sorted and uniqued them. 
* this set of excludes is no longer path specific (an exception covers all paths but may of them still contain a file name)

another possible solution would be to have the excludes line number specific.

### Testing procedure

run `dist/tools/doccheck/check.sh`

compare memory consumption of 
master: `grep -Evf dist/tools/doccheck/exclude_patterns`
to 
this PR: `grep -Fvf dist/tools/doccheck/exclude_simple`

### Issues/PRs references



19248: cpu/gd32v: add periph_dac support r=benpicco a=gschorcht

### Contribution description

This PR provides the `periph_dac` support for GD32VF103.

### Testing procedure

`tests/periph_dac` should work on `sipeed-longan-nano` port on PA4 and PA5.

### Issues/PRs references

19255: boards/esp*: complete SD Card MTD config r=benpicco a=gschorcht

### Contribution description

This PR provides the remaining changes necessary to use the generic MTD SD Card configuration as described in PR #19216. 

This includes defining the MTD offset for SD cards, since the default `MTD_0` device always uses the internal flash device, and the completion of the configuration for the ESP32 boards with a SD card interface.

### Testing procedure

`tests/vfs_default` should work now with SD Cards:
```
main(): This is RIOT! (Version: 2023.04-devel-323-gfcc07)
mount points:
	/nvm0
	/sd0

data dir: /sd0
> vfs df 
Mountpoint              Total         Used    Available     Use%
/nvm0                3052 KiB        8 KiB     3044 KiB       0%
/sd0                 7580 MiB 3632148992 B   21089792 B      99%
```

### Issues/PRs references


Co-authored-by: Karl Fessel <karl.fessel@ovgu.de>
Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.04 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: boards Area: Board ports Area: drivers Area: Device drivers Area: Kconfig Area: Kconfig integration Area: sys Area: System Area: tests Area: tests and testing framework CI: no fast fail don't abort PR build after first error CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants