Skip to content

Repository files navigation

SiFli SDK — custom build fork

SiFli SF32LB52 SDK — Custom Build Fork

Upstream Target Used%20by RTOS

This is not upstream. It's a working copy of the official OpenSiFli/SiFli-SDK with a few build-system tweaks so it compiles cleanly against the SF32LB52 board I use in the PetFace project.

For anything general — driver docs, RT-Thread integration, official examples — read the upstream repo and docs.sifli.com. The original Chinese README lives at docs/upstream-README-zh.md.


Why this fork exists

I ran into a few build issues bringing the official SDK up on my SF32LB52-based board for the PetFace desktop pet project. Rather than patch the upstream tree destructively on my machine and then lose those changes on every git pull, I keep a working copy here with:

  • Small tweaks to the build scripts / config so ./build.sh runs end-to-end on my WSL setup without hand-editing paths.
  • A README that says this is a derivative, so anyone landing here from a search doesn't mistake it for upstream.

If you're starting fresh with a SiFli board, use the upstream repo first. Come back here only if you want to see what I changed and why.


What SF32LB52 is (short version)

SiFli Technology's SF32LB52 is a Cortex-M4 MCU with BLE 5.3, a low-power display subsystem, and enough SRAM to comfortably drive a small graphical UI. The SDK ships an HAL layer plus RT-Thread device drivers, so most of the peripheral work is done for you.

The chip is a decent match for wearables, always-on displays and BLE-linked hardware toys — which is exactly what PetFace is (an animated desktop "pet" that pulls emotion cues over BLE from a Raspberry Pi hosting a local LLM).


Getting the code

The upstream SDK uses submodules. Clone recursively:

git clone --recursive https://github.com/REevee0/SiFli_SDK
cd SiFli_SDK

Then follow the upstream install / export steps:

# Linux / WSL
./install.sh
source ./export.sh

# Windows PowerShell
.\install.ps1
.\export.ps1

Same commands as upstream — the fork doesn't move them around.


Building for SF32LB52

Once the env is exported, build the same way you would with upstream:

cd example/<one of the examples>
scons --board=sf32lb52-devkit

The sf32lb52-devkit board profile is defined under customer/boards/. If you're targeting a different SF32LB52 board, use that profile instead.


What actually differs from upstream

Small, surgical changes only. See the commit history for the diff:

git log --oneline HEAD ^$(git ls-remote --heads https://github.com/OpenSiFli/SiFli-SDK main | cut -f1)

TL;DR: build-config tweaks under build_config*.yaml, a couple of SConscript fixes for local paths, and this README. No source code under drivers/, middleware/ or rtos/ has been touched.


Directory tour (upstream layout)

customer/       Board support packages — pinouts, board init
drivers/        CMSIS + HAL for SF32LB5x
example/        Reference apps
external/       Third-party components (LittleVGL, lwIP, etc.)
middleware/     SiFli's own middleware
rtos/           RT-Thread + FreeRTOS + OS abstraction
tools/          Flash tools, image packers
docs/           Documentation (upstream README lives here now)
img/            Diagrams referenced by upstream docs

Related


License

The upstream SDK's Apache-2.0 license applies unchanged — see LICENSE. My build tweaks are trivial and released under the same terms.

About

SiFli SF32LB52 SDK with custom build patches for local devices (PetFace project)

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages