MC9S12XDP512 board

All home-built FreeEMS implementations without a forum of their own, usually TA-based.
User avatar
MrOnion
QFP80 - Contributor
Posts: 45
Joined: Tue Jul 06, 2010 1:03 pm
Location: Espoo, Finland

Re: MC9S12XDP512 board

Post by MrOnion »

I'll just hijack this thread to ask about the serial monitor ;)

I'm starting my microsquirt module -> freeems conversion and ordered the same board mentioned in the beginning of this thread:
http://elmicro.com/en/cards12.html

Fred:
You mentioned that one needs to hack the firmware to support the 4k SM. Are you referring to the TwinPEEKs SM mentioned on the elmicro page?
It seems that the S12X version is a blank MCU and will need the BDM to install a new SM anyway:

From elmicro page:
"TwinPEEKs is installed on every CardS12 at the time of delivery (*)"
"(*) Note: currently, there is no software included with the S12X module version!"

I also ordered this BDM to work with the MCU:
http://www.flashgenie.net/USBDM.php

So, where do I get the latest version of the freeems SM? And, do I need to compile it or is there a ready made S19? I have the freeems toolchain rocking and the firmware compiles nicely so no problems there...

The USBDM page mentions something about "standalone programmers"? Is anyone using these to program the bootloader (SM) part? Or is the free "Special Edition: CodeWarrior for HCS12(X) Microcontrollers (Classic)" the safest/easiest tool to use for this task? I'm trying to avoid all the codewarrior stuff and try to survive with opensource on linux...

I browsed through the release and in the bin directory I find HCS12_FlashProgrammer. I tried to start the HCS12_Flashprogrammer from the bin directory without installing, but it needs the usbdm library:

Code: Select all

$ ./HCS12_FlashProgrammer
./HCS12_FlashProgrammer: error while loading shared libraries: libusbdm.so: cannot open shared object file: No such file or directory

$ ldd ./HCS12_FlashProgrammer
libusbdm.so => not found
libusbdm-tcl.so => not found
libusbdm-dsc.so => not found
The install script needs the codewarrior (damn), so I made a striped down version of the install script to make this work without the cw stuff. It just copies the library files to ld path, makes symlinks, ldconfigs, adds usb rules file, copies devicedata and flashimages to /usr/local/share/usbdm. Now it starts ok , but I don't have the USB device yet, so time will tell if the install was successful...

The install script:

Code: Select all

#!/bin/bash

echo "Starting"

#====================================================
# Added properties directory
# Updated for Eclipse plugin
# Moved shared files to /usr/local/share/usbdm
#====================================================

#================================
# USBDM Version
#
MAJOR=4
MINOR=10

LIB_SUFFIX=.so.${MAJOR}.${MINOR}

#CP_OPTIONS="-v"
CP_OPTIONS=

USBDM_CONFIG_DIRECTORY=/usr/local/share/usbdm
USBDM_PROP_DIRECTORY=$HOME/.usbdm

PROMPT_L1="This script will install the USBDM V${MAJOR}.${MINOR} files."
PROMPT_L2="Please check the contents of this file before execution.  "
PROMPT_L3="This script needs to be run as root."
PROMPT_L4="use \'sudo ./Install_USBDM_Standalone\'"
PROMPT_L5="Continue (Y/N)?"

echo
echo
echo "########################################################"
echo
echo "${PROMPT_L1}"
echo
echo "${PROMPT_L2}"
echo
echo "${PROMPT_L3}"
echo "${PROMPT_L4}"
echo
echo "${PROMPT_L5}"
echo "${PROMPT_L6}"
echo
echo "########################################################"
echo
echo "${PROMPT_L7}"

read guess
if [ "$guess" != "Y" ]; then
    echo "Ok I won't do anything - bye"
    exit
fi

if [ -z "$SUDO_UID" ]; then
   echo "This script should be run sudo"
   exit 1
fi

if [ -z "$SUDO_GID" ]; then
   echo "This script should be run sudo"
   exit 1
fi

#echo SUDO_UID="$SUDO_UID" SUDO_GID="$SUDO_GID"

echo
echo "Copying rules file to /etc/udev/rules.d"
echo ==================================================================
cp $CP_OPTIONS bin/usbdm.rules /etc/udev/rules.d/usbdm.rules
chmod a+r      /etc/udev/rules.d/usbdm.rules

echo
echo "Installing USBDM shared libraries to /usr/local/lib"
echo ==================================================================
# Earlier install?
rm /usr/local/lib/libusbdm*

# Where to copy shared libs
DEST_LIBDIR=/usr/lib

rm ${DEST_LIBDIR}/libusbdm*

# Shared libs to copy
SHARED_LIBS="libusbdm-wx libusbdm libusbdm-debug libusbdm-dsc libusbdm-dsc-debug libusbdm-tcl libusbdm-tcl-debug"

# Copy & create symbolic links
for FILE in ${SHARED_LIBS}; do
   echo cp $CP_OPTIONS bin/${FILE}.so.${MAJOR}.${MINOR}    ${DEST_LIBDIR}
        cp $CP_OPTIONS bin/${FILE}.so.${MAJOR}.${MINOR}    ${DEST_LIBDIR}
   if [[ ! -e ${DEST_LIBDIR}/${FILE}.so.${MAJOR} ]]; then
      ln -s ${FILE}.so.${MAJOR}.${MINOR}    ${DEST_LIBDIR}/${FILE}.so.${MAJOR}
   fi
   if [[ ! -e ${DEST_LIBDIR}/${FILE}.so ]]; then
      ln -s ${FILE}.so.${MAJOR}.${MINOR}    ${DEST_LIBDIR}/${FILE}.so
   fi
done

#ldconfig -v -n /usr/local/lib 
ldconfig -X -v | grep usbdm

echo
echo "Installing USBDM Config files to ${USBDM_CONFIG_DIRECTORY}"
echo ==================================================================
echo
if [[ -e "${USBDM_CONFIG_DIRECTORY}" ]]; then
   echo Cleaning USBDM Config Directory - ${USBDM_CONFIG_DIRECTORY}
   rm -r -f "${USBDM_CONFIG_DIRECTORY}"/*
fi
if [[ ! -e "${USBDM_CONFIG_DIRECTORY}" ]]; then
   echo Creating USBDM Config Directory - ${USBDM_CONFIG_DIRECTORY}
   mkdir "${USBDM_CONFIG_DIRECTORY}"     
else   
   echo USBDM Properties Config already exists - ${USBDM_CONFIG_DIRECTORY}
fi

echo "Copying Device Flash Images"
echo =====================================================================
cp    -r  bin/DeviceData              "${USBDM_CONFIG_DIRECTORY}"

echo "Copying Device Flash Images"
echo =====================================================================
cp    -r  bin/FlashImages             "${USBDM_CONFIG_DIRECTORY}"
chown -R "$SUDO_UID":"$SUDO_GID"      "${USBDM_CONFIG_DIRECTORY}"
chmod -R a+r                          "${USBDM_CONFIG_DIRECTORY}"

echo
echo "Done"
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: MC9S12XDP512 board

Post by Fred »

MrOnion wrote:I'm starting my microsquirt module -> freeems conversion
Congratulations! ;-)
You mentioned that one needs to hack the firmware to support the 4k SM. Are you referring to the TwinPEEKs SM mentioned on the elmicro page?
Yes, I was.
It seems that the S12X version is a blank MCU and will need the BDM to install a new SM anyway:

From elmicro page:
"TwinPEEKs is installed on every CardS12 at the time of delivery (*)"
"(*) Note: currently, there is no software included with the S12X module version!"
Woops, I didn't spot that! Harry will be interested to hear about this! He had some issues, this could explain it! :-(
So, where do I get the latest version of the freeems SM?
One that will work is included in the firmware lib dir, but don't use it. Instead go here, for now: viewtopic.php?p=28948#p28948
And, do I need to compile it or is there a ready made S19?
The latter. I won't be supporting people with non-standard serial monitors in future. The majority won't be loading their own anyway, so no biggy.
I have the freeems toolchain rocking and the firmware compiles nicely so no problems there...
That's not even necessary! Check this out: http://builds.freeems.org/ similarly, Mike has his tuner available as a build too: http://mikesshop.net/EMStudio/
The USBDM page mentions something about "standalone programmers"? Is anyone using these to program the bootloader (SM) part?
Yes, pretty much everyone who's at the low-level hw hacking phase of their life.
The install script needs the codewarrior (damn), so I made a striped down version of the install script to make this work without the cw stuff. It just copies the library files to ld path, makes symlinks, ldconfigs, adds usb rules file, copies devicedata and flashimages to /usr/local/share/usbdm. Now it starts ok , but I don't have the USB device yet, so time will tell if the install was successful...
A minute late and a dollar short: viewtopic.php?f=9&t=1884 if your script looks like mine, it'll work fine. I have to run mine as root, though.
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!
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: MC9S12XDP512 board

Post by Fred »

PS, I was wondering how your post escaped the spammer filter: You signed up 2+ years ago! And from today's IP and the sign up IP, you've only moved ~500kms south since then too! :-)
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!
User avatar
MrOnion
QFP80 - Contributor
Posts: 45
Joined: Tue Jul 06, 2010 1:03 pm
Location: Espoo, Finland

Re: MC9S12XDP512 board

Post by MrOnion »

Thanks for the reply, It sure clears out things...

Yep, I signed up a while back but didn't have anything to share at that time ;). Spam filter? Do you need to post once a week and be constantly on the move (over 500km radius) so that your posts won't be ruled out as spam ;) Just kidding...

I could post my plan as a separate thread. I might need some insight on some HW choices...

FYI I'm also developing an android app for my tuning needs. My early demo now runs with MS2 as a dashboard with fixed gauges. I got it to work with my prolific usb serial dongle without rooting the device using the usb host mode (android 3.1+). Not a big fan of bluetooth ;).
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: MC9S12XDP512 board

Post by Fred »

Re spammers: viewtopic.php?f=17&t=1311 :-)
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!
User avatar
MrOnion
QFP80 - Contributor
Posts: 45
Joined: Tue Jul 06, 2010 1:03 pm
Location: Espoo, Finland

Re: MC9S12XDP512 board

Post by MrOnion »

I'll just put this blog url here if someone stumbles across this topic...

http://roller.baboonplanet.com/garage/e ... irmware_on

Just a walkthough based on the CardS12X board.
User avatar
Flow
TO92 - Vaguely active
Posts: 3
Joined: Tue Feb 19, 2013 9:27 pm
Location: Netherlands

Re: MC9S12XDP512 board

Post by Flow »

MrOnion,

Nice and helpful for getting started. And thanks for the tip for the BDM programmer, I almost bought the one from elmicro which is around 200 euro's!
One minor thing (I know your website is obviously under construction) it would be nice if you could click on your images to enlarge them.
User avatar
johu
QFP80 - Contributor
Posts: 57
Joined: Sat Aug 16, 2008 4:39 pm
Location: Se oli ainakin näiiiiiin iso!

Re: MC9S12XDP512 board

Post by johu »

To get TBDM gixxer-harry had problems with working follow instructions on this thread: viewtopic.php?f=9&t=2141

Pin-out and schematics for Wayengineer MC9S12XDP512 board can now be downloaded from Wayengineer page. I also put up mirror of it online and attached relevant part to this post. It's all in chinese but schematics and pinouts are readable.
Attachments
XDP512核心板原理图.pdf
pinouts and schematics for Wayengineer MC9S12XDP512-core
(84.72 KiB) Downloaded 1061 times
User avatar
Matthijs
LQFP112 - Up with the play
Posts: 113
Joined: Fri Aug 16, 2013 9:40 am

Re: MC9S12XDP512 board

Post by Matthijs »

Hm, today I laid my hand upon a http://elmicro.com/en/cards12.html with a MC9S12xdp512CAL and the PE USB BDM. I will read the previous posts first before asking (some) questions but it seems to be fate that I found this board at work within a week of registering here ;)
Last edited by Matthijs on Wed Aug 21, 2013 2:38 pm, edited 1 time in total.
User avatar
Fred
Moderator
Posts: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: MC9S12XDP512 board

Post by Fred »

faith > fate? :-)
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!
Post Reply