DFU V2 PAN Loader Example
Source code path: example/dfu_v2/bt_pan/loader
Supported Platforms
This loader does not keep its own partition table; it is compiled together with the board project of the companion PAN user application. The current PAN user-application project covers these SF32LB52X (NOR flash) boards:
sf32lb52-lcd_n16r8_hcpusf32lb52-lchspi-ulp_hcpusf32lb52-nano_a128r16_hcpu
Overview
This example is the DFU V2 loader subprogram for the Bluetooth PAN channel. It pulls the new firmware over the phone-shared PAN network, writes it directly into the target partition, and reboots back into the new user application.
Usage Instructions
This loader normally does not need a separate build. The companion PAN user-application project pulls it in as a child project through AddDFU_PAN_V2(SIFLI_SDK) in its SConstruct, so building the app also produces the loader firmware. The usual flow is to build from the PAN user-application project directory; it can also be built standalone from this loader project directory.
Hardware Requirements
Before running this example, prepare:
One development board supported by this example (Supported Platforms).
A phone that provides a PAN network.
Compilation and Flashing
Switch to the PAN user-application project directory and run the scons command to compile; building the app automatically includes this loader:
> scons --board=sf32lb52-lcd_n16r8_hcpu -j8
It can also be built standalone from this loader project directory:
> scons --board=sf32lb52-lcd_n16r8_hcpu -j8
For detailed compilation and download steps, please refer to the Quick Start Guide.
Expected Results
After the example starts:
The local name is set to
sifli-pan, and the loader waits for the phone to connect.After the phone connects and joins the PAN network, the auto-update routine
execute_ota_update()is triggered: it runs a DNS check forota.sifli.com→ reads the firmware info that the user application pre-wrote atDFU_FWINFO_BASE_ADDRin flash → calls the blockingdfu_download().On success it clears the firmware info in flash, the UI shows the progress, then it reboots into the new user application.
For debugging, the finsh command ota_cmd is available with subcommands: del_bond, conn_pan, download, print, clear, test_flags, test_dns.
Troubleshooting
Reference Documentation
Update History
Version |
Date |
Release Notes |
|---|---|---|
0.0.1 |
06/2026 |
Initial version |