Skip to main content
JChou.1
Associate III
Nov 30, 2020 7:47 AM UTC
Solved

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

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

This topic has been closed for replies.
Frantz LEFRERE
Frantz LEFREREBest answer
ST Technical Moderator
Nov 30, 2020 9:06 AM UTC

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.

13 replies

Frantz LEFRERE
ST Technical Moderator
Nov 30, 2020 7:57 AM UTC

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

JChou.1
JChou.1Author
Associate III
Nov 30, 2020 8:01 AM UTC

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 Technical Moderator
Nov 30, 2020 8:09 AM UTC

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

Frantz LEFRERE
ST Technical Moderator
Nov 30, 2020 8:09 AM UTC

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

JChou.1
JChou.1Author
Associate III
Nov 30, 2020 8:12 AM UTC

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

With regards

Jitu

Frantz LEFRERE
ST Technical Moderator
Nov 30, 2020 8:24 AM UTC

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.

JChou.1
JChou.1Author
Associate III
Nov 30, 2020 8:36 AM UTC

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

Frantz LEFRERE
ST Technical Moderator
Nov 30, 2020 8:46 AM UTC

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 ?