Main Site Documentation

Cerbuino Bee Xbee serial Port


#1

How to get access to the xbee serial port on a CerbuinoBee with TinyCLR 0.5.0

I have tried GHIElectronics.TinyCLR.NativeApis.STM32F4.UartProvider\xx form 0 to 6
but only 0 and 1 are ok other give Exceptions


CerbuinoBee with Xbee
#2

That is because the Cerb firmware is still incomplete, I am guessing. I hope the team will be able to get to it in the coming 0.6.0


#3

OK , is this task a complicated thing ? or simply a declaration in the Firmware code ?


#4

Many users said easy http://docs.ghielectronics.com/tinyclr/porting/intro.html


#5

OK I was able to build the firmware , realy easy thanks for the step by step doc.
I see in DeviceSelector.h #define TOTAL_UART_CONTROLLERS 2
but the STM32F4_USART.cpp seem to support up to 6 ,
is it so simple as changing the TOTAL_UART_CONTROLLERS to 6 ?


#6

Yeah almost that easy. You need to check the uart code to make sure the pin map correctly.


#7

the pin map , doesn’t map all the 6 UART only the first two
#define STM32F4_UART_RXD_PINS { _P(A,10), _P(A, 3) }
#define STM32F4_UART_TXD_PINS { _P(A, 9), _P(A, 2) }

but these doesn’t match UART1 on the schematic the , its should be PB6 PB7

Am I wrong ?


#8

Cerbuino was not fully tested in 0.5. You can do the work as suggested or wait for 0.6.


#9

Well , I have try do modify the firmware
change the UART section in DeviceSelector.h with
// UART
#define TOTAL_UART_CONTROLLERS 5
#define STM32F4_UART_TX_BUFFER_SIZE 256
#define STM32F4_UART_RX_BUFFER_SIZE 512
#define STM32F4_UART_TXD_PINS { _P(B, 6), _P(A, 2), _P(B, 10), _P(A, 0), _P(C, 6) }
#define STM32F4_UART_RXD_PINS { _P(B, 7), _P(A, 3), _P(B, 11), _P(A, 1), _P(C, 7) }

#define STM32F4_UART_CTS_PINS { GPIO_PIN_NONE, _P(A, 0), GPIO_PIN_NONE, GPIO_PIN_NONE, GPIO_PIN_NONE }
#define STM32F4_UART_RTS_PINS { GPIO_PIN_NONE, _P(A, 1), GPIO_PIN_NONE, GPIO_PIN_NONE, GPIO_PIN_NONE }

In test program open of serial GHIElectronics.TinyCLR.NativeApis.STM32F4.UartProvider\4 is OK ( no exceptions )
send doesn’t triggers exception but receive is never called

since the pin as multiple usage , may be there is an other thing todo


#10

No More luck with TinyCLR 0.8.0
the Uart definitions of the CerbuinoBee is buggy

public const string Socket1 = “GHIElectronics.TinyCLR.NativeApis.STM32F4.UartProvider\5”;
public const string Socket2 = “GHIElectronics.TinyCLR.NativeApis.STM32F4.UartProvider\1”;
public const string Xbee = “GHIElectronics.TinyCLR.NativeApis.STM32F4.UartProvider\5”;
public const string Usart3 = “GHIElectronics.TinyCLR.NativeApis.STM32F4.UartProvider\2”;

same port for xbee and socket 1
sould be uart 6 for xbee socket
using GHIElectronics.TinyCLR.NativeApis.STM32F4.UartProvider\6 didn’t help

the STM32F4 Uart 6 is not enabled in the firmware


#11

STM32F4 Usart 6 is not enabled in the firmware. I get exception trying to use on a Quail.


#13

I only tried for Quail as I wanted a serial port on each of the 4 Sockets.