USB-C communication by Bulktransfer on endpoint not working and getting me confuse

Hi, i'm working on a project with a portenta h7 and an android application.
This application makes some Bulktransfer on the appropriate endpoint of the board for send order but the portenta h7 don't react to it.

#include <Scheduler.h>

int ledr = LEDR;//the built-in RGB led pins need to be pulled to ground to make the LED light up.
int ledg = LEDG;//This means that a voltage level of LOW will turn the LED on, a voltage level of HIGH will turn it off.
int ledb = LEDB;

void setup()
{
  //Serial.begin(115200); //tried but the result was worst! It dont even work with the IDE
  Serial.begin(9600);
  // Setup the 3 led pins as OUTPUT
  pinMode(ledr, OUTPUT);
  pinMode(ledg, OUTPUT);
  pinMode(ledb, OUTPUT);
  digitalWrite(ledr,HIGH);
  digitalWrite(ledg,HIGH);
  digitalWrite(ledb,HIGH);
}

void loop()
{
  //digitalWrite(ledr,LOW);
  if(Serial)//check if a usb communication is possible
  {
    digitalWrite(ledg,LOW);
    if(Serial.available() > 0)//listen Serial port for USB
    {
        digitalWrite(ledb,LOW);
    }
  }
}

I think i'm not listening correctly but i don't know how do it.
I didn't find information about how using the bulk endpoint of portenta h7 nor about the number we give to the Serial.begin .
How do i see all serial possible and what they are for?
For exemple with 9600 i can communicate with the IDE interface but is it all?
And is the number completely random?
I can't find any information about it everyone say use that but without explaining or giving a documentation.

As I understand: you want to use the USB-C interface for your "own" bulk transfer?
(not via VCP UART there provided)

You had to write your own USB driver on Portenta H7 FW.
And:
if you would not write a "composite" USB device driver, you would lose your UART (for terminal access, Bootloader should still work).

Anything other as the regular VCP UART, is tough and needs "your" driver code (with all the enumeration, handlers for traffic and protocol).
Not sure, potentially you can bring the USB-C into an ISO USB, for audio streaming.
Other than this - I guess there is nothing.

BTW: You could grab an USB Bulk example from another STM board (HAL drivers and demos), but be aware of: Portenta H7 uses an external HS PHY, not an internal FS PHY. This makes it already pretty tough (to setup driver using external PHY).

1 Like

I tried USB-C VCP:
with 64 bytes per chunk: approx. 10 Mbit/sec
with 256 bytes per chunk: approx. 36 Mbit/sec

I suggest to try the USB-C VCP UART, much faster as you think (real USB, not any UART device involved).
BTW: the UART baudrate setting does not matter: any baudrate is acceepted (e.g. in TeraTerm, in Python script). The Portenta H7 USB-C VCP UART is just limited by the USB speed. And the board uses a USB HS external PHY (much faster as FW internal PHY).