View unanswered posts | View active topics It is currently Fri Oct 20, 2017 10:26 pm



Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
USBDM On Linux Does NOT Require CW 
Author Message
QFP80 - Contributor
User avatar

Joined: Tue Jul 06, 2010 1:03 pm
Posts: 45
Location: Espoo, Finland
Installed the USBDM without CW, but using my own quick hack script (viewtopic.php?p=30882#p30882). Didn't know at the time Fred had already did this ;). There is a small difference though. I used the 4.10.3 version and there is no "Utilities" folder anymore, but instead it is "bin" now. Also "Device_data" is "DeviceData" and along with FlashImages they are now installed into /usr/local/share/usbdm instead of ~/.usbdm.

Got my BDM this week and I'm trying it out today. Tested USBDMs HCS12_FlashProgrammer first on winxp (32bit) and seems to work ok. On ubuntu (12.10 32bit) there is a problem. After the install with this "no cw" script the program starts, but gives an error:

Code:
* Error loading devices
Failed to load device database
Reason: DeviceXmlParser::parseSecurity() - illegal size in securityInfo = 16
Current device = Shared data


It does not stop the application, but only affects the device database. The application detects my USB device correctly (in sudo), but the device pulldownmenu says "invalid database". So, the devicedata is either corrupt or there is a problem with the XML parser...

The DeviceData folder and files are ok. Used both binary and source dist ones and they are ok. No difference between them. Compiled a new programmer from source, but still the same problem. Checked the parseSecurity method and hardcoded the value to 16 to test things out. Worked, but now gives a similar error concerning check address or some shit...

Turns out the string value from xml to unsigned long conversion in causing this. Looked into the parser code and there are two strToULong methods separated by a preprocessor #if 0. Switched to the other one and it's way too broken to use...

What the method does is only the conversion:
Code:
unsigned long value_t = strtoul(start, &end_t, 0);


This works as expected but the method is returning false because of errno.h. strtoul will turn errno into ERANGE if the value is out of range. In this case this does not happen, but someone is turning the errno != 0. There is a ERANGE check anyway after the conversion:
Code:
if ((ULONG_MAX == value_t) && ERANGE == errno) { // too large
  printf("strToULong() - Number too large\n");
  return false;
}


Usually you reset the errno to zero before your call and this is done here, but it is commented out for some reason? If I release the comment on:
Code:
// errno = 0;


It works. Everything is ok now. Devicedata is parsed ok, etc... Just wondering if anyone else if experiencing this? Why is this left in this kind of condition without people noticing? Weird... or is it just me?


Sun Dec 09, 2012 10:50 am
Profile
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14824
Location: Home sweet home!
Awesome debugging effort! :-) I might have just tried the older version given that others had and had had it work ;-)

Cool that you're up and running and thanks for sharing your headaches here for others to learn from. Perhaps point the author at this?

It'd be good if there was a bloatware-free install script available out of the box. It'd be straight forward for them to prompt you with a "got cw?" and proceed accordingly, or even just detect, not fail and install without it if not present and then warn the user.

Fred.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Sun Dec 09, 2012 1:44 pm
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14824
Location: Home sweet home!
FYI, our Australian genius thinks it's a good idea to withdraw releases! WTF. He also thinks it's a good idea to force window size to be fixed, and then make it not big enough to actually use! Furthermore, it won't work on my debian mac mini at all, only on my eee. Thus to actually use my BDM I have to plug my monitor into my EEE. JESUS. Free software... where's the warranty? :-)

Because of the release withdraws, I'm caching old ones for you, check SF first, though, please...

http://stuff.fredcooke.com/USBDM_Linux_V4.9.tar.gz < 4.9.3 i think?
http://stuff.fredcooke.com/USBDM_Linux_V4.9.4b.tar.gz < works on EEE WITH a monitor plugged in...
http://stuff.fredcooke.com/USBDM_Linux_V4.10.3.tar.gz < unknown, beware...
http://stuff.fredcooke.com/USBDM_Linux_V4.10.4.tar.gz < johntramp is trying this one nowish?

sourceforge.net/projects/usbdm/files above links not clickable, on purpose...

Fred.

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Thu May 23, 2013 8:28 pm
Profile WWW
LQFP144 - On Top Of The Game
User avatar

Joined: Thu Feb 25, 2010 3:57 am
Posts: 563
Location: Gosport, IN USA
For those of you who have USBDM 4.9.3 or 4.9.4 and are unable to program the serial monitor due to the "Detect Chip" function not identifying your newer Freescale processor, here is the fix:

The older Freescale XDP512 processors have a "chip ID" of of "C410" or "C411"
but the newer processors have a "chip ID" of "C412" so the HCS12_FlashProgrammer doesn't know how to access the memory on the processor.

To correct this problem you will need to edit 2 files in the .usbdm/Device_data folder which can be found in your home folder. These two files list all the chip IDs and what processor they belong to so that the USBDM programmer knows how to access all of the memory locations.

These 2 files are:
.usbdm/Device_data/hcs12_devices.xml
.usbdm/Device_data/hcs12_devicesX.xml

Open each one with your favorite text editor and search for "XDP" then scroll down until you see:

<sdid value="0xC410" />
<sdid value="0xC411" />


then add a new line below the "0xC411" line that reads:

<sdid value="0xC412" />

so it should now look like this:

<sdid value="0xC410" />
<sdid value="0xC411" />
<sdid value="0xC412" />


then save the file and exit your text editor.

Make this change to the second file and save your change.

Now you are able to program the newer S912XDP512 (112 pin and 144 pin version) processors directly from Linux, still not having to use CW.

Enjoy :-)

_________________
Andy.
FreeEMS vehicle #11, 1932 Ford 5 Window Coupe with a 1996 GM 3.1L SFI V6 with DIS ignition
FreeEMS vehicle #16, 1996 Chevrolet S10 2.2L SFI I4 with DIS ignition
http://www.coolefi.com


Tue Nov 12, 2013 12:00 am
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14824
Location: Home sweet home!
Thanks Andy!

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Tue Nov 12, 2013 12:15 am
Profile WWW
LQFP112 - Up with the play

Joined: Wed Aug 28, 2013 6:07 am
Posts: 146
"...Fuck codewarrior, may its 2.7gig download of nasty encrypted binary installer crap rot in hell :-)..."

Tell us how you really feel... :lol2:

still putting around with the assembly. MAX chip was backordered and the MOSFETS called out are now under a different RoHS part number so its a little tedious tracking them down. Ill still dedicate a laptop to Linux so I can follow your command line references.


Sat Dec 28, 2013 11:45 pm
Profile
LQFP144 - On Top Of The Game
User avatar

Joined: Thu Feb 25, 2010 3:57 am
Posts: 563
Location: Gosport, IN USA
For those of you who have USBDM 4.9.3 or 4.9.4 for Windows and are unable to program the serial monitor due to the "Detect Chip" function not identifying your newer Freescale processor, here is the fix:

The older Freescale XDP512 processors have a "chip ID" of of "C410" or "C411"
but the newer processors have a "chip ID" of "C412" so the HCS12 Programmer doesn't know how to access the memory on the processor.

To correct this problem you will need to edit 2 files:

For 32bit Windows:
The files are in the C:/Program Files/pgo/USBDM 4.9.3/Device_data folder. These two files list all the chip IDs and what processor they belong to so that the USBDM programmer knows how to access all of the memory locations.

These 2 files are:
  • C:/Program Files/pgo/USBDM 4.9.3/Device_data/hcs12_devices.xml
  • C:/Program Files/pgo/USBDM 4.9.3/Device_data/hcs12_devicesX.xml

For 64bit Windows:
The files are in the C:/Program Files (x86)/pgo/USBDM 4.9.3/Device_data folder. These two files list all the chip IDs and what processor they belong to so that the USBDM programmer knows how to access all of the memory locations.

These 2 files are:
  • C:/Program Files (x86)/pgo/USBDM 4.9.3/Device_data/hcs12_devices.xml
  • C:/Program Files (x86)/pgo/USBDM 4.9.3/Device_data/hcs12_devicesX.xml

Open each one with your favorite text editor and search for "XDP" then scroll down until you see:

<sdid value="0xC410" />
<sdid value="0xC411" />


then add a new line below the "0xC411" line that reads:

<sdid value="0xC412" />

so it should now look like this:

<sdid value="0xC410" />
<sdid value="0xC411" />
<sdid value="0xC412" />


then save the file and exit your text editor.

Make this change to the second file and save your change.

Now you are able to program the newer S912XDP512 (112 pin and 144 pin version) processors directly from 32bit and 64bit Windows, still not having to use CW.

Enjoy 8-)

_________________
Andy.
FreeEMS vehicle #11, 1932 Ford 5 Window Coupe with a 1996 GM 3.1L SFI V6 with DIS ignition
FreeEMS vehicle #16, 1996 Chevrolet S10 2.2L SFI I4 with DIS ignition
http://www.coolefi.com


Thu Aug 14, 2014 8:50 pm
Profile WWW
Moderator
User avatar

Joined: Tue Jan 15, 2008 2:31 pm
Posts: 14824
Location: Home sweet home!
Latest debs still have these issues FWIW. Not able to get mine to talk, but not confident it's plugged in correctly, either. Did manage to use the new tool to upgrade firmware.

Writing the above made me realise something, so I typed --help and then read through and you need to run it like this: UsbdmFlashProgrammer -target:HCS12

_________________
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!


Sun Oct 23, 2016 2:28 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 18 posts ]  Go to page Previous  1, 2

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software for PTF. ColorizeIt.