Skip to content

Commit

Permalink
Revert OTA hack
Browse files Browse the repository at this point in the history
  • Loading branch information
gminn committed Jan 10, 2024
1 parent ae84bb1 commit d8a1d92
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 27 deletions.
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:
ota-deploy:
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 OTA payload
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=\"${{ secrets.THINGY91_OTA_PROJECT_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 }}
3 changes: 3 additions & 0 deletions overlay-memfault.conf
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ CONFIG_MEMFAULT_FOTA=y

CONFIG_MEMFAULT_NCS_FW_VERSION_STATIC=y
CONFIG_MEMFAULT_NCS_FW_VERSION="0.0.99-dev"

# Disable shell to save space
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

0 comments on commit d8a1d92

Please sign in to comment.