Reply
Posts: 49
Registered: ‎04-02-2016
Accepted Solution

How to connect UART0 (endpoint 5) on SLWSTK6101A ?

Is there any documentation on what pins on what header of the SLWSTK6101A platform to use for UART0 - I haven't discovered it ???

 

Thanks
@JaakkoV

Highlighted
Posts: 2,674
Registered: ‎09-01-2015

Re: How to connect UART0 (endpoint 5) on SLWSTK6101A ?

The UART0 (or UART1) signals can be configured to any GPIO pins, so it is not possible to answer "what pins to use for UART0". 

 

You mentioned SLWSTK6101A so I assume you are working with a BGM111 radio board, correct? Note that a development kit SLWSTK6101x may come with several radio boards (BGM111, BGM113, BGM121) that plug into the motherboard. The pin mapping depends on which radio board you are using.

 

IN case of BGM111, the pinouts can be found here:

https://www.silabs.com/documents/login/user-guides/ug122-brd4300a-user-guide.pdf

 

See Figure 4.3, it shows the expansion header pinout. You can use any of the pins marked in blue color. 

 

 

Posts: 49
Registered: ‎04-02-2016

Re: How to connect UART0 (endpoint 5) on SLWSTK6101A ?

Thanks @JaakkoV


You were correct in guessing that I have a BGM111 radio board.  I did glance at the PDF before Post the earlier message but at that time I couldn't discern between UART0 and UART1 pins. It looked like VCOM UART (endpoint 2) uses PA0 thru PA3

 

        My reference to endpoint 5 was a feeble attempt to relate to the endpoint_xxxx APIs available in BGScript.  One of you project examples in the forum comment about "both" endpoint 2 (UART1) and endpoint 5 (UART0) and you proceeded to use endpoint 2 for the USB VCOM (for debug messages sent back to the host).   So I am  guessing  that the hardware.xml is used to specify pins for both UARTs??
       If that is true, how do the endpoint APIs then know which UART to use for which endpoint ?   or do I have to use low-level emdriv software intefrace to access UART0 ??

 

      Also I am guessing the pins utilize CMOS logic levels (not RS-232) ??

Thanks in advance!

 

Posts: 2,674
Registered: ‎09-01-2015

Re: How to connect UART0 (endpoint 5) on SLWSTK6101A ?

If you are working with BGScript, then the UART mappings are done in hardware.xml. See example below:

<uart index="1" baud="115200" flowcontrol="true" tx_pin="PC10" rx_pin="PC11" rts_pin="PF2" cts_pin="PF3" bgapi="false" />

BGScript is deprecated and no longer supported starting from BLE SDK 2.4.0. It is not recommended for new projects, it is better to start with the C based flow which is much more flexible and has better debug capabilities.

 

Are you now working with C or BGScript? In C based applications there is no hardware.xml and you should not use endpoints. In C applications the UART is handled through emlib or emdrv. 

 

The UART uses CMOS logic levels, not RS-232.

 

Posts: 49
Registered: ‎04-02-2016

Re: How to connect UART0 (endpoint 5) on SLWSTK6101A ?

Thanks @JaakkoV (again)!!

   I already have a working BGScript project ( derived from your SPP-over-BLE BGScript example for BGM111 example ) and since this is a proof-of-concept exercise, I am reluctant to transition to C at this point in time.

 

Can BGScript access a 2nd UART -- maybe going down this path is a mistake - given your statement about improved GCC debugging??


 After glancing at the BGM111 and the EFR32BG1 SoC Family Data Sheet docs, I have yet to discover how the pins from Fig 4.3 in the Starter Kit are mapped to a UART.  Maybe I don't need to know if either emlib or emdrv handle that functionality??

 

Thanks again!!
   

Posts: 49
Registered: ‎04-02-2016

Re: How to connect UART0 (endpoint 5) on SLWSTK6101A ?

Hello @JaakkoV-
Tried to add UART0 to the working hardware.xml  from "SPP-over-BLE BGScript example for BGM111"  (which uses UART1 for VCOM).   After looking at Figure 4.2 and Table 4.1 in BGM111 Starter Kit (UG122), decided to use PF4 and PF5.  But to my surprise, I had to remove the <gpio port="F" definitions for UART0 to get an error free compile (whereas <gpio definitions for  UART1 port A were already present and didn't cause a problem).

 

Have I done something wrong??  (The XML file is attached)


BGBuild's error with the <gpio port="F" definitions included in the XML are:
UART1
baudrate :115200
flowcontrol:false
parity :none
data bits :8
stop bits :1
BGAPI :false
UART1 RX Robot tongueA1
UART1 TX Robot tongueA0
UART0
baudrate :115200
flowcontrol:false
parity :none
data bits :8
stop bits :1
BGAPI :false
UART0 RX Robot tongueF4
UART0 TX Robot tongueF5
GPIO
PA5 Robot tongueUSHPULL 1
PA3 Robot tongueUSHPULL 0
PF5 Robot tongueUSHPULL 1
PF4 Robot tongueUSHPULL 0
PF6 :INPUT 0
PF7 :INPUT 0
External interrupts
Interrupt 6Robot tongueF6 both
Interrupt 7Robot tongueF7 both
GPIO signal 'PUSHPULL 0' in I/O PF4 is already used by UART0 signal 'UART0 RX'

When the <gpio port="F" definitions are removed, the error free results are:

UART1
baudrate :115200
flowcontrol:false
parity :none
data bits :8
stop bits :1
BGAPI :false
UART1 RX Robot tongueA1
UART1 TX Robot tongueA0
UART0
baudrate :115200
flowcontrol:false
parity :none
data bits :8
stop bits :1
BGAPI :false
UART0 RX Robot tongueF4
UART0 TX Robot tongueF5
GPIO
PA5 Robot tongueUSHPULL 1
PA3 Robot tongueUSHPULL 0
PF6 :INPUT 0
PF7 :INPUT 0
External interrupts
Interrupt 6Robot tongueF6 both
Interrupt 7Robot tongueF7 both
Compiled, creating bin file.

Memory used:

 

Posts: 49
Registered: ‎04-02-2016

Re: How to connect UART0 (endpoint 5) on SLWSTK6101A ?

Correction:  Figure 4.3  (not 4.2)

Posts: 2,674
Registered: ‎09-01-2015

Re: How to connect UART0 (endpoint 5) on SLWSTK6101A ?

When using BGScript and configuring the peripherals via hardware.xml, you are not supposed to define the GPIO pins used by the UART. Those are automatically set, based on what you have defined in the <uart> tag.

 

The two GPIOs related to UART1 are PA5, PA3. These are not UART signals but they actually are control signals for the on-board USB-to-UART converter. PA5 = VCOM enable and PA3 is CTS flow control signal that is set statically to '0' value. It's kind of "dummy" flow control, because the CTS is always on. This is required only for the VCOM (USB-to-UART on the kit). If you map UART pins to expansion header then you only need to define the UART RX and TX pins (and optionally CTS, RTS). And these are all defined in the <uart> tag.