GPIO17/RTS2 and 2 wire serial communication


#1

I would like to use GPIO17 on the SL6087. However it is multiplexed with RTS2.
I also need to use UART2 for 2 wire serial so I can not close it.

I figured I had to use AT+IFC to disable the hardware flow control:

adl_atCmdCreate("AT+IFC=0,0", ADL_AT_PORT_TYPE(ADL_AT_UART2, true), (adl_atRspHandler_t) handler, "*", NULL);

This is where I got stuck, my handler doesnt seem to get called.
Am I on the right track, what am I doing wrong?

Thank you :slight_smile:


#2

Hi,

Please check that UART2 is open uisng AT+WMFM command

AT+WMFM?

If UART2 is not opened.Open UART2 using AT+WMFM=1,1,2

Thanks.


#3
bool cmd_RspHandler_WMFM(adl_atResponse_t* params)
{
	if (strstr(params->StrData, "+WMFM: 0,2,2,0"))
	{
		TRACE((MAIN_TRACE_LEVEL, "Opening UART2"));

		// UART2 is closed, open it
		adl_atCmdCreate("AT+WMFM=0,1,2", false, (adl_atRspHandler_t) cmd_RspHandler_WMFM, "*", NULL);
	}

	if (strstr(params->StrData, "+WMFM: 0,2,2,1"))
	{
		TRACE((MAIN_TRACE_LEVEL, "Enable 2 wire serial communication"));

		// UART2 is open
		adl_atCmdCreate("AT+IFC=0,0", false, (adl_atRspHandler_t) Init, "*", NULL);
	}

I’ve extended the code to open UART2 if it’s closed. Still the program keeps restarting (exception occured i assume) if I even just declare GPIO17 in my gpio config.


#4

Is there any reason why you can’t use another GPIO?

I’ve tried to use GPIO muxed with UART1 while UART1 is open, and while it worked in firmware 6.6x, I haven’t seen it work in firmware 7 series. Might be that if UART2 is open, there is no way to use one of the UART2 pins for GPIO at the same time.


#5

Hey Tobias

I think I am using all other GPIO’s. Can’t use the GPIO’s that are multiplexed with RTS1, CTS1 because I am using UART1.

I thought it was possible to use RTS2 and CTS2 if you disabled hardware flow control with AT+IFC=0,0 (datasheet says so more or less).
However I am not directly using UART2, I am using the location library for the XM0110 wich uses UART2. Does this help you locate the problem?


#6

Should be easy for you to test if it’s possible to begin with if you use standard AT commands.

First make sure UART2 is open
Then set flow control
Then check GPIO’s with AT+WIOM

I believe there is also a way to check if a GPIO is free using the ADL GPIO routines.

I haven’t used XM0110 so I don’t know if that library is causing any issues.