cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB USB bootloader

TGUCL.1
Associate III

Hi

I`m having some issues with programming p-nucleo usb dongle board with USB DFu mode.

The way I understand is ,

  • there is an internal system bootloader inside STM32WB which supports USB Firmware Download
  • If I can jump to bootloader from my application , my custom board/usb donle will present itself in Windows Device Manager as `USB DFu Device`
  • When above occurs , Dfuse application can detect the chip and download previously generated *.dfu file

this is the piece of code that i use to jump to system bootloader on button click. I modified the DFU Standalone Project provided by STM.

#define USBD_DFU_APP_DEFAULT_ADD     0x0800C000U
typedef  void (*pFunction)(void);
 
void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
{
 
	pFunction JumpToApplication;
	uint32_t JumpAddress;
 
  switch(GPIO_Pin) 
  {
    case BUTTON_SW1_PIN:
      /* Change the period from 500ms to 250ms or 250ms to 500ms */
      delay = (delay == 250) ? 700 : 250;
     JumpAddress = *(__IO uint32_t*) (USBD_DFU_APP_DEFAULT_ADD);
		JumpToApplication = (pFunction) JumpAddress;
		JumpToApplication();
      break;
  }

Here my questions

1) Does my code look okay ?

2)Normally if I switch SW2 to BOOT0 dongle board starts if DFU mode already. If the above code works I should be able to see the board in DFU mode without the need of SW2 , Is this correct ?

3)I have both STM32 Programmer and DFuse installed. When I run the code I can see "DFU in FS Mode" but I`m not sure if this is correct ?

4)Stm programmer can`t connect it if the SW1 is not BOOT0 . And Dfuse can never detect it.

5)I read in the forums that STM32 Programmer is replacement for DFuse but I can`t browse for *.dfu files in STM32 . Am I mising something ?

Thanks for your help and supportt

0 REPLIES 0