The default size for a line in the mbed-client-cli is ridiculously large for any sane command. Even targets with loads of RAM could have a good portion of memory hogged by the cli history.
See below:
2000 bytes? Two THOUSAND!? Per line!? From what I can tell each command is retained in history up to a certain point. The default number of history slots is shown below:
So after running 32 commands the mbed-client-cli framework is perpetually hogging 64kB of RAM -- enough to choke an nRF52832 completely.
I recently discovered this while trying to run BLE and a command line on an nRF52832_DK. Only one command would work, all following commands would just print nothing...
When I debugged I found that the command line library was failing to dynamically allocate a new 2000-byte buffer for the new command...
Furthermore, the mbed_lib.json for this library has no configuration options. This likely isn't a priority due to the upcoming tools updates.
All
GCC ARM
mbed-os-6.2.0
mbed-cli
Try using mbed-client-cli library on any target with less than a metric tonne of RAM.
Explains a lot...
Thank you for raising this detailed GitHub issue. I am now notifying our internal issue triagers.
Internal Jira reference: https://jira.arm.com/browse/MBOTRIAGE-2790
@artokin would you be able to help reviewing ?
Master repository for mbed-client-cli is https://github.com/ARMmbed/mbed-client-cli and some configuration updates are already available there. Unfortunately those changes are not back ported to Mbed OS yet.
As a workaround, would it be possible to use macros section in application configuration file to overwrite those problematic constants?
PR https://github.com/ARMmbed/mbed-os/pull/13443 created to update Mbed OS with the latest mbed-client-cli
The use_minimum_setfeature in the mbed-client-cli is specifically for constrained device use, which is part of the #13443
The fix was merged to Mbed Os. I'll close this as resolved.
Most helpful comment
The
use_minimum_setfeature in the mbed-client-cli is specifically for constrained device use, which is part of the #13443