Page 1 of 1

serial links

Posted: Thu Jul 19, 2018 8:26 am
by steve64
Let assume ASTROBE for Cortex M7 and the Nucleo-F767ZI board as target.

How many independent serial "channels" would be available
and how they are supported by the IDE and Oberon APIs?

In fact, port naming is a bit confusing.
If I correctly interpreted the documentation:

- the ST-Link always uses USART3 (as virtual COM over USB)
- In module: can read data only from USART3
- Out module: can write data only from UART0 (but this name is not part of HW specs)
- Serial module: manages bidirectional communication using USART2 or USART3

More specifically, my application requirement is to have:

- bidirectional I/O for develpoment/debugging console (USB)
- 2 additional UARTs for custom connectivity with other device

Is this scenario feasible with Astrobe and Nucleo-F767ZI ?

Re: serial links

Posted: Thu Jul 19, 2018 12:39 pm
by cfbsoftware
The Datasheet for the F767ZI states there are 4 USARTs available. Astrobe does not have any inherent built-in restrictions on how many you can access. The standard library modules allow you to access either USART2 (TX = Port D5, RX = Port D6) or USART3 (TX = Port D8, RX = Port D9). Both of these configurations use Alternate Function AF7. You can extend the source code of Serial that comes with the Personal or Professional Edition of Astrobe to access other USARTs.

You would need to check that you have pins available that can be mapped to the USARTs after you have committed all the other pins you need to use for your application. Table 12. STM32F765xx, STM32F767xx, STM32F768Ax and STM32F769xx alternate function mapping in the F767etc. Datasheet tells you which ports you can use for each USART. Table 13. NUCLEO-F746ZG, NUCLEO-F756ZG and NUCLEO-F767ZI pin assignments in the User manual
for STM32 Nucleo-144 boards (UM1974) shows you which ports are connected to which pins. With so many pins available on the Nuceleo-144 boards I'd be surprised if you couldn't find a combination to suit your requirements.

In / Out are the high-level input and output functions (read a character, number; write a character, number etc). Serial is just one of the possible channels that In and Out can use to transport the characters to / from a device. The following lines of code are in Main.Init:

Code: Select all

  Serial.Init(Serial.USART3, 38400); 
  Out.Init(Serial.PutCh);
  In.Init(Serial.GetCh)
This redirects any subsequent input and output to USART3. If you wanted to redirect output to a display instead and you had implemented a function called Display.PutCh that wrote a character to the display the the call Out.Init(Display.PutCh) would do that for you.

This functionality was designed for users who wanted to use the simple In/Out functions to be able to read / write to a single device of their choice without having to write much code.

In your case you would be able to use the standard In / Out functions via Serial for bidirectional I/O for develpoment/debugging console (USB). You would need to implement your own functions to write to additional USARTs in the same application. There would be a number of ways you could do that without too much difficulty depending on the extent of 'custom connectivity' you require.

Re: serial links

Posted: Thu Jul 19, 2018 2:43 pm
by steve64
Thanks for the very clear explanation.