View Single Post
Posts: 2,225 | Thanked: 3,822 times | Joined on Jun 2010 @ Florida
#20
Originally Posted by reinob View Post
Well, I tried with ltrace and strace but got no useful info. Program is being killed by SISSEGV (Segmentation fault).

I don't know if the source code for the libcal are available. I might have a look at it some day..

Cheers.
Nope, libcal is closed. There was someone on this board who claimed they managed to reverse engineer all of the read functionality of it in an open source variant a long while back, though I don't know where the source for that is.

I suspect the segmentation fault is my own fault, perhaps the program isn't handling it correctly. But the error message you get before the segfault is indicative of what's happening (as I understand it it means the R&D Mode area for CAL isn't set up correctly at all yet on the devices where this happens, though I am not sure what that entails from a technical perspective). If you look at my source code posted in the first post, that error shows up at this moment in the code:
Code:
if (cal_read_block (cal_s, "r&d_mode", &tmp, &len, CAL_FLAG_USER) < 0)
	{
		cal_finish (cal_s);
		printf ("Failed to read R&D Mode area from CAL.\n");
		return 2;
	}
My C knowledge was and is just barely enough to write my program based on qwerty12's, so I'm not 100% sure what could cause the segmentation fault, unless there's something wrong with my "return 2" statement.
 

The Following 2 Users Say Thank You to Mentalist Traceur For This Useful Post: