when i say that is doesn’t work i mean everything is ok i switch to data mode ok but after that nothing happens. I get the traces:
Trace CUS4 1 fcm control handler event 0
Trace CUS4 1 switching do data state
Trace CUS4 1 fcm control handler event 2
Trace CUS4 1 Now in data mode
after this at some point i would aspect to datahandler to be called and
TRACE (( 1, “fcm data %d”,*Data));
doesn’t diplay anything
DUMP macro sorry i am not familiar with this (like i said i stared working with open at only a few days ago)
Have you configured the UART (prior to opening flows) to the same speed as the GPS sends its NMEA data in? 4800,8n1 is the common setting for that, but it varies between providers.
Do you receive NMEA data if you connect the GPS to a PC via serial cable?
The DUMP macro is documented in exactly the same place as the TRACE macro; viz in the ADL User Guide for Open-AT
Look in the section titled, “Debug traces”
All the more important to start with the basics - like a review of the supplied documentation.
Have you worked through the example projects - there’s a “Hello, world” example that illustrates the use of UART1 and FCM…
Remember: as far as the FCM is concerened, it deals only with serial data - it neither knows nor cares whether that serial data comes from a PC, a GPS unit, a terminal, a vending machine, or anything else!
Therefore, you should start by verifying that that you can send serial data to a PC, and receive from a PC - using hypoterminal, or whatever.
Once you know that the basic serial IO works, then you can try it with the GPS unit…
i connect the gps module to the modem by a SMA male connector not by a serial cable
on the modem there is a basic application that has an at command that shows the current gps position so the gps works and can communicate with the modem i just can’t write some code that does the same thing
i tried to set the baud rate
with ipr but still after a succesfull change to data mode the data handler function is not called
[/quote]
Are you sure that’s the actual GPS module you’re connecting?
Are you sure that it’s not just the GPS antenna…?!
It would be rather unusual to use an SMA connector for serial data!
Then again, if this GPS module does not provide serial data, then you obviously won’t be able to talk to it over a UART!
It has already been noted that this is a Wavecom-specific forum; as you’re using a non-Wavecom product, I think you need to check with the manufacturer to determine exactly how the GPS data reaches the Wismo module within their product.
Or perhaps you could post a link to the technical specs for this unit?
In particular, see section 11 in the User Guide - “Client Support” - there is mention of Application Notes…
Looking at the User Guide and the pictures, I’d be pretty sure that you are just talking about the GPS antenna
It also looks extremely likely that UART1 is going to be connected to the external RS232 connector - just as in a Fastrack - so the GPS most probably must be connected to something else!
You need to contact Erco & Gener for the details of this - it might not even use a UART at all!
ok guys thank you all for your help i figured it out
the problem was that the gps was held in reset so all i needed to do is to not hold it in reset and indeed that data started arriving in my datahandler
Here is the code maybe somebody will have the same problem
/**************************************************************************/
/ Local variables /
/**************************************************************************/
//u8 fcmHandle; #define UART2_CLOSED 0 #define UART2_GETTING_STATUS 1 #define UART2_CLOSED_WAITING_OK 2 #define UART2_OPENING_WAITING_OK 3 #define UART2_OPEN_WAITING_OK 4 #define UART2_OPEN 5 #define UART2_CHANGING_SPEED 6 #define UART2_OPENING_FCM 7 #define UART2_READY 8
typedef enum
{
UART_MODE_AT,
UART_MODE_DATA
} uartModeType_e;
bool b_canSendDataToUart2 = TRUE;
u8 uart2Mode = UART_MODE_AT;
bool gps_resetMode = 0;
s8 GPIO1_Handle;
s8 FCM_UART2_handle;
u8 uart2Status = UART2_CLOSED; // to manage to the starting of UART2
/**************************************************************************/
/ Local functions /
/**************************************************************************/
void startGpsBlock(void)
{
TRACE (( 1, “startGpsBlock” ));
// select mode 1. ADC_C corresponds to the Antenna voltage
adl_atCmdCreate( "AT+ADC=1", FALSE, ( adl_atRspHandler_t ) NULL, NULL);
// Release the reset of the GPS block now that the UART2 is open and its FCM is in DATA mode
gps_resetMode = 1;
adl_ioWrite(GPIO1_Handle, ADL_IO_Q24X6_GPO_1, ADL_IO_Q24X6_GPO_1); // reset set high
//subscribeToCmdsUbx(); // send UBX config frames after UART2 and Reset are valid
//getAdcVoltages(); // get startup voltage of unpowered GPS antenna
#ifdef DELAYED_ANALYSE_RX_FRAMES
// start the cyclic timer to analyse received frames
//TIMER_CHECKBUFFER_handle = adl_tmrSubscribe ( TRUE, 1, ADL_TMR_TYPE_100MS, tmrHandler_checkRxBuffer ); #endif
//**************************************************************************
// Subscribe to the UART2 FCM after a short delay
void tmrHandler_startFcmUart2( u8 ID )
{
// Subscribe to the FCM for UART2
FCM_UART2_handle = adl_fcmSubscribe ( ADL_FCM_FLOW_V24_UART2, FCM_UART2_CtrlHandler, FCM_UART2_DataHandler );
//----------------------------------------------------------------------------------------
// Check that OK is received after setting UART2 default speed
// If OK, wait, then subscribe to the FCM for UART2
//----------------------------------------------------------------------------------------
bool cmd_RspHandler_IPR(adl_atResponse_t * params)
{
ascii buf[30];
TRACE (( 1, "cmd_RspHandler_IPR" ));
wm_strRemoveCRLF(buf, params->StrData, params->StrLength);
if ((!wm_strcmp(buf, "OK")) && (uart2Status == UART2_CHANGING_SPEED))
{
uart2Status = UART2_OPENING_FCM;
// Must wait before subscribing to the FCM for UART 2,
// otherwise the UART2 parameters are not set correctly
// and the UART2 is not synchronised to the incomming data.
adl_tmrSubscribe ( FALSE, 1, ADL_TMR_TYPE_100MS, tmrHandler_startFcmUart2 );
}
return FALSE;
}
//----------------------------------------------------------------------------------------
// Response handler after requesting/modifying UART2 status.
// If UART2 is closed then open it. Once open, then change speed.
// If it is already open, then leave it open and change speed.
//----------------------------------------------------------------------------------------
bool cmd_RspHandler_WMFM(adl_atResponse_t * params)
{
ascii buf[30];
wm_strRemoveCRLF(buf, params->StrData, params->StrLength);
switch(uart2Status)
{
case UART2_GETTING_STATUS:
if(buf[13] == '0') // "+WMFM: 0,2,x,0" ==> Closed
{
uart2Status = UART2_CLOSED_WAITING_OK;
}
else if(buf[13] == '1') // "+WMFM: 0,2,x,1" ==> Open
{
uart2Status = UART2_OPEN_WAITING_OK;
}
break;
case UART2_CLOSED_WAITING_OK:
if(!wm_strcmp(buf, "OK"))
{
uart2Status = UART2_OPENING_WAITING_OK;
// By default, only UART 1 is open. UART 2 must be explicitly opened
adl_atCmdCreate( "AT+WMFM=0,1,2", FALSE, ( adl_atRspHandler_t ) cmd_RspHandler_WMFM, "*", NULL );
}
break;
case UART2_OPEN_WAITING_OK:
if(!wm_strcmp(buf, "OK"))
{
uart2Status = UART2_CHANGING_SPEED;
// Set default speed for UART 2
adl_atCmdCreate("AT+IPR=9600", ADL_AT_PORT_TYPE( ADL_AT_UART2, FALSE ), (adl_atRspHandler_t) cmd_RspHandler_IPR, "*", NULL);
}
break;
case UART2_OPENING_WAITING_OK:
if(!wm_strcmp(buf, "OK"))
{
uart2Status = UART2_GETTING_STATUS;
// startUart2(); // get status of UART2 again. Should be open now
}
break;
}
return FALSE;
}
// Start by getting status of UART2
void startUart2(void)
{
// Get UART2 status first.
// If we try to open it when all ready open, then an error is returned.
// Similarly, if we try to close it when all ready closed, then an error is returned.
// So check status first and then act accordingly.
TRACE (( 1, “startUart2: get status UART2” ));
uart2Status = UART2_GETTING_STATUS;
adl_atCmdCreate( “AT+WMFM=0,2,2”, FALSE, ( adl_atRspHandler_t ) cmd_RspHandler_WMFM, “*”, NULL );
}
But I think that the voltage given by the UART should be at the same TTL level with the voltage given by the GPS in the serial connection. For example, UART2 gives 1.8 V, but the GPS I want to use gives minimum 2 V. So I suppose (I haven’t tried it yet because I want to be absolutely sure about it before burning something!!) that if I connect the RX2->TXgps and TX2->RXgps, then the UART won’t “feel” anything! Am I right? Please somebody can answer this?
Furthermore, in Wavecom’s datasheet it says that if somebody wants to use only the 2 wires from UART2, it is forbidden to use AT commands. My GPS gives only a RX and TX, nothing about RTS, CTS, so I was wondering whether it would be possible to connect and work properly with this serial connection in this way!
And in Target monitoring tool I get the following traces:
Trace IP 1 DataHandler
Trace IP 1 Datasize: 2
Trace IP 1
Trace IP 1 DataHandler
Trace IP 1 Datasize: 1
Trace IP 1
Trace IP 1 DataHandler
Trace IP 1 Datasize: 1
Trace IP 1
Trace IP 1 DataHandler
Trace IP 1 Datasize: 1
Trace IP 1
Trace IP 1 DataHandler
Trace IP 1 Datasize: 1
Trace IP 1
Trace IP 1 DataHandler
Trace IP 1 Datasize: 1
Trace IP 1
Trace IP 1 DataHandler
Trace IP 1 Datasize: 110
Trace IP 1
Which means that my module gets the gps blocks but there are empty or somehting… What is wrong with that? Please somebody help me!
MessageBox does the same as TRACE but it pumps a Windows box with the data. I used this in case the TRACE didn’t show correctly the data received…but with the same result!
What is DUMP? I didn’t know anything about it!
Do you mean (by saying raw bytes) that I can be able to see each bit or maybe byte voltage level?