As described in that PR I am getting a hard fault when trying to cancel a download.
https://github.com/nrfconnect/sdk-nrf/pull/6955
To reproduce this issue apply the following changes
diff --git a/samples/nrf9160/download/src/main.c b/samples/nrf9160/download/src/main.c
index 53bbdf39c..135d23ba8 100644
--- a/samples/nrf9160/download/src/main.c
+++ b/samples/nrf9160/download/src/main.c
@@ -165,6 +165,21 @@ static int callback(const struct download_client_evt *event)
return 0;
}
+void my_work_handler(struct k_work *work)
+{
+ printk("*********** cancelling\n");
+ download_client_disconnect(&downloader);
+}
+
+K_WORK_DEFINE(my_work, my_work_handler);
+
+void my_timer_handler(struct k_timer *dummy)
+{
+ k_work_submit(&my_work);
+}
+
+K_TIMER_DEFINE(my_timer, my_timer_handler, NULL);
+
void main(void)
{
int err;
@@ -214,4 +229,6 @@ void main(void)
}
printk("Downloading %s\n", URL);
+
+ k_timer_start(&my_timer, K_SECONDS(5), K_NO_WAIT);
}