cancel
Showing results for 
Search instead for 
Did you mean: 

Replacing UART with USB for SFU. Getting Code 43 error- USB Device not recognize!!!

JChou.1
Associate III

Under SBSFU, I am able to run my custom application, and everything run fine. But changing the SFU defualt UART.with USB throughing error "USB Device not recognize!!!", I debug through SBSFU code, and USB stack(CDC and Devi ce only Configuration) initialize correctly.

I will highly appreciate for any help.

With regards

Jitu

1 ACCEPTED SOLUTION

Accepted Solutions

I would suggest to deactivate all the SBSFU security features first ( But I think you already did it)

Have you integrated the USB IRQ call ?

something like

void OTG_FS_IRQHandler(void)

{

 HAL_PCD_IRQHandler(&hpcd);

}

and do you see any interrupt ?

If you have some interrupt then you can check the stack status

For a trial, you can also increase the heap size.

View solution in original post

17 REPLIES 17
Frantz LEFRERE
ST Employee

Hello Jitu,

I would suggest first to validate your USB CDC configuration with a basic application.

You can find a example in the USB MOOC

https://www.st.com/content/st_com/en/support/learning/stm32-education/stm32-moocs/STM32-USB-training.html

STM32 USB training - 09.1 USB CDC device basic labs

Once your code is functional, then you can integrate it as SBSFU loader

Best regards,

Frantz

Hi Frantz,

Sorry mention that, the UserApp(my custom application) that I have test under SBSFU includes "USB -CDC in device only configuration", and its running with no issues.

With regards

Jitu

Frantz LEFRERE
ST Employee

To integrate your application in the SBSFU you should have relocated your application ( flash base address and vector table relocation).

Have you tested this application relocated in standalone ? No SBSFU in flash and you use your IDE to flash and debug the relocated application.

Best regards,

Frantz

To integrate your application in the SBSFU you should have relocated your application ( flash base address and vector table relocation).

Have you tested this application relocated in standalone ? No SBSFU in flash and you use your IDE to flash and debug the relocated application.

Best regards,

Frantz

Yes, My application working standalone and also under SBSFU (with new memory mapping) without any issue!!!

With regards

Jitu

Frantz LEFRERE
ST Employee

If you are sure about VTOR update and memory relocation,try to debug your application launched by the SBSFU ( with protection removed) .

Check if you get some USB IRQ , then you can observe the USB stack to understand at which step it get stucked.

The problem is not UserAPP side, its on SBSFU side!!!

Reading your description, I thought your loader was inside you User App...

Where is located your USB-CDC loader ( inside the SBSFU or inside the User Application ?

Ohh..

USB-CDC loader is inside SBSFU, I'm initializing in sfu_boot.c (in function SFU_BOOT_SystemSecurity_Config with "SFU_COM_Init()").