User Tools

Site Tools


manual:demos:devkit_s12g128_codewarrior

NXP DevKit S12G128 Codewarrior

Supported firmware update interfaces

RS232 CAN USB TCP/IP SD-card Modbus RTU
No Yes No No No No

Development Environment

This demo is targeted towards the NXP DevKit S12G128 board, with 128 kB internal Flash EEPROM and 8 kB internal RAM.

To program the bootloader into the internal flash on the S12G128 microcontroller, the P&E Micro USB BDM Multilink interface was used. However, this is not required if you have another means of programming the internal flash.

To compile the demo programs you can use the Codewarrior Development Studio for HCS12(X) development environment.

Building and programming the Bootloader

Before the bootloader can be used, it needs to be built and programmed into the S12G128's internal flash memory. The steps in this section only need to be done once.

When using Freescale Codewarrior, simply open the project from within Codewarrior and select Project→Make from the menu. The project file is located at: \Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\ide\

In case of build errors, refer to the information in section resolving build errors.

The bootloader program is now ready to be programmed into the internal flash memory of the S12G128. Using your favorite programmer, flash the bootloader using one of the following files, depending on what file type your programmer supports:

  • \Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\bin\openblt_s12g128.abs
  • \Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\bin\openblt_s12g128.abs.sx

Building the Demo Program

When using Freescale Codewarrior, simply open the project from within Codewarrior and select Project→Make from the menu. The project file is located at: \Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Prog\ide\

The output file is

  • \Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Prog\bin\demoprog_s12g128.abs.sx

Firmware update procedure

To download the demo program \Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Prog\bin\demoprog_s12g128.abs.sx using the bootloader, follow the instructions in the following links, depending on the communication interface you intend to use:

Resolving Build Errors

When building the demo binaries for the first time, build errors might occur caused by CodeWarrior projects not correctly dealing with relative directories and having source-files in a project that have the same name as source-files in the library path. These errors are quickly resolved by removing the file from the project and adding them again.

Here is a list of encountered build errors and the solution of resolving the error:

  • Could not open object file '.Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\ide\s12g128_Data\Standard\ObjectCode\datapage.c.o'
    • Delete the datapage.c file from the Boot\lib folder in the project and add it again. The source file is located at \Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\lib
  • Could not open object file '.Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\ide\s12g128_Data\Standard\ObjectCode\mc9s12g128.c.o'
    • Delete the mc9s12g128.c file from the Boot\lib folder in the project and add it again. The source file is located at \Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\lib
  • Cannot open .\Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\ide\s12g128_Data\Standard\ObjectCode\cstartup.c.o
    • Delete the cstartup.c file from the Source\HCS12\CodeWarrior folder in the project and add it again. The source file is located at \Target\Source\HCS12\CodeWarrior
  • Link error: Symbol AssertFailure in file .Target\Demo\HCS12_DevKit_S12G128_CodeWarrior\Boot\ide\s12g128_Data\Standard\ObjectCode\main.c.o
    • Delete the assert.c file from the Source folder in the project and add it again. The source file is located at \Target\Source
manual/demos/devkit_s12g128_codewarrior.txt · Last modified: 2023/12/04 22:39 by voorburg