You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
joemcool
added a commit
to joemcool/Shell
that referenced
this issue
Nov 10, 2021
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 usingPSTR()
to store command strings in PROGMEM/flash, and then trying to print them withshell_println()
instead ofshell_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 thePSTR()
calls as a temporary solution and things are working. However, it seems cleaner to fix this issue by adding an#ifdef ARDUINO
wrapper to theshell_print_commands()
function's loop so that the correct print_ln function gets called.The text was updated successfully, but these errors were encountered: