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

Revert OTA hack #18

Merged
merged 2 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build
run-name: ${{ inputs.run_name }}

env:
DEFAULT_PYTHON: 3.8
on:
pull_request: null
push:
branches:
- main
workflow_dispatch:
inputs:
run_name:
description: 'Name of run to identify it from other runs'
required: false
type: string

jobs:
build:
runs-on: ubuntu-latest

# Image generated from: https://github.com/memfault/memfault-port-playground/tree/master/docker/nrf-connect-sdk
container:
image: memfault/nrf-connect-sdk:2024-01-05
steps:
- uses: actions/checkout@v3

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v4
with:
python-version: ${{ env.DEFAULT_PYTHON }}

- name: Install Zephyr SDK as CMake package
run: |
${ZEPHYR_SDK_INSTALL_DIR}/setup.sh -c

- name: Build app
run: |
cd $GITHUB_WORKSPACE
cd ../
python -m venv venv
. venv/bin/activate
pip install -U pip==21.1
pip install west==1.2.0 memfault-cli==1.0.4
west init -l memfault-asset-tracker
west update --narrow -o=--depth=1 -o=--recurse-submodules --path-cache ~/zephyr-thingy91-path-cache
pip install -r zephyr/scripts/requirements.txt
pip install -r nrf/scripts/requirements-build.txt
west build -b thingy91_nrf9160_ns -p always memfault-asset-tracker -- \
-DCONFIG_MEMFAULT_NCS_PROJECT_KEY=\"DUMMY_KEY\" \
-DOVERLAY_CONFIG=overlay-memfault.conf \
-DCONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y \
-DCONFIG_MEMFAULT_NCS_FW_VERSION=\"${{ env.SOFTWARE_VERSION }}\"

rm -rf ~/zephyr-thingy91-path-cache
cp -r ${PWD} ~/zephyr-thingy91-path-cache

- name: Update Zephyr Project Cache
uses: actions/cache@v3
with:
path: ~/zephyr-thingy91-path-cache
key: zephyr-thingy91-{{ checksum $GITHUB_WORKSPACE/west.yml }}
4 changes: 4 additions & 0 deletions overlay-memfault.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,7 @@ CONFIG_MEMFAULT_FOTA=y

CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y
CONFIG_MEMFAULT_NCS_FW_VERSION="0.0.99-dev"

# TODO: Remove after disabling just the self-test
# Disable shell to save space
gminn marked this conversation as resolved.
Show resolved Hide resolved
CONFIG_MEMFAULT_SHELL=n
27 changes: 1 addition & 26 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,32 +525,7 @@ void memfault_fota_download_callback(const struct fota_download_evt *evt)
memfault_platform_reboot();
break;
case FOTA_DOWNLOAD_EVT_ERROR:
/*
* FIXME: When multiple threads are send/read'ing from the modem
* at the same time, we get intermittent corruption issues. We should
* really figure out what is wrong here but for now we just keep retrying.
*
* Example error logs:
*
* <wrn> location: GNSS timed out possibly due to too short GNSS time windows
* <inf> app_event_manager: LOCATION_MODULE_EVT_CLOUD_LOCATION_DATA_READY
* <inf> app_event_manager: DATA_EVT_DATA_READY
* <inf> app_event_manager: DATA_EVT_CLOUD_LOCATION_DATA_SEND
* <inf> app_event_manager: DATA_EVT_DATA_SEND_BATCH
* <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
* <inf> app_event_manager: CLOUD_EVT_CLOUD_LOCATION_UNKNOWN
* <inf> app_event_manager: LOCATION_MODULE_EVT_INACTIVE
* <inf> app_event_manager: CLOUD_EVT_DATA_SEND_QOS
* <inf> download_client: Downloaded 346112/424124 bytes (81%)
* <err> download_client: Unexpected HTTP response: 403 forbidden
* <err> fota_download: Download client error
* <err> fota_download: Download client error
* <inf> dfu_target_mcuboot: MCUBoot image upgrade aborted.
* <inf> dfu_target_mcuboot: MCUBoot image upgrade aborted.
* <err> FOTA failed -- trying again ...
*/
MEMFAULT_LOG_ERROR("FOTA failed -- trying again ...");
prv_run_memfault_fota_check();
MEMFAULT_LOG_ERROR("FOTA failed");
break;
default:
break;
Expand Down
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ manifest:
- name: memfault-firmware-sdk
url: https://github.com/memfault/memfault-firmware-sdk
path: modules/lib/memfault-firmware-sdk
revision: "1.5.2"
revision: "1.6.0"

self:
path: firmware
Loading