From 7660861c9707bd445a57d1071ed77c6b33f18616 Mon Sep 17 00:00:00 2001 From: Memfault Inc Date: Wed, 4 May 2022 17:10:01 -0400 Subject: [PATCH] Memfault Firmware SDK 0.30.4 (Build 438599) --- .circleci/config.yml | 2 +- CHANGES.md | 7 ++++ VERSION | 4 +- components/include/memfault/version.h | 2 +- .../main/console_example_main.c | 2 +- scripts/eclipse_patch.py | 39 ++++++++++++++++--- 6 files changed, 45 insertions(+), 11 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 418d82f19..3dbb5c3ce 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -16,7 +16,7 @@ executors: memfault-ci: docker: # TODO: create separate docker image + public Dockerfile - - image: memfault/ci:3.2.0 + - image: memfault/ci:3.2.3 working_directory: ~/repo commands: diff --git a/CHANGES.md b/CHANGES.md index b672f385e..0bea33cc7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,10 @@ +### Changes between Memfault SDK 0.30.4 and SDK 0.30.3 - May 4, 2022 + +#### :chart_with_upwards_trend: Improvements + +- minor updates to [`scripts/eclipse_patch.py`](scripts/eclipse_patch.py) to + support NXP's MCUXpresso IDE + ### Changes between Memfault SDK 0.30.3 and SDK 0.30.2 - April 25, 2022 #### :chart_with_upwards_trend: Improvements diff --git a/VERSION b/VERSION index 2793d55cc..b5289a8c6 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -BUILD ID: 433100 -GIT COMMIT: 558716463 +BUILD ID: 438599 +GIT COMMIT: 3905e51c1 diff --git a/components/include/memfault/version.h b/components/include/memfault/version.h index c8db92f5c..13d3481ba 100644 --- a/components/include/memfault/version.h +++ b/components/include/memfault/version.h @@ -19,7 +19,7 @@ typedef struct { uint8_t patch; } sMfltSdkVersion; -#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 30, .patch = 3 } +#define MEMFAULT_SDK_VERSION { .major = 0, .minor = 30, .patch = 4 } #ifdef __cplusplus } diff --git a/examples/esp32/apps/memfault_demo_app/main/console_example_main.c b/examples/esp32/apps/memfault_demo_app/main/console_example_main.c index 2f76e1790..a600425e5 100644 --- a/examples/esp32/apps/memfault_demo_app/main/console_example_main.c +++ b/examples/esp32/apps/memfault_demo_app/main/console_example_main.c @@ -170,7 +170,7 @@ static void prv_example_task(void *args) { // disable the task watchdog now that this task is done in this run MEMFAULT_TASK_WATCHDOG_STOP(example_task); - vTaskDelay(250 / portTICK_PERIOD_MS); + vTaskDelay(interval_ms / portTICK_PERIOD_MS); } } diff --git a/scripts/eclipse_patch.py b/scripts/eclipse_patch.py index 82c1ab04a..2615136bf 100644 --- a/scripts/eclipse_patch.py +++ b/scripts/eclipse_patch.py @@ -20,6 +20,15 @@ def get_depth_from_parent(project_dir, memfault_dir): common_prefix = os.path.commonprefix([memfault_dir, project_dir]) depth = 1 dirname = project_dir + + # some projects are in the root of the project dir- if the memfault dir is + # in the same directory, return a PROJECT_LOC value of 0 for the link + # position + if dirname == common_prefix: + return dirname, 0 + + # for the normal case, walk the directory parents until we find the common + # parent for the project and memfault dirs while True: parent_dir = os.path.dirname(dirname) if os.path.samefile(parent_dir, common_prefix): @@ -100,8 +109,9 @@ def files_to_link(dir_glob, virtual_dir, common_prefix, parent_dir): # Note: # - xtensa targets (i.e ESP) use CMake/Make so no need to add to eclipse based projects # - skip adding "memfault_demo_http" from demo component - if "xtensa" in file_name or "http" in file_name: + if "xtensa" in file_name or ("http" in os.path.relpath(file_name, start=common_prefix)): continue + logging.debug("Adding %s", file_name) yield get_file_element(file_name, virtual_dir, common_prefix, parent_dir) @@ -257,7 +267,13 @@ def patch_cproject( def _find_include_nodes(option): return option.get("id", "").startswith( - "ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths" + ( + # this is the element id used by Dialog's Smart Snippets Studio + # IDE (and possibly others) + "ilg.gnuarmeclipse.managedbuild.cross.option.c.compiler.include.paths", + # this is the element id used by NXP's MCUXpresso IDE + "gnu.c.compiler.option.include.paths", + ) ) memfault_sdk_include_paths = [ @@ -313,7 +329,11 @@ def _find_linker_flags(option): if __name__ == "__main__": - logging.basicConfig(level=logging.INFO) + logging.basicConfig( + format="%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s", + datefmt="%Y-%m-%d:%H:%M:%S", + level=logging.INFO, + ) parser = argparse.ArgumentParser( formatter_class=argparse.ArgumentDefaultsHelpFormatter, description=""" @@ -344,7 +364,10 @@ def _find_linker_flags(option): parser.add_argument( "-l", "--location-prefix", - help="The default behavior will add memfault-firmware-sdk files to the eclipse project using paths relative to the project root. This can be used to control the root used instead", + help=( + "The default behavior will add memfault-firmware-sdk files to the eclipse project using" + " paths relative to the project root. This can be used to control the root used instead" + ), ) parser.add_argument( @@ -356,7 +379,10 @@ def _find_linker_flags(option): parser.add_argument( "--output", - help="The directory to output result to. By default, the .project/.cproject files for the project will be overwritten", + help=( + "The directory to output result to. By default, the .project/.cproject files for the" + " project will be overwritten" + ), ) parser.add_argument( "--verbose", @@ -399,5 +425,6 @@ def _find_linker_flags(option): ) logging.info( - "Hurray, .project & .cproject have been succesfully patched! Be sure to 'Refresh' project to synchronize changes!" + "Hurray, .project & .cproject have been succesfully patched! Be sure to 'Refresh' project" + " to synchronize changes!" )