Re: MC9S12XDP512 board
Posted: Sun Dec 02, 2012 12:33 pm
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:
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:
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:
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"