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

shell_print_commands() crashes #16

Open
joemcool opened this issue Nov 10, 2021 · 0 comments
Open

shell_print_commands() crashes #16

joemcool opened this issue Nov 10, 2021 · 0 comments

Comments

@joemcool
Copy link

Calling shell_print_commands() causes a crash. On my ESP8266 module, this manifests as a reboot with an exception cause of 3 (LoadStoreErrorCause). I believe this is caused by using PSTR() to store command strings in PROGMEM/flash, and then trying to print them with shell_println() instead of shell_println_pm(). I believe Arduino boards like the Uno and Mega would be affected by this as well, but don't have one to test with.

Steps to reproduce:
--Register a command with the command wrapped in a PSTR() call. e.g. shell_register(command_mycommand, PSTR("mycommand"));
--Call shell_print_commands()

I was using PSTR() because its what is done in the examples, and seems to be what the library expects. I have plenty of RAM available on my module, so I've moved away from the PSTR() calls as a temporary solution and things are working. However, it seems cleaner to fix this issue by adding an #ifdef ARDUINO wrapper to the shell_print_commands() function's loop so that the correct print_ln function gets called.

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

No branches or pull requests

1 participant