In the following tutorial we will walk through how to post chunks directly to
the Memfault cloud using the
memfault GDB commands included in the
This is typically most helpful as a quick way to test that data collection is working prior to implementing the data transport path.
- You need to have a way to debug your product with GDB as part of your development setup
- The GDB version you are using needs to have the
GDB Python API enabled.
(It's generally the default or there is a
-pyversion of GDB which has it included.)
- You need to compile your firmware with debug symbol information (i.e
Even if you are using other compilers such as ARMCC or IAR, you can load the ELF (.out, .elf) generated and debug it in GDB as well.
Copy and paste and run the following in gdb:
Some GDB versions do not support Python scripting by default. If you see a message like "Python scripting is not supported in this copy of GDB", you might be able to run an alternative GDB binary with a -py suffix, for example arm-none-eabi-gdb-py.
Copy the command below and paste it into GDB and hit enter. This will load a
handler which automatically posts data to Memfault whenever
memfault_data_export_dump_chunks is called.
memfault_data_export_dump_chunks() needs to be called by your port as part of
a CLI command or periodic task in order for the data to be extracted. For
Now, every time
memfault_data_export_dump_chunks is called, the data passed as
a parameter to the function will automatically be posted to the Memfault cloud.
You don't have to do anything else! You will see logs print in the gdb CLI as
data is posted: