Upload firmware by dfu mode

good morning everyone

I’m testing on the bench with a blupill stm32f103c8t6.
I would like to know if there is a way by writing the sketch with platformio framework arduino, a code that accepts the upload via DFU.

I have to make a hardware where my end customer can use a software, for example web dfu (WebUSB DFU). to upload the firmware updates that I release.

I’ve been trying for weeks but I haven’t succeeded…

qui il mio Platformio.ino

[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
board_build.core = maple
upload_protocol = dfu

can you help me??

because with platformio I can load the DFU without any problems.

but using stm32cubeprogrammer or webdfu I can’t load…where could the problem be?