cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F373 USB prgram

JordiL
Associate II

Hi, two questions:

1.- What config must set to PA11/PA12 pins? I set ALTERNATE FUNCTION (0x10) in MODER register, but what AF option must set? In STM32F373 manual there is no AF defined.

2.- I configure USB device (clocks/gpio) and i can access to USB registers as ADDR,... but EPs seems inhibed? you know the reason why?

 

Thanks a lot 

18 REPLIES 18

What revision of the 'F373 do you have on the EVAL board?

How do you clock it, exactly?

Do you have some other hardware with the 'F373?

Does the DFU bootloader work?

JW

1-STM32F373VCT6

2-External clock 8.0Mhz

I create a project CubeIDE by board STM32373C-EVAL and usin default hardware config of the board and get same problem. Eps seems inhibed, can't not change with debug  (CubeIde) after MX_USB_PCD_Init function.

I have no more ideas, sorry.

You may want to contact ST directly, through FAE or the web support form, perhaps there giving link to this thread too.

JW

Thnaks a lot

FBL
ST Employee

Hello @JordiL 

Could you please provide me with a light code, so I can reproduce this behavior. This will be helpful in identifying issues. 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!
JordiL
Associate II

Use STM32373C-EVAL board.

Create New STM32 project with this board in CUBEIde.

The CubeIDE then create a main.c code with all the Initializations.

Set a Breakpoint in While(1) line in order to stop program and access to USB registers. 

Normally after initialization of USB all registers are accessible. Via Debugg can modify ADDR but EPnRs can't modify.

This code is directly generate by CUBEIDE, I only stop in while(1) line (in main() function) and check the USB registers.

 

#include "main.h"

ADC_HandleTypeDef hadc1;

COMP_HandleTypeDef hcomp2;

CEC_HandleTypeDef hcec;

I2C_HandleTypeDef hi2c1;
SMBUS_HandleTypeDef hsmbus2;

I2S_HandleTypeDef hi2s1;

SDADC_HandleTypeDef hsdadc1;
SDADC_HandleTypeDef hsdadc2;

SPI_HandleTypeDef hspi3;

TSC_HandleTypeDef htsc;

UART_HandleTypeDef huart2;

PCD_HandleTypeDef hpcd_USB_FS;

uint8_t cec_receive_buffer[16];

int main(void)
{

SystemClock_Config();

/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_ADC1_Init();
MX_COMP2_Init();
MX_HDMI_CEC_Init();
MX_I2C1_Init();
MX_I2C2_SMBUS_Init();
MX_I2S1_Init();
MX_SDADC1_Init();
MX_SDADC2_Init();
MX_SPI3_Init();
MX_TSC_Init();
MX_USART2_UART_Init();
MX_USB_PCD_Init();
while (1)
{

}
}

Hi,

I find the issue, seems that USB cable must be connect at HOST before init EPnRs. When wrote code for STM32F042 i can init USB (all EPnRs) before connect HOST cable, but in STM32F373 seems is not possible do that. Before to init registers must wait that USB detect USB Host.

 

??????

FBL
ST Employee

Hi @JordiL 

I'm sorry for not coming back sooner.

USB buffer descriptors should start from 0x4000 6000 USB SRAM to access packet buffer memory.

Could you access via memory view USB_EPnR region starting from 0x4000 5C00 and see if there is any signal of life?

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!

Hi @FBL ,

Could you access via memory view USB_EPnR region starting from 0x4000 5C00 and see if there is any signal of life?

As@JordiL wrote above, apparently no:

Theorically, now USB is ready to accept configure the EPns. But when i try to do it i can't change them.

Could the last remark - about the need of USB cable to be connected - indicate, that the PHY has to be powered externally?

JW