Connect the ribbon cable from the ST-Link to the breakout board.
Wire the breakout board to the target board using this pinout:
Configure the following jumpers on the Nucleo board:


Figure 1: Breakout board pinout (left) and ST-Link with breakout board (right).
Connect an external power supply to the Nucleo board (I use 5V @ 0.5A):

Figure 2: Your connection should roughly resemble what's seen here.
Load up STM32CubeIDE.
Setup the following configurations under Run Configurations > Debugger:
Under int main(void), setup a sample HAL_GPIO comparison script:
C - main.c...
/* USER CODE BEGIN 2 */
HAL_GPIO_WritePin(LED_PORT, LED_PIN, GPIO_PIN_RESET);
HAL_UART_Receive_IT(&huart2, buffer, 5);
/* USER CODE END 2 */
...
while (1) {
if (HAL_GPIO_ReadPin(BUTTON_PORT, BUTTON_PIN) == GPIO_PIN_RESET) {
if (memcmp(buffer, "hello", 5) == 0) {
HAL_GPIO_WritePin(LED_PORT, LED_PIN, GPIO_PIN_SET);
} else {
HAL_GPIO_WritePin(LED_PORT, LED_PIN, GPIO_PIN_RESET);
}
}
}
...Then, initialize the callback outside the main function:
C - main.c/* USER CODE BEGIN 4 */
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {
HAL_UART_Receive_IT(&huart2, buffer, 5);
HAL_UART_Transmit(&huart2, buffer, 5, 0xFFFF);
}
/* USER CODE END 4 */Run the code, ensuring the target program is the project that contains this code. You can open up a Command Shell Console to interact with the Nucleo directly.