Serial monitor on a stm32 does not work

I’m trying to write a simple program that turns on and off a led of the STM32F303VC board, and at the same time, also prints “test” on the terminal.
Unfortunately, going to debug and opening the monitor, nothing comes out here. The debug is in continuous mode, and in fact the program works, it is only the output that does not come out…
Here is a screen to better understand the situation:

And here is the platformio.ini file that has not been modified by me:

[env:disco_f303vc]
platform = ststm32
board = disco_f303vc
framework = stm32cube

Finally, even if I don’t think it’s necessary, this is my MySTM32F303VC.h file:

#define     __IO    volatile             /*!< Defines 'read / write' permissions */

 typedef struct{

   __IO unsigned int CR;
   __IO unsigned int CFGR;
   __IO unsigned int CIR;
   __IO unsigned int APB2RSTR;
   __IO unsigned int APB1RSTR;
   
   union{__IO unsigned int AHBENR;
     struct{
       __IO unsigned DMA1EN:1;   
       __IO unsigned DMA2EN:1;  
       __IO unsigned SRAMEN:1;
       __IO unsigned Res:1;
       __IO unsigned FLITFEN:1;   
       __IO unsigned Res1:1;
       __IO unsigned CRCEN:1;
       __IO unsigned Res2:10;
       __IO unsigned IOPAEN:1;
       __IO unsigned IOPBEN:1;
       __IO unsigned IOPCEN:1;
       __IO unsigned IOPDEN:1;
       __IO unsigned IOPEEN:1;
       __IO unsigned IOPFEN:1;
       __IO unsigned Res3:1;
       __IO unsigned TSCEN:1;
       __IO unsigned Res4:3;
       __IO unsigned ADC12:1;
       __IO unsigned ADC34:1;
       __IO unsigned Res5:2;
                     };//END STRUCT ahbenr
            };//end union AHBENR
   
   
   __IO unsigned int APB2ENR;
   __IO unsigned int APB1ENR;
   __IO unsigned int BDCR;
   __IO unsigned int CSR;
   __IO unsigned int AHBRSTR;
   __IO unsigned int CFGR2;
   __IO unsigned int CFGR3;

}RCC_Type;

typedef struct{
  
  union{__IO unsigned int MODER;
        struct{
          __IO unsigned MODER0:2;
          __IO unsigned MODER1:2;
          __IO unsigned MODER2:2;
          __IO unsigned MODER3:2;
          __IO unsigned MODER4:2;
          __IO unsigned MODER5:2;
          __IO unsigned MODER6:2;
          __IO unsigned MODER7:2;
          __IO unsigned MODER8:2;
          __IO unsigned MODER9:2;
          __IO unsigned MODER10:2;
          __IO unsigned MODER11:2;
          __IO unsigned MODER12:2;
          __IO unsigned MODER13:2;
          __IO unsigned MODER14:2;
          __IO unsigned MODER15:2;
                };
        };
  
       
       __IO unsigned int OTYPER;
       __IO unsigned int OSPEEDR;
       __IO unsigned int PUPDR;
       
       
       union{   __IO unsigned int IDR;
                struct{
                  __IO unsigned IDR0:1;
                  __IO unsigned IDR1:1;
                  __IO unsigned IDR2:1;
                  __IO unsigned IDR3:1;
                  __IO unsigned IDR4:1;
                  __IO unsigned IDR5:1;
                  __IO unsigned IDR6:1;
                  __IO unsigned IDR7:1;
                  __IO unsigned IDR8:1;
                  __IO unsigned IDR9:1;
                  __IO unsigned IDR10:1;
                  __IO unsigned IDR11:1;
                  __IO unsigned IDR12:1;
                  __IO unsigned IDR13:1;
                  __IO unsigned IDR14:1;
                  __IO unsigned IDR15:1;
                  };
             };
       
       
       
       union{     __IO unsigned int ODR;
       
                  struct{
                  __IO unsigned OR0:1;
                  __IO unsigned ODR1:1;
                  __IO unsigned ODR2:1;
                  __IO unsigned ODR3:1;
                  __IO unsigned ODR4:1;
                  __IO unsigned ODR5:1;
                  __IO unsigned ODR6:1;
                  __IO unsigned ODR7:1;
                  __IO unsigned ODR8:1;
                  __IO unsigned ODR9:1;
                  __IO unsigned ODR10:1;
                  __IO unsigned ODR11:1;
                  __IO unsigned ODR12:1;
                  __IO unsigned ODR13:1;
                  __IO unsigned ODR14:1;
                  __IO unsigned ODR15:1;
                  };
                  
       };
       /*
       __IO unsigned int BSRR;
       __IO unsigned int LCKR;
       __IO unsigned int AFRL;
       __IO unsigned int AFRH;
       __IO unsigned int BRR;
       */

}GPIO_Type;

#define Input           0
#define Output          1
#define Alternate       2
#define Analog          3


#define RCC ((RCC_Type*) 0x40021000)
#define GPIOA ((GPIO_Type*) 0x48000000)
#define GPIOE ((GPIO_Type*) 0x48001000)

On other software, by going to “Terminal I/O”, the word is printed correctly, I don’t know what the problem is.

What is the full main.c program? Do you redirect the fundamental standard I/O output function _write function to print to the USART? (microcontroller - How do I use the printf function on STM32? - Electrical Engineering Stack Exchange)

How do you initialize the USART? On which pins do you connect the USB-UART converter to?

Maybe you have a general misconception. The serial monitor in PlatformIO is miniterm.py. It displays what a serial adapter (you seem to have one at /dev/ttyACM0) receives via UART. You may be used to semihosting-printf in Keil, which is transported via SWD to the flasher probe, or Segger RTT, but this is not what miniterm.py does or even can do. See also Viewing SWO output within PIO?.

The main is just this in the first screen.
You are absolutely right, I have the wrong idea of ​​the serial monitor… what I need is the Terminal I/O of IAR embedded workbench, exactly this:

If you want to see output in miniterm.py then your firmware must actively initialize the USART peripheral and overwrite the C library’s _write function to write to the USART peripheral, so that it can be in turn used by the C library’s printf function.

I hahve not worked with IAR so I don’t know what mechanism it uses to implement the terminal I/O. Maybe it auto-generates initialization code for the UART and redirects the standard C library’s function automatically. Maybe it uses semihosting. Maybe it uses ITC. Maybe it uses the SWO pin.

The only integrated serial monitor in PlatformIO is as said miniterm.py, which works on U(S)ART.

ok, i try to configure miniterm.py. But in any case, it would be nice to have a terminal where you can print the data acquired by the microcontrollers with just one printf.