What if there is no more memory when using adl_errHalt

When you use this function
adl_errHalt ( ADL_ERR_LEVEL_APP + 1, MyErrorString );
As described in the ADL manual, it says it logs the error in non-volatile memory where there is limited space.

However I cannot find anything about what it will do if the space is out. Will it start overwriting old backtraces? Will it crash? I want to know whether it is necessary for me to check and erase the backtraces.

All I need is to be able to manually check the last few backtraces at any given time.

Thanks all.

I think that’s not possible.

AFAIR, it is only possible to start from the first backtrace, then work through in sequence until you reach the last one. Then you can delete all backtraces.

So it payss to read & clear backtraces frequently - don’t let them pile up!

Thanks awneil.

I would be quite happy to read them all at once, but only the last 2 or 3 will actually be of interest to me. I mention this because I will not mind if the oldest backtraces are overwritten by newer ones. I am not intending to transmit or compile the backtraces anywhere else.

Is there a simple way I could read the number of backtraces currently in the log and then if they are too high, erase them? Or could I just keep using adl_errHalt and it will just keep working?

Also, if I want to read them to a terminal emulator, could I use this:

void MyAnalysisFunction ()
	// Start analysis
	s8 AnalysisHandle = adl_errStartBacktraceAnalysis();
	// Get state
	adl_errAnalysisState_e State = adl_errGetAnalysisState();
	// Retrieve next backtrace size
	u8 * Buffer = NULL;
	u32 Size = adl_errRetrieveNextBacktrace ( AnalysisHandle, Buffer, 0 );
	// Retrieve next backtrace buffer
	Buffer = adl_memGet ( Size );
	adl_errRetrieveNextBacktrace ( AnalysisHandle, Buffer, Size );
	// Erase all backtraces
	// Return backtrace buffer
	adl_atSendResponse(ADL_AT_UNS, "Backtrace:|%s|", Buffer);

If I build it into my application with a way to trigger it (for a diagnostic situation).

Obviously I have copied this from the “nominal use case of the ADL Error service” in the ADL User Guide (except rather than returning the buffer I am attempting to output it to the console - not sure if this way of referring to the Buffer is sensible though?). There seems to be something unexplained here though; does adl_errRetrieveNextBacktrace retrieve all the backtraces at once? If not why is there no loop? And if so how do you separate each backtrace entry?

All I really want is the easiest way to read the strings from the backtrace logs. Can this be done in M2M studio or something?


No - you just have to keep reading til there’s no more.

I think it must do.

No, it isn’t, I’m afraid - the backtrace is binary!

See: viewtopic.php?f=78&t=3118&p=13472&hilit=backtraces#p13472