Using Flash Memory

Hey Everyone, :smiley:

I was trying to do the example in the Application Note about the Flash Memory.

Well, it is not working for me. When I try to write in the flash memory, I receive the error: :open_mouth:

Anyone ???
Tks for all,

Gus

I am using Q2501-v6.51 Open AT 3.02

void adl_main ( adl_InitType_e InitType )
{

	s8 sreturnCode;

	static const ascii * Handle="WAVECOM";

	u16 length;

	#define ObjectID 1

	s8 report;

	char word[80];

	char Space[100];

	char msg[20];

    TRACE (( 1, "Embedded Application : Main" ));

	adl_flhSubscribe(Handle,1);
 
	if((length=adl_flhExist(Handle,ObjectID))>0){

		sreturnCode = adl_flhWrite(Handle,ObjectID,1,&word);

		switch (sreturnCode){
		case OK:
			adl_atSendResponse ( ADL_AT_UNS, "Ok");
			break;
		case ADL_RET_ERR_PARAM:
				adl_atSendResponse ( ADL_AT_UNS, "ADL_RET_ERR_PARAM");
			break;
		case ADL_RET_ERR_UNKNOWN_HDL:
				adl_atSendResponse ( ADL_AT_UNS, "ADL_RET_ERR_UNKNOWN_HDL");
			break;
		case ADL_FLH_RET_ERR_ID_OUT_OF_RANGE:
				adl_atSendResponse ( ADL_AT_UNS, "ADL_FLH_RET_ERR_ID_OUT_OF_RANGE");
			break;
		case ADL_FLH_RET_ERR_OBJ_NOT_EXIST:
				adl_atSendResponse ( ADL_AT_UNS, "ADL_FLH_RET_ERR_OBJ_NOT_EXIST");
			break;
		case ADL_RET_ERR_FATAL:
				adl_atSendResponse ( ADL_AT_UNS, "ADL_RET_ERR_FATAL");
			break;
		default:
				adl_atSendResponse ( ADL_AT_UNS, "Ops");
			break;
		}

		adl_flhRead(Handle,ObjectID,1,&report);

		wm_sprintf(Space,"Flash contents: %s\r\n",&report);

		adl_atSendResponse(ADL_AT_UNS,Space);

		adl_flhErase(Handle,ObjectID);
	}

Hello,

You have subsribed with adl_flhSubscribe(Handle,1) for one flash object ID to this handle, so the only ID you can use is 0.

You can try this:

#define ObjectID 0

or you can change the ID’s number after AT+WOPEN=3.

Regards,

tom