cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB55 Jump to bootloader problem in P2pClient project

TGUCL.1
Associate III

Hi

I have a strange problem with my p-nucleo board(MB1355C)

Using the example as reference DFU_Standalone (STM32Cube_FW_WB_V1.12.0\Projects\P-NUCLEO-WB55.Nucleo\Applications\USB_Device\DFU_Standalone)I am able to jump to bootloader and perform DFU update using CubeProgrammer

This is the jump code which is triggered by if SW1 is pressed. If I use the USB_USER connector and apply JP1 USB_MCU then I can see board as DFU Device in Device Manager (Windows 10)

void BootloaderInit()
{
 
	   __enable_irq();
	    HAL_RCC_DeInit();
	    HAL_DeInit();
	    SysTick->CTRL = SysTick->LOAD = SysTick->VAL = 0;
	    __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH();
 
	    const uint32_t p = (*((uint32_t *) 0x1FFF0000));
	    __set_MSP( p );
 
	    void (*SysMemBootJump)(void);
	    SysMemBootJump = (void (*)(void)) (*((uint32_t *) 0x1FFF0004));
	    SysMemBootJump();
 
	    while( 1 ) {}
}

However if I apply the same logic in BLE_p2pClient (\STM32Cube_FW_WB_V1.12.0\Projects\P-NUCLEO-WB55.Nucleo\Applications\BLE\BLE_p2pClient) I got USD Device not recognised notification from Windows 10.

For testing I`m calling Bootloader_Init() before HAL_Int() in main.c just to see if any project specific configuration is causing an issue but nothinc changed. Still USB not detected.

According to AN2606 steps prior to jump are as follows which I believe I have done.

In addition to patterns described above, user can execute bootloader by performing a jump
to system memory from user code. Before jumping to bootloader user must:
• Disable all peripheral clocks
• Disable used PLL
• Disable interrupts
• Clear pending interrupts

This is the screenshot from Device Manager. Unknown USB device is the STM32 as you might guess.

 0693W00000Y6qjaQAB.png 

I would appreciate if anyone has an idea on what`s going wrong here

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Sara BEN HADJ YAHYA
ST Employee

Hello @TGUCL.1​ ,

Thanks for your feedback,

This issue is similar to the one described in this thread, it is acctually an expected behavior because RNG and USB share the same clock source, please check AN5289, "Figure 9. Algorithm to use USB on CPU1" and the description below it for further details.

The solution is provided in the mentioned thread can help you solve the issue.

You can also use the solution provided under STM32Cube_FW_WB_V1.12.0\Projects\P-NUCLEO WB55.USBDongle\Applications\BLE\BLE_p2pServer.

You just need to place the "PeriphUsbClock_Config" function under the "USER CODE BEGIN 4" in main.c, and call it from the "USER CODE BEGIN SysInit".

PS: Check the CFG_USB_INTERFACE_ENABLE flag in app_conf.h file and make sure that is set to 1.

I hope this helps !

Sara.

View solution in original post

1 REPLY 1
Sara BEN HADJ YAHYA
ST Employee

Hello @TGUCL.1​ ,

Thanks for your feedback,

This issue is similar to the one described in this thread, it is acctually an expected behavior because RNG and USB share the same clock source, please check AN5289, "Figure 9. Algorithm to use USB on CPU1" and the description below it for further details.

The solution is provided in the mentioned thread can help you solve the issue.

You can also use the solution provided under STM32Cube_FW_WB_V1.12.0\Projects\P-NUCLEO WB55.USBDongle\Applications\BLE\BLE_p2pServer.

You just need to place the "PeriphUsbClock_Config" function under the "USER CODE BEGIN 4" in main.c, and call it from the "USER CODE BEGIN SysInit".

PS: Check the CFG_USB_INTERFACE_ENABLE flag in app_conf.h file and make sure that is set to 1.

I hope this helps !

Sara.