RE: Sending data via UART
응답
16. 8. 4 오후 4:48 as a reply to Garret Holt.

Hello Garret,

you can find the definition of init.txBuf_p in the UART interface SER_serialDriver_ih.h. It defines a pointer to a buffer that holds the bytes that are transmitted. serialTxBuffer is defined by Jürgens application and is used as the required buffer.

Kind regards,
Franjo

0 (0 투표)
RE: Sending data via UART
응답
16. 8. 5 오전 7:34 as a reply to Franjo Stjepandic.

Hi Franjo,

 

Thanks for the reply. So can the buffer just any spot in memory allocated for the data such as

uint32_t txbuffer[5], rxbuffer[5];

 

Garret

0 (0 투표)
RE: Sending data via UART
응답
16. 8. 7 오후 12:39 as a reply to Garret Holt.

Hello Garret,

yes you are correct. The buffer should work fine with the posted code.

Please don't hesitate to ask, if you have further questions.

Kind regards,
Franjo

0 (0 투표)
RE: Sending data via UART
응답
17. 2. 16 오후 2:32 as a reply to Franjo Stjepandic.

Hello guys,

I've been trying to use the UART ports on the XDK gateway but I'm still struggling to send anything. My code runs but nothing is received on the other end.

I noticed one thing though when I try the UART example here: http://xdk.bosch-connectivity.com/xdk_docs/html/_x_d_k__e_x_t_e_n_s_i_o_n__b_u_s__g_u_i_d_e.html

the value SER_UART1 is seen as undeclared, I have to use the enum value instead to bypass it, but there maybe a link with my UART not working. I have included "SER_serialDriver_ih.h" and when I mouse over the SER_UART1 line in this file, the enum value is correctly displayed.

Any idea?

Thanks,

Aurelien

0 (0 투표)
RE: Sending data via UART
응답
17. 2. 16 오후 7:02 as a reply to Aurelien Lequertier.

Hello Aurelien,

I checked the example of the XDK extension guide and observed that there some include parts and variable declarations missing.

I recommend to include the following code snippet above the extension guide code and try it once again.

#include "PTD_portDriver_ih.h"
#include "PTD_portDriver_ph.h"
#include "SER_serialDriver_ih.h"
#include "em_cmu.h"

/** creating the serial Instance for future reference */
static SER_device_t uartHandle;

/* Transmit Buffer size for USART Ringbuffer */
#define TX_BUFFER_SIZE              (UINT8_C(20))

/* Receive Buffer size for USART Ringbuffer */
#define RX_BUFFER_SIZE              (UINT8_C(20))

/** Serial transmit buffer for ringbuffer */
static uint8_t ser2TxBuf_ma[TX_BUFFER_SIZE];

/** Serial receive buffer for ringbuffer */
static uint8_t ser2RxBuf_ma[RX_BUFFER_SIZE];

Please tell me if this helps you to get your implementation running and do not hesitate to ask if there is anything unclear.

Kind regards,
Franjo

0 (0 투표)
RE: Sending data via UART
응답
17. 2. 17 오전 11:05 as a reply to Franjo Stjepandic.

Hi Franjo,

Right I had already added the missing statements. I found my problem yesterday, apparently the 3.3V and 2.5V pins don't work or don't supply enough current. I was able to make it work by connecting my UART module to an external power supply.

Should I initialize the power pins on the gateway, or is there a max current that can be supplied by it?

Thanks,

Aurelien

0 (0 투표)
RE: Sending data via UART
응답
17. 2. 17 오후 12:56 as a reply to Aurelien Lequertier.

I found the way while looking at the definition of SDCardDriver_Init(). The following statement enables the 2 power pins on the gateway:

PTD_pinModeSet(PTD_GET_PORT_PIN_MODE_DOUT(WIFI_SD_VDD_PORT));

0 (0 투표)
RE: Sending data via UART
응답
17. 2. 17 오후 9:09 as a reply to Aurelien Lequertier.

Hello Aurelien,

as I understand you try to supply an additional external UART module to receive the data from the XDK.
Am I right so far?

If this is the case it depends on the power consumption of your module. The 3.3 V and 2.5 V pins have a maximum output of 100 mA.
If your UART module requires a greater amount of supply current, your choice using an external supply source should be the way to go.
Otherwise you can use them and activate via PTD_pinModeSet() as you already mentioned.

Please tell me if this helps you and do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)
RE: Sending data via UART
응답
17. 2. 20 오후 3:28 as a reply to Franjo Stjepandic.

Hi Franjo,

You're correct. My module draws up to 50 mA every few minutes so it is fine.

Thanks for your help!

Aurelien

 

0 (0 투표)
RE: Sending data via UART
응답
17. 2. 20 오후 6:09 as a reply to Aurelien Lequertier.

Hello Aurelien,

I am glad to hear that this fits for your purpose.

Please do not hesitate to ask if you have further questions.

Kind regards,
Franjo

0 (0 투표)