Skip to content

sys/shell/cmds: add MTD command from mtd_raw test#21489

Merged
crasbe merged 3 commits intoRIOT-OS:masterfrom
fabian18:pr/shell_cmd_mtd
Aug 14, 2025
Merged

sys/shell/cmds: add MTD command from mtd_raw test#21489
crasbe merged 3 commits intoRIOT-OS:masterfrom
fabian18:pr/shell_cmd_mtd

Conversation

@fabian18
Copy link
Copy Markdown
Contributor

Contribution description

This PR moves the MTD shell command from tests/drivers/mtd_raw to the general reusable shell commands,
because I find it useful and want to reuse it.

Additionally the optional parameter -b can be used to write binary data..

Testing procedure

make -C tests/drivers/mtd_raw/ flash

2025-05-14 15:43:57,877 # mtd 0 read 0 1024
2025-05-14 15:43:57,973 # 00000000  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
...
2025-05-14 15:43:58,084 # 00000100  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
...
2025-05-14 15:43:58,181 # 00000200  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
...
2025-05-14 15:43:58,277 # 00000300  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
...
2025-05-14 15:43:58,373 # 000003F0  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00
2025-05-14 15:44:18,947 # mtd 0 write -b 0 abcd
> mtd 0 read 0 1024
2025-05-14 15:44:21,747 # mtd 0 read 0 1024
2025-05-14 15:44:21,860 # 00000000  AB  CD  00  00  00  00  00  00  00  00  00  00  00  00  00  00
2025-05-14 15:45:04,321 # mtd 0 write 256 abcd
> mtd read 0 1024cd
2025-05-14 15:45:05,905 # mtd 0 read 0 1024
2025-05-14 15:45:06,002 # 00000000  AB  CD  00  00  00  00  00  00  00  00  00  00  00  00  00  00
....
2025-05-14 15:45:06,099 # 00000100  61  62  63  64  00  00  00  00  00  00  00  00  00  00  00  00

Issues/PRs references

@github-actions github-actions bot added Area: tests Area: tests and testing framework Area: build system Area: Build system Area: sys Area: System labels May 14, 2025
@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels May 14, 2025
@riot-ci
Copy link
Copy Markdown

riot-ci commented May 14, 2025

Murdock results

✔️ PASSED

1d1b354 sys/shell/cmds: add mtd.doc.md

Success Failures Total Runtime
10559 0 10560 17m:37s

Artifacts

Copy link
Copy Markdown
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

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

With the commands becoming available for general purpose use, it would be nice to have some documentation about them. I know that many other shell commands are not very well documented, so this is up for discussion.
But maybe an mtd.doc.md file would be possible with some words about usage and what the commands do.

@fabian18 fabian18 requested a review from jia200x as a code owner May 15, 2025 10:49
@github-actions github-actions bot added the Area: doc Area: Documentation label May 15, 2025
Copy link
Copy Markdown
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

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

Thank you for adding the documentation :)

I added some small remarks, so that Doxygen is happy.

@crasbe
Copy link
Copy Markdown
Contributor

crasbe commented May 19, 2025

image

Hello empty page bug, my old friend...

This is a Doxygen thing though.
@mguetschow any ideas how to hide that? 👀

@mguetschow
Copy link
Copy Markdown
Contributor

@fabian18 fabian18 force-pushed the pr/shell_cmd_mtd branch 2 times, most recently from f3a8c5b to b320671 Compare August 10, 2025 10:33
Copy link
Copy Markdown
Contributor

@crasbe crasbe left a comment

Choose a reason for hiding this comment

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

Just a smöl thing, other than that I think it is ready to be merged :)

@crasbe crasbe enabled auto-merge August 14, 2025 12:18
@crasbe crasbe added this pull request to the merge queue Aug 14, 2025
Merged via the queue into RIOT-OS:master with commit 165cc75 Aug 14, 2025
26 checks passed
@benpicco benpicco added this to the Release 2025.10 milestone Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: build system Area: Build system Area: doc Area: Documentation Area: sys Area: System Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants