2017-10-27 10:43 AM
I am trying to configure a system to send data out CN13 on the Nucleo-F767ZI board. The CubeMX outputs seem to indicate this port is already set up:
100 PA8* USB_OTG_FS_SOF USB_SOF [TP1]101 PA9* USB_OTG_FS_VBUS USB_VBUS102 PA10* USB_OTG_FS_ID USB_ID103 PA11* USB_OTG_FS_DM USB_DM104 PA12* USB_OTG_FS_DP USB_DPbut there is no initialization of the port in the code (which I inherited).
I haven't been able to find much in the way of help in the programming manuals, so I thought I'd ask the community.
Thanks
2017-10-27 12:00 PM
From the Nuc-144 user manual;
2017-10-28 09:24 AM
Thanks - that's apparently the default configuration. Now, which UART/USART can I connect to this USB? I am using 3, 4, & 5, so 1, 2, 6, 7, and 8 are available. Any suggestions?
2017-10-28 11:48 AM
Remember that the STLink is a composite USB device, which has 3 functions:
- Debugging (HID)
- Mass storage (mBed, file drag and flash)
- Serial virtual user port (UART)
This USB virtual com port is usually connected to the target STM32 UART (check the schematic). This way, you can use a PC console with minimal SW development efforts.
2017-10-28 01:20 PM
I think we're going to punt on this. I don't see a way to get the serial data to the USB connector from the Nucleo-144 board, and there's no spare port on the Nucleo-64 board also in the box, so a direct solution is not obvious. But FTDI makes this great little chip that converts serial-USB, and we've got a couple of the interface boards (2cm x 5cm) ordered for Monday delivery.
Thanks again to the community.2017-10-30 07:17 AM
This nucleo has two usb connectors. CN1 on the stlink and CN13 for USB OTG.
Before we start, you should read 6.9 and 6.10 in Nuc-144 user man. UN1974
If you just want to get going fast, the STLINK creates a VCP (on CN1 connector).
The stlink connects to PD8/PD9 on the 767 (see schematic figure 16/17 in UM)
These are also the alternate pins for USART3 TX/RX.
If you are using Cube, enable USART 3. This enable PB10/PB
Then gotoeach of
PB10/PB10 pins
and crtl-click them, and CUBE shows the alternates, PD8/PD9.Reassign them.
Generate your project. Add the following to your main loop;
/* USER CODE BEGIN 2 */
uint8_t buffer[16] = ''Hello World
'';
/* USER CODE END 2 */
/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
HAL_UART_Transmit(&huart3, (uint8_t*)buffer, 13, 1000);
HAL_Delay(1000);
}
/* USER CODE END 3 */�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?
in device manager, you find ports as shown below.
in this case, i have two nuc boards connected, one with normal stlink, and a 2nd with stlink reflashed with JLink firmware.
Goto your favorite terminal and connect your VCP comm port.
I think this is what your wanted to do. But....
If you really want to connect to CN13 using OTG.
The CN13 is dead, until you put some USB stuff in your project.
You have to setup USB_HS/FS and USB_CDC in your project.
Finally, going back to the UM, make sure you read the warning;
2017-10-30 10:57 AM
Thanks for your efforts, but we are taking the alternate path. I can't use STLink, as we've removed that board for size constraints, and the warnings about CN13 make me terribly reluctant to pursue that option. We're trying to get an FTDI interface card working.
Thanks again,John