ARM Exception 1


#1

Hi.

Sorry for my bad English.
I have one problem.
When I download my application in Wavecom module Q24AU some time (20-60 min from start application) in TMT I recieve
9631.797 Trace HWL 1 Arm exception 1 14 a
9631.797 ADS Bckt -> Unresolved symbol : 0x000AA2BD
9631.797 ADS Bckt -> Unresolved symbol : 0x00054C63
9631.797 ADS Bckt -> Unresolved symbol : 0x0005394F
9631.797 ADS Bckt -> Unresolved symbol : 0x0009E632
9631.797 ADS Bckt -> Unresolved symbol : 0x000588E3
9631.797 ADS Bckt -> Unresolved symbol : 0x0001F355
9631.797 ADS Bckt -> Unresolved symbol : 0x0001F233
9631.797 ADS Bckt -> Unresolved symbol : 0x0005856F
9631.797 ADS Bckt -------> ADS BACK TRACE <-------

Arm Exception 1 mean that application attempt to write in protect area memory.

I test my code. I set TRACE at start and finish in all my function and this bug IS not in my functions.
I use Q24AU module.
I test my application on OS 657e, 657f, 657g, Open AT 3.19, Open AT 3.20, Open AT 3.21, WIP 3.10.1030, WIP 3.10.1032, WIP 3.10.1034.
Always i have the same bug.

I see this bug if I use WIP.
Can any body help me.


#2

If your going to make identical posts in multiple forums, always include links between them - otherwise you will waste peoples time if they answer in one forum, not knowing that the answer has already been given in the other!

See: viewtopic.php?f=3&t=3904&p=15264#p15264

Have you tried increasing your Stack size :question:

See: viewtopic.php?f=78&t=3562&p=13581&hilit=stack+size+wip#p13581
And: viewtopic.php?f=16&t=3655&p=14116&hilit=stack+size+wip#p14116
And: viewtopic.php?f=3&t=3244&p=12129&hilit=stack+size+wip#p12129


#3

I set stack size 4069
u32 wm_apmCustomStack [ 4096 ];

I test my application
when I only recv data my application work more then 1,5 hour whithout error
when I only send data I have error at 10-15 minute


#4

that sounds like you have a memory leak in your application. (propably someware within your send data code)
does your application wait for the ‘data-sent’ event before sending new data?
does your application check if it is able to send data or does it call wip_write regardless?


#5

I also have the same problem when I trying to connecting to non-existing server.
I set in wip_TCPClientCreate my IP and that Port on which not exist my server application.
From some time (10-20 minute) i have ARM Exception 1
This is my code.

#include "adl_global.h"
#include "wip.h"

_ext_ wip_bearer_t Bearer;
_ext_ wip_channel_t TCPChanel; 

void SimHandler(u8 Event);
bool CGATTHandler(adl_atResponse_t *Response);
void TCPwipHandler( wip_event_t *ev, void *context);
void TCPWIPTimerHandler(u8 ID);
void GPRSHandler(wip_bearer_t br,s8 event,void *context);

u32 wm_apmCustomStack [ 4096 ];
const u16 wm_apmCustomStackSize = sizeof ( wm_apmCustomStack );

void adl_main ( adl_InitType_e InitType )
{
	TRACE((1,"[ENTER] adl_main"));
	adl_simSubscribe(SimHandler,"0000");
	TRACE((1,"[EXIT] adl_main"));
	return;
}
void SimHandler(u8 Event)
{
	s8 sResult;

	TRACE((1,"[INFO] SimHandler"));
	if(Event == ADL_SIM_EVENT_FULL_INIT)
	{
		TRACE((1,"SimHandler = ADL_SIM_EVENT_FULL_INIT"));
		adl_atCmdCreate("AT+CGATT=1",TRUE,CGATTHandler,"*",NULL);
		TRACE (( 1, "adl_atCmdCreate = AT+CGATT=1" ));
		break;
	}
	TRACE((1,"[EXIT] SimHandler"));
	return;
}
bool CGATTHandler(adl_atResponse_t *Response)
{
	s8 sResult;

	TRACE((1,"[INFO] CGATTHandler"));
	if(Response->RspID != ADL_STR_OK)
	{
		adl_atCmdCreate("AT+CGATT=1",TRUE,CGATTHandler,"*",NULL);
		TRACE (( 1, "adl_atCmdCreate = AT+CGATT=1" ));
		TRACE((1,"[EXIT] CGATTHandler"));
		return FALSE;
	}
	sResult = wip_netInitOpts(WIP_NET_OPT_DEBUG_PORT,WIP_NET_DEBUG_PORT_TRACE,
		WIP_NET_OPT_SOCK_MAX,1,
		WIP_NET_OPT_BUF_MAX,4,
		WIP_NET_OPT_END);
	switch(sResult)
	{
	case 0:
		TRACE (( 1, "wip_netInit = SUCCESS" ));
		sResult = wip_bearerOpen(&Bearer,"GPRS",GPRSHandler,NULL);
		switch(sResult)
		{
		case 0:
			TRACE (( 1, "wip_bearerOpen = SUCCESS" ));
			sResult = wip_bearerSetOpts(Bearer,
				WIP_BOPT_GPRS_CID,1,
				WIP_BOPT_GPRS_DATACOMP,FALSE,
				WIP_BOPT_GPRS_HEADERCOMP,FALSE,
				WIP_BOPT_LOGIN,"apnus",
				WIP_BOPT_PASSWORD,"apnpassword",
				WIP_BOPT_GPRS_APN,"apn",
				WIP_BOPT_END);
			switch(sResult)
			{
			case 0:
				TRACE (( 1, "wip_bearerSetOpts = SUCCESS" ));
				sResult = wip_bearerStart(Bearer);
				switch(sResult)
				{
				case 0:
					TRACE (( 1, "wip_bearerStart = SUCCESS" ));
					break;
				case WIP_BERR_OK_INPROGRESS:
					TRACE (( 1, "wip_bearerStart = WIP_BERR_OK_INPROGRESS" ));
					break;
				case WIP_BERR_BAD_HDL:
					TRACE (( 1, "wip_bearerStart = WIP_BERR_BAD_HDL" ));
					break;
				case WIP_BERR_BAD_STATE:
					TRACE (( 1, "wip_bearerStart = WIP_BERR_BAD_STATE" ));
					break;
				case WIP_BERR_DEV:
					TRACE (( 1, "wip_bearerStart = WIP_BERR_DEV" ));
					break;
				default:
					TRACE (( 1, "wip_bearerStart = UNDEFINED %d",sResult ));
					break;
				}
				break;
			case WIP_BERR_BAD_HDL:
				TRACE (( 1, "wip_bearerSetOpts = WIP_BERR_BAD_HDL" ));
				break;
			case WIP_BERR_OPTION:
				TRACE (( 1, "wip_bearerSetOpts = WIP_BERR_OPTION" ));
				break;
			case WIP_BERR_PARAM:
				TRACE (( 1, "wip_bearerSetOpts = WIP_BERR_PARAM" ));
				break;
			default:
				TRACE (( 1, "wip_bearerSetOpts = UNDEFINED %d",sResult ));
				break;
			}

			break;
		case WIP_BERR_NO_DEV:
			TRACE (( 1, "wip_bearerOpen = WIP_BERR_NO_DEV" ));
			break;
		case WIP_BERR_ALREADY:
			TRACE (( 1, "wip_bearerOpen = WIP_BERR_ALREADY" ));
			break;
		case WIP_BERR_NO_IF:
			TRACE (( 1, "wip_bearerOpen = WIP_BERR_NO_IF" ));
			break;
		case WIP_BERR_NO_HDL:
			TRACE (( 1, "wip_bearerOpen = WIP_BERR_NO_HDL" ));
			break;
		default:
			TRACE (( 1, "wip_bearerOpen = UNDEFINED %d",sResult ));
			break;
		}
		break;
	case WIP_NET_ERR_PARAM:
		TRACE (( 1, "wip_netInit = WIP_NET_ERR_PARAM" ));
		break;
	case WIP_NET_ERR_NO_MEM:
		TRACE (( 1, "wip_netInit = WIP_NET_ERR_NO_MEM" ));
		break;
	default:
		TRACE (( 1, "wip_netInit = ERROR %d", sResult));
		break;
	}
	TRACE((1,"[EXIT] CGATTHandler"));
	return FALSE;
}
void GPRSHandler(wip_bearer_t br,s8 event,void *context)
{
	s8 sResult;
	TRACE((1,"[INFO] GPRSHandler"));
	switch(event)
	{
	case WIP_BEV_CONN_FAILED:
		TRACE (( 1, "GPRSHandler WIP_BEV_CONN_FAILED"));
		sResult = wip_bearerStart(Bearer);
		switch(sResult)
		{
		case 0:
			TRACE (( 1, "wip_bearerStart = SUCCESS" ));
			break;
		case WIP_BERR_OK_INPROGRESS:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_OK_INPROGRESS" ));
			break;
		case WIP_BERR_BAD_HDL:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_BAD_HDL" ));
			break;
		case WIP_BERR_BAD_STATE:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_BAD_STATE" ));
			break;
		case WIP_BERR_DEV:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_DEV" ));
			break;
		default:
			TRACE (( 1, "wip_bearerStart = UNDEFINED %d",sResult ));
			break;
		}

		break;
	case WIP_BEV_IP_CONNECTED:
		TRACE (( 1, "GPRSHandler WIP_BEV_IP_CONNECTED"));
		TCPChanel = wip_TCPClientCreate(
			"IP",
			Port,
			TCPwipHandler,
			NULL);
		if(TCPChanel == NULL)
		{
			TRACE((1,"wip_TCPClientCreateOpts = ERROR"));
		}
		else
		{
			TRACE((1,"wip_TCPClientCreateOpts = SUCCESS"));
		}
		break;
	case WIP_BEV_IP_DISCONNECTED:
		TRACE (( 1, "GPRSHandler WIP_BEV_IP_DISCONNECTED"));
		wip_close(TCPChanel);
		sResult = wip_bearerStart(Bearer);
		switch(sResult)
		{
		case 0:
			TRACE (( 1, "wip_bearerStart = SUCCESS" ));
			break;
		case WIP_BERR_OK_INPROGRESS:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_OK_INPROGRESS" ));
			break;
		case WIP_BERR_BAD_HDL:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_BAD_HDL" ));
			break;
		case WIP_BERR_BAD_STATE:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_BAD_STATE" ));
			wip_bearerStop(Bearer);
			break;
		case WIP_BERR_DEV:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_DEV" ));
			break;
		default:
			TRACE (( 1, "wip_bearerStart = UNDEFINED %d",sResult ));
			break;
		}
		break;
	case WIP_BEV_STOPPED:
		TRACE (( 1, "GPRSHandler WIP_BEV_STOPPED"));
		wip_bearerClose(Bearer);
		sResult = wip_bearerStart(Bearer);
		switch(sResult)
		{
		case 0:
			TRACE (( 1, "wip_bearerStart = SUCCESS" ));
			break;
		case WIP_BERR_OK_INPROGRESS:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_OK_INPROGRESS" ));
			break;
		case WIP_BERR_BAD_HDL:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_BAD_HDL" ));
			break;
		case WIP_BERR_BAD_STATE:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_BAD_STATE" ));
			wip_bearerStop(Bearer);
			break;
		case WIP_BERR_DEV:
			TRACE (( 1, "wip_bearerStart = WIP_BERR_DEV" ));
			break;
		default:
			TRACE (( 1, "wip_bearerStart = UNDEFINED %d",sResult ));
			break;
		}
		break;
	default:
		TRACE (( 1, "GPRSHandler = UNDEFINED %d",event));
		break;
	}
	TRACE((1,"[EXIT] GPRSHandler"));
	return;
}
void TCPwipHandler( wip_event_t *ev, void *context)
{
	u16                 i;
	s32 sResult;
	u32   a1,a2;

	switch(ev->kind)
	{
	case WIP_CEV_ERROR:
		TRACE (( 1, "TCPwipHandler WIP_CEV_ERROR = %d",ev->content.error.errnum));
		wip_close(TCPChanel);

		TCPChanel = wip_TCPClientCreate(
			"IP",
			Port,
			TCPwipHandler,
			NULL);
		if(TCPChanel == NULL)
		{
			TRACE((1,"wip_TCPClientCreateOpts = ERROR"));
		}
		else
		{
			TRACE((1,"wip_TCPClientCreateOpts = SUCCESS"));
		}
		break;
	case WIP_CEV_OPEN:
		TRACE (( 1, "TCPwipHandler WIP_CEV_OPEN"));
		break;
	case WIP_CEV_PEER_CLOSE:
		TRACE (( 1, "TCPwipHandler WIP_CEV_PEER_CLOSE"));
		wip_close(TCPChanel);
		TCPChanel = wip_TCPClientCreate(
			"IP",
			Port,
			TCPwipHandler,
			NULL);
		if(TCPChanel == NULL)
		{
			TRACE((1,"wip_TCPClientCreateOpts = ERROR"));
		}
		else
		{
			TRACE((1,"wip_TCPClientCreateOpts = SUCCESS"));
		}
		break;
	case WIP_CEV_READ:
		TRACE (( 1, "[SOCKET] WIP_CEV_READ = %d",ev->content.read.readable));
		break;
	case WIP_CEV_WRITE:
		TRACE (( 1, "[SOCKET] WIP_CEV_WRITE = %d",ev->content.write.writable));
		break;
	case WIP_CEV_DONE:
		TRACE (( 1, "[SOCKET] WIP_CEV_DONE = %d",ev->content.done.result));
		break;
	default:
		TRACE (( 1, "[SOCKET] UNDEFINED_CEV"));
		break;
	}
	return;
}