Hi there,
I’m new to Sierra Wireless programmable module and I need the community help.
I have e GL6100 RS232 module.
My goal is Read and Write byte from UART1. To do this I followed the sample project created with Developer Studio (2.3.2).
This is my code:
void UART_WriteCb( u8 ID, void * Context )
{
TRACE(( 2, "UART Write callback"));
uart_if->write( uart1_handler, "Uart opened", 13);
}
/***************************************************************************/
/* Function : main_task */
/*-------------------------------------------------------------------------*/
/* Object : Customer application initialisation */
/* */
/*-------------------------------------------------------------------------*/
/***************************************************************************/
void main_task ( void )
{
sUartSettings_t settings;
sUartLc_t line_coding;
//adl_InitType_e adl_InitType = adl_InitGetType ();
TRACE (( 2, "Embedded : Application Initialized" ));
/* Write on UART */
//adl_atSendResponse ( ADL_AT_UNS, "\r\nMain task started\r\n" );
/* UART1 Configuration */
TRACE (( 2, "Configure UART1" ));
/* Set the line code parameters */
line_coding.valid_fields = UART_LC_ALL;
line_coding.rate = (eUartRate_t)( UART_RATE_USER_DEF | 115200 );
line_coding.stop = UART_STOP_BIT_1;
line_coding.data = UART_DATALENGTH_8;
line_coding.parity = UART_PARITY_NONE;
/* Set the UART parameters */
settings.identity = "UART1";
settings.role = UART_ROLE_NM;
settings.capabilities = NULL;
settings.event_handlers = NULL;
settings.interface = &uart_if;
settings.line_coding = &line_coding;
uart1_handler = adl_OpenDevice( DF_UART_CLID, &settings );
if( uart1_handler == ERROR)
{
TRACE (( 2, "UART opening error" ));
}
else
{
TRACE(( 2, "UART opened"));
/* Start time to write periodically on UART */
adl_tmrSubscribe ( TRUE, 10, ADL_TMR_TYPE_100MS, UART_WriteCb );
}
}
I start a timer and when the timer elaps, I want to write on UART1.
To wirte this code I followed the example reported into “OpenAt Tutorial” under “Chapter17 - Open Uart”.
The problem appear when I try to open UART1. The port cannot be opened.
But if I use UART2 the port can be open.
By the way, i use the tab “Target Management” in Developer studio, to view the trace from the target.
Thanks for the help!