我的项目使用 nrf52840 和 Freertos。该项目具有蓝牙广播和扫描功能。Bootloader 不使用 Freertos。当我在 nrf connect 中使用软件升级 DFU 时,DFU 功能没有响应。我使用 Freertos 创建了一个刷新任务,该任务一直在持续运行。未执行 DFU 升级。
我的项目使用 nrf52840 和 Freertos。该项目具有蓝牙广播和扫描功能。Bootloader 不使用 Freertos。当我在 nrf connect 中使用软件升级 DFU 时,DFU 功能没有响应。我使用 Freertos 创建了一个刷新任务,该任务一直在持续运行。未执行 DFU 升级。
My project uses nrf52840 and Freertos. This project has Bluetooth broadcasting and scanning functions. Bootloader does not use Freertos. When I used software to upgrade DFU in nrf connect, the DFU function did not respond. I created a refresh task using Freertos and it has been running continuously. DFU upgrade not performed
Hi,
Which SDK version are you using and how do intend to enter DFU mode? Is it via buttonless DFU (as demonstrated by the buttonless DFU sample), or some other method? What have you found by debugging and observing logs?
I forgot to take a screenshot. I used Wireshark to capture and found that when using the DFU service to upload files, there was a display indicating retrieval failure. And then it ended, the app didn't show the upgrade rate chart, it was always empty packets sent by the master and slave. You should be able to quickly reproduce the problem I mentioned using the files I provided.
2248.examples.zipThis is a simple demo I built. I tested that it can be upgraded using the mobile APP, but cannot be upgraded using the PC software.You can test it by directly replacing it with the SDK
Hi,
Thank you for the sample. I am able to reproduce it with that sample. DFU works with an iPhone, but not with nRF Connect for Desktop. If I test with the buttonless DFK sample from SDK 17.1.0, I can perform buttonless DFU also from nRF Connect for dekstop.
The probelm is not in the bootloader, but the device does not enter DFU mode. From nRF Connect for Dekstop you can see a GATT timeout, and this is also visible in the attached sniffer traces: 0842.traces.zip.
I have not been able to see what causes this issue yet though. Have you had any progress on your end?
There's no way to fix this. At the moment, I can only use the mobile software for the upgrade work.
There's no way to fix this. At the moment, I can only use the mobile software for the upgrade work.
There must be a way to fix it, but honestly I stil don't understand what the cause of this issue is. Wha I do see though, is that there ar eproblems allready in the service discovery. You can see it in the sniffer trace, in the GUI, you don't see the CCCD:
Compared with how it should be, as you can see for instance in the screenshot in this post.
Hi,
A short update from me. It seems the problem is that you do not handle the BLE_GATTS_EVT_SYS_ATTR_MISSING event. This is handled by the peer manager if the application use that (as is the case in the buttonless DFU sample application), but as you don't use the peer manager you must handle it yourself. You can do this by adding this snippet to your event handling in ble_evt_handler():
case BLE_GATTS_EVT_SYS_ATTR_MISSING:
// No system attributes have been stored.
err_code = sd_ble_gatts_sys_attr_set(m_conn_handle, NULL, 0, 0);
APP_ERROR_CHECK(err_code);
break;
Okay, I will verify this code. Thank you for your answer. I will let you know as soon as I have the results. Thank you.
Thank you, I solved this issue with your help.
I am glad to hear that. Thanks for letting me know!