cancel
Showing results for 
Search instead for 
Did you mean: 

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

Carsten73
Associate III

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Carsten73
Associate III

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

View solution in original post

18 REPLIES 18

>>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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Peter BENSCH
ST Employee

@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.

In order 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.

 

//****************************************************************************

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
}

//****************************************************************************

 

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

 

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

 

 

Peter BENSCH
ST Employee

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

In order 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.

@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

Carsten73
Associate III

@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

 

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..