Skip to main content
Visitor II
June 4, 2024
Solved

Nucleo 144 F767zi - ST-link Console printf - sb4; sb5;sb6;sb7

  • June 4, 2024
  • 7 replies
  • 4954 views

Hello,

 

I am using a Nucleo 144 F767zi Board. 

 

I am try to get any command on the Virt COM Console. But I failed always. I tried very lot things from on youtube, on the Forum ... but I always failed.

I see in the documentation 

um1974-stm32-nucleo144-boards-mb1137-stmicroelectronics.pdf

6.9 USART communication

Carsten73_0-1717503994802.png

I see further that all pins are enabled by default. From my actual understanding, this means that the COM Port is not active because SB4 and SB7 are "ON" too?

Is this correct?

If this is true and I have to set SB4/SB7 off. 

How do I set SB4 and SB7 to OFF. 

I did found anything "how to change the state of a SB".

 

Thanks for any hint to get the Console running.

 

thanks

best regards

Carsten

 

 

    This topic has been closed for replies.
    Best answer by Carsten73

    Hello,

    but the docu said:

    For Virtual COM Port:

    SB5 on AND SB7 off

    SB6 on AND SB4 off

     

    Very Important too, use PD8 and PD9 on USART3. Otherwise I will not work too. 

     

    regards

    Carsten

    7 replies

    Graduate II
    June 4, 2024

    >>How do I set SB4 and SB7 to OFF. 

    Unsolder the zero-ohm resistor or solder bridging connection

    >>I did found anything "how to change the state of a SB".

    Use a soldering iron, remove connection, or drag solder between the two nodes to connect them.

    USART3 should work either way. This just allows you to disconnect wiring / connections if you add things to the board that clash with them.

    Bring up USART3 peripheral and pin clocks, baud rate of peripheral.

    The baud rate needs to match that of the COM port which you connect too in Windows

    Graduate II
    June 4, 2024

     

    //****************************************************************************
    
    void USART3_Init(void)
    {
     GPIO_InitTypeDef GPIO_InitStruct = { 0 };
     UART_HandleTypeDef UartHandle = { 0 };
    
     __USART3_CLK_ENABLE();
     __GPIOD_CLK_ENABLE();
    
     /* UART RX/TX GPIO pin configuration */
     GPIO_InitStruct.Pin = GPIO_PIN_8 | GPIO_PIN_9;
     GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
     GPIO_InitStruct.Pull = GPIO_PULLUP;
     GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
     GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
    
     HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
    
     /*## Configure the UART peripheral ######################################*/
     /* Put the USART peripheral in the Asynchronous mode (UART Mode) */
     /* UART1 configured as follow:
     - Word Length = 8 Bits
     - Stop Bit = One Stop bit
     - Parity = NO parity
     - BaudRate = 115200 baud
     - Hardware flow control disabled (RTS and CTS signals) */
     UartHandle.Instance = USART3;
    
     UartHandle.Init.BaudRate = 115200;
     UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
     UartHandle.Init.StopBits = UART_STOPBITS_1;
     UartHandle.Init.Parity = UART_PARITY_NONE;
     UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
     UartHandle.Init.Mode = UART_MODE_TX_RX;
    
     UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
    #ifdef UART_ONE_BIT_SAMPLE_DISABLE
     UartHandle.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
    #endif
    
     if (HAL_UART_Init(&UartHandle) != HAL_OK)
     {
     /* Initialization Error */
     Error_Handler();
     }
    }
    
    //****************************************************************************
    
    #define USART_RS232 USART3 // PD8/PD9 VCP
    
    #ifdef USART_CR1_TXEIE_TXFNFIE // FIFO Support
    #define USART_CR1_RXNEIE USART_CR1_RXNEIE_RXFNEIE
    #define USART_CR1_TXEIE USART_CR1_TXEIE_TXFNFIE
    #define USART_ISR_RXNE USART_ISR_RXNE_RXFNE
    #define USART_ISR_TXE USART_ISR_TXE_TXFNF
    #endif
    
    //****************************************************************************
    
    void OutChar(char c)
    {
     while((USART_RS232->ISR & USART_ISR_TXE) == 0); // Wait for Empty
     USART_RS232->TDR = c; // Send Char
    }
    
    //****************************************************************************

     

    Technical Moderator
    June 4, 2024

    @Carsten73

    And please pay close attention: many YouTube videos just mention an UART that is connected to the ST-LINK on the respective board without explicitely stating U(S)ART2. However, the large NUCLEO-144 in particular often does not use U(S)ART2, but U(S)ART3, which you must of course take into account when programming.

    Carsten73Author
    Visitor II
    June 4, 2024

     

    Hi thanks to both of you. 

    Means it should work without switch sb4/7 to off. 

     

    But it does work and if you look to the forum and google this problem exists for the NUcleo 144 Boards. 

     

    And it should work does not help me. It doesn`t. 

     

    Is there anywhere a working example how to configure a Nucleo 144 for example f767zi Board to get it running?

     

    Thanks

    sorry

    Carsten

     

     

    Technical Moderator
    June 4, 2024

    Yes, see your downloaded repository of the STM32F7, e.g. 

    Projects\STM32F767ZI-Nucleo\Examples\UART\UART_Printf

    This can also be found on Github: STM32CubeF7/Projects/STM32F767ZI-Nucleo/Examples/UART/UART_Printf at master · STMicroelectronics/STM32CubeF7 · GitHub

    Carsten73Author
    Visitor II
    June 4, 2024

    @Peter BENSCH 

    Sorry your Github example reference to to unknown Header and C file. stm32f7xx_nucleo.144,h & .c 

     

    This example can not be compiled. 

     

    And it seams that a lot of files have to be changed. Not the easy way. 

    Carsten

    Carsten73Author
    Visitor II
    June 4, 2024

    @Tesla DeLorean 

     

    And than? 

    You did a config like all others except the Example from Peter at Github. 

    They use Buadrate 9600 instead of 115200. 

    You without parity the with?

     

    thanks

    Carsten

     

    Graduate II
    June 4, 2024

    Most people don't use parity, and a baud rate fast enough that it doesn't cause unnecessary drag on a running application.

    I use 115200 8N1, and the PC side VCP settings need to MATCH

    Carsten73Author
    Visitor II
    June 4, 2024

    Did it today and before. Does not work at all

    Carsten73Author
    Visitor II
    June 4, 2024

    Hi,

    yes, sorry. 

    This answer was based on the baud rate. 

    I did it with parity and without. I did it with 9600 and 115200. Nothing change. 

    I tested the configs the colleges provided today. But I always failed. 

     

    Tomorrow I can add my config. Maybe you find something wrong. 

    Thanks for your support 

    best regards

    Carsten

    Graduate II
    June 4, 2024

    This will work on the F7xx NUCLEO-144 boards. Burn the .HEX with STM32 Cube Programmer.

    Outputs to USART3 / VCP at 115200 baud

    https://github.com/cturvey/RandomNinjaChef/blob/main/STM32F746ZG_Nucleo_AXIM-FLASH.hex

     

    @Peter BENSCH @Lina_DABASINSKAITE  direct attachment failed, HEX out of Keil

    "The attachment's stm32f746zg_nucleo_axim-flash.hex content type (application/octet-stream) does not match its file extension and has been removed."

    Community Manager
    June 5, 2024

    Hi @Tesla DeLorean ,

    Thanks for reporting, I am able to reproduce the issue and I am checking why this file type is not working. 

    Was it working before, or you noticed this issues just now? 

    Temporarily, as a workaround, please use the alternatives, such as .zip, .7z.

    Thanks,
    Lina

    Carsten73Author
    Visitor II
    June 5, 2024

    Hi, 

     

    today I remove the SMD 0 for SB4 & SB7 what means switch off these SB as described in the documentation,

     

    um1974-stm32-nucleo144-boards-mb1137-stmicroelectronics.pdf

    6.9 USART communication

    Carsten73_0-1717601316400.png

     

    This was a small mess and a jumper would be the much better solution. 

     

    But now it works directly. Now I can connect to the virtual console and see my printf messages. 

     

    I see that for some other F7 Nucleo Board the SB 4 & SB7 are switch off by default. 

    For the F676zi SB5,6,4,7 are all switch on by default. 

    But from my understand and if I read the table 6.9 (above) than the SB4 & SB7 must be switch off to get the Virtual COM Port running. 

    Isn`t ?

    Anyway for me it is working now and Lesson 2 "Hello World" is done. ;-))

    Thanks for your support and your time. 

    regards

    Carsten

     

     

     

    Graduate II
    June 5, 2024

    I don't know that they "need" removing, the signals are not high bandwidth (sub MHz). Removing them allows for deconfliction and prevents reflections on the lines, and functions other MORPHO cards might bring to the party.

    I've not found a need to remove them from my collection of NUCLEO-F7xx boards.

    Removing stubs from SDIO/SDMMC and QSPI interfaces can help, but there we're talking signals into the 10's of MHz that will act like transmission lines at speed.

    Carsten73AuthorAnswer
    Visitor II
    June 6, 2024

    Hello,

    but the docu said:

    For Virtual COM Port:

    SB5 on AND SB7 off

    SB6 on AND SB4 off

     

    Very Important too, use PD8 and PD9 on USART3. Otherwise I will not work too. 

     

    regards

    Carsten