Skip to content

Conversation

@mrjimenez
Copy link
Contributor

The parsing of the number of bytes to read in the read command was being done in hexadecimal, causing unexpected behavior.

Now the number can be interpreted in decimal or hexadecimal if prefixed with 0x.

Also fixes the help test of the flash read command.

This patch runs clang-format on the flash_shell.c file before the
real patch gets applied, otherwise the changes would be hard to
read.

Signed-off-by: Marcelo Roberto Jimenez <[email protected]>
This patch runs clang-format on the shell_flash_test.c file
before the real patch gets applied, otherwise the changes
would be hard to read.

Signed-off-by: Marcelo Roberto Jimenez <[email protected]>
The parsing of the number of bytes to read in the read command was being
done in hexadecimal, causing unexpected behavior.

Now the number can be interpreted in decimal or hexadecimal if prefixed
with 0x.

Signed-off-by: Marcelo Roberto Jimenez <[email protected]>
Actually, the parameter is the number of bytes to read, not the number
of double words.

Signed-off-by: Marcelo Roberto Jimenez <[email protected]>
@mrjimenez mrjimenez force-pushed the pr_fix_shell_flash_read branch from 7dea44d to 33a1342 Compare December 15, 2025 23:19
@zephyrbot zephyrbot added area: Shell Shell subsystem area: Tests Issues related to a particular existing or missing test labels Dec 15, 2025
@sonarqubecloud
Copy link

@de-nordic
Copy link
Contributor

@mrjimenez Would it be possible to log a bug for that and link it to the PR?

@mrjimenez
Copy link
Contributor Author

mrjimenez commented Dec 16, 2025

I am not sure it would be considered a bug, since the test (which has also been fixed) also expected an hexadecimal number without 0x. But I can do that.

Fixes #101115

@de-nordic de-nordic added bug The issue is a bug, or the PR is fixing a bug and removed bug The issue is a bug, or the PR is fixing a bug labels Dec 18, 2025
Copy link
Contributor

@de-nordic de-nordic left a comment

Choose a reason for hiding this comment

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

Looks OK.
You have won very nice looking PR number 101010.

@mrjimenez
Copy link
Contributor Author

Looks OK. You have won very nice looking PR number 101010.

Indeed. And in binary, it is 42! 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Flash area: Shell Shell subsystem area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The parsing of the flash read command expects an hexadecimal byte count size without 0x

3 participants