Unformatted text preview:

Using the Gnu HC12 Development Tools on the Adapt9S12DP256 BoardIncluding support for uCOS-II V252PrerequisitesBackground: The 9S12DP256 CPURunning EmbeddedGnu (EG) and downloading programsUsing the Gnu HC12 Development Tools on the Adapt9S12DP256 BoardIncluding support for uCOS-II V252PrerequisitesThe following software packages are needed:From: TA or http://www.ericengler.com/EmbeddedGNU.aspx What: Embedded Gnu EnvironmentVersion: egnu093.zip (or later)Unzip it into an empty folder. Example: C:\Tools\uC\EGnu\From: TA or http://www.gnu-m68hc11.org/ What: Gnu Compilers and Tools for HC11/12Version: gnu-68hc1x-3.1.exe (or later)This should be installed by running the executable. The compilers and tools are all command line tools, the EmbeddedGnu environment is an IDE (like Visual Studio). Install it into an empty folder. Example: C:\Tools\uC\gccFrom: TA or www.freescale.com (Motorola site)What: Dbug-12 Monitor - Binary code and documentation.Version: DB12S12FW.zip This ZIP file contains the documentation and the firmware Dbug-12, the monitor program. It should be unzipped into a folder. Example: C:\Tools\uC\DBS12FWFrom: TAWhat: uCOS SourcesVersion: uCOSV252.zipThis ZIP file contains the main sources for the uCOS operating system. It must be unzipped into the root folder, e.g. C:\. From: TAWhat : uCOS Sources for WIN32 platform, with test programs.Version: uCOS-II_WIN32_1_3.zipThis ZIP file contains the additional sources needed for the WIN32 platform and test programs. Must be unzipped under the following folder of the uCOS installation: \software\uCOS-II\PortsFrom: TAWhat: Simple test program that prints out a message on the serial port.Version: tp.zipThis ZIP file contains a simple HelloWorld program. Should be unzipped into an arbitraryfolder. Note: this does not use the uCOS. It uses the “RAM” profile (see below).From: TAWhat: A multi-tasking test program that uses uCOS-II.Version: 9S12DP256.zipThe ZIP file contains the 9S12DP56-specific files for uCOS-II and a simple multi-taskingprogram. The uCOS and user app is compiled into a single executable, no paged memory is used. Must be unzipped under the following folder of the uCOS installation: \software\uCOS-II\Ports. It uses the “Flash” profile (see below). From: TAWhat: A multi-tasking test program that uses uCOS-II using paged memory.Version: 9S12DP256PG.zipThe ZIP file contains the 9S12DP56-specific files for uCOS-II and a simple multi-taskingprogram. The uCOS and user app are distributed into two pages of the paged memory. Must be unzipped under the following folder of the uCOS installation: \software\uCOS-II\Ports. It use the “Flash” profile (see below). After unzipping follow the instructions in the readme.txt file.From: TAWhat: EmbeddedGnu profile files for the Adapt9S12DP256 board.Version: Adapt9S12DP256-RAM.mem (for building RAM-based code)Adapt9S12DP256-Flash.mem (for building Flash-based code)These files must be placed in the “profiles” folder of the EmbeddedGnu package installation. Example: C:\Tools\uC\EGnu\profiles\CustomizationThe EmbeddedGNU environment needs to be customized when run the first time. This involves:- Setting the serial (COM) port for communicating with the microcontroller board. Simply select the COM port on “Environment options/COM Port”.- Setting the directory for the compiler on “Environment options/Directories/gcc bin directory:” Example: C:\Tools\uC\gcc\bin- Adding the uCOS source folder to the search path on “Environment options/Directories/”Add the directory below...”. Check the box and set the name. Example: \SOFTWARE\uCOS-II\SOURCE- Disable automatic downloads, and allow showing file selection before download. On “Environment options/Autodownload” check the appropriate boxes. The profile files mentioned above (Adapt9S12DP256-RAM.mem and Adapt9S12DP256-Flash.mem) also needs to be customized. To do this:(1) Start up EmbeddedGnu and open a project file. Example: open D:\SOFTWARE\uCOS-II\Ports\9S12DP256\GCC\source\TS-UCOS.prj. (2) Open “Options/Project options”, and ensure that (2a) the profile selected is Adapt9S12DP256-Flash. (2b) the compiler switches are: -Os -fno-ident -fno-common -fomit-frame-pointer -mshort -fsigned-char -fno-builtin(3) Select “Edit Profile” on the page.(4) Ensure that the “Linker search directory” field looks like: C:\Tools\uC\gcc\lib\gcc-lib\m6811-elf\3.3.6-m68hc1x-20060122\mshortNote: the above line is valid for the “gnu-68hc1x-3.1” version for the gcc tools, it may bedifferent for a different version. The “3.3.6-m68hc1x-20060122” portion seems to changewith gcc. (5) Exit from the configuration panels by clicking OK (Cancel will discard changes). Now the project should compile without problems. The 9S12DP256PG (paged version of the uCOS port to the 9S12 processor) has its own instructions in the readme file, please read and follow those. Background: The 9S12DP256 CPUThis CPU is an advanced 16-bit processor, with a large number of I/O ports and devices, and 12K of on-chip RAM and 256k of on-chip Flash memory. The flash memory is non-volatile (i.e. it keeps its content even if the power is turned off). We will use the on-chip debugger/monitor: Dbug-12 that resides in the Flash memory. Another program (also resident in the flash), called the Boot Loader (BL) will be used to program the other segments of the flash memory, except the segment that contains the BLitself. The 12K RAM is located at $1000, and you can use it up to $3C00 (addresses above that are used by the Dbug-12 monitor program). We will use this RAM space for small programs (that fit) and/or all data segments of the code (variables, and stack, with initial SP pointing to $3C00). The Flash memory is a “paged” memory: its pages are mapped into 16kbyte big windowson the processor’s address space. This is done via a page register (PPAGE), and PPAGE register determines which 16K page of the 256K total is mapped into the window from $8000-BFFF. The Dbug-12 monitor uses the PPAGE value = $38. We will use the PPAGE value=$30, and the window $8000-BFFF will be used for large programs (that include uCOS-II, for example). Note that Dbug-12 also uses $4000-7FFF, and the BL uses $C000-FFFF.The Dbug-12 monitor has a IT vector table in RAM (starting at $3E00) - when using uCOS-II, the entries for TOC7 (at $3E60) and for SWI ($3E76) are set to point to the uCOS-II IT handlers. Running EmbeddedGnu (EG) and downloading programsWhen you start EG for


View Full Document

VANDERBILT EECE 276 - Study Notes

Download Study Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Study Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Study Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?