Table of Contents
Author: Jan Kobler, Kobler Systems GmbH, email: eng1@koblersystems.de
This work (only this document) by Kobler Systems GmbH is licensed under the MIT License. To view a copy of this license, visit http://opensource.org/licenses/MIT.
The license of the software is mentioned further below, in the corresponding source code files or in other accompanying files.
This is a simple BSP for the board Phytec phyCORE-MPC5676R for the development environment CodeWarrior for Microcontrollers v10.6.
It is based on a CodeWarrior Project for the CPU MPC5676R which has the following features:
There are two build targets: RAM, FLASH
RAM target runs in internal SRAM.
Download the binary image of the RAM build target through the JTAG port to the hardware target.
FLASH target runs in internal flash and uses internal SRAM.
The binary image of the FLASH build target can be written through JTAG port into the internal flash on the hardware target.
FLASH target can boot the board standalone.
Second core of the CPU MPC5676R is also started.
Only the BookE instruction set is used.
Here PE Micro Nexus Multilink has been used for connecting to the JTAG port of the board.
The CodeWarrior project has been enhanced by following features, which are specific to the Phytec phyCORE-MPC5676R board:
Configuration of the chip selects of external SRAM, external flash, FPGA and LAN device.
FMPLL is set to 180MHz
Cache is enabled.
Configuration and usage of one serial port.
Configuration and usage of the time base register in order to compute timeouts.
Configuration and usage of the LEDs.
LED D1 and D2 are toggled by CPU core 0.
LED D3 is toggled by CPU core 1.
The following files have been created and written by Jan Kobler, Kobler System GmbH and are distributed under the MIT License. The MIT License can be found at the head of these files or at http://opensource.org/licenses/MIT.
Readme.html doc/board/5676_phyCORE/hello-led-01/Readme_5676_phyCORE_hello-led-01.html src/board/5676_phyCORE/hello-led-01/Project_Headers/board_dev_esci.h src/board/5676_phyCORE/hello-led-01/Project_Headers/board_dev_led.h src/board/5676_phyCORE/hello-led-01/Project_Headers/cpu_init_cache.h src/board/5676_phyCORE/hello-led-01/Project_Headers/cpu_init_timer.h src/board/5676_phyCORE/hello-led-01/Project_Headers/test_01.h src/board/5676_phyCORE/hello-led-01/Project_Headers/test_led_01.h src/board/5676_phyCORE/hello-led-01/Project_Headers/test_prefix.h src/board/5676_phyCORE/hello-led-01/Project_Headers/test_uart_01.h src/board/5676_phyCORE/hello-led-01/Project_Headers/timeout_01.h src/board/5676_phyCORE/hello-led-01/Sources/5676_phyCORE_dev_esci.S src/board/5676_phyCORE/hello-led-01/Sources/5676_phyCORE_dev_led.S src/board/5676_phyCORE/hello-led-01/Sources/5676_phyCORE_init_fmpll.S src/board/5676_phyCORE/hello-led-01/Sources/Memory_Layout.txt src/board/5676_phyCORE/hello-led-01/Sources/mpc5676_init_cache.S src/board/5676_phyCORE/hello-led-01/Sources/mpc5676_init_timer.S src/board/5676_phyCORE/hello-led-01/Sources/Readme_Version.txt src/board/5676_phyCORE/hello-led-01/Sources/test_01.c src/board/5676_phyCORE/hello-led-01/Sources/test_led_01.c src/board/5676_phyCORE/hello-led-01/Sources/test_uart_01.c src/board/5676_phyCORE/hello-led-01/Sources/timeout_01.c
The following files have been created by the CodeWarrior Project Manager. Please read the license of CodeWarrior. Some files have been changed by Jan Kobler, Kobler System GmbH in order to support the board Phytec phyCORE-MPC5676R.
src/board/5676_phyCORE/hello-led-01/.cproject src/board/5676_phyCORE/hello-led-01/.project src/board/5676_phyCORE/hello-led-01/.settings/com.freescale.core.ide.cdt.toolchain.prefs src/board/5676_phyCORE/hello-led-01/.settings/com.freescale.core.ide.newprojectwizard.prefs src/board/5676_phyCORE/hello-led-01/MPC5676R_readme.txt src/board/5676_phyCORE/hello-led-01/PRC0_Sources/Exceptions.c src/board/5676_phyCORE/hello-led-01/PRC0_Sources/IntcInterrupts_p0.c src/board/5676_phyCORE/hello-led-01/PRC0_Sources/ivor_branch_table_p0.c src/board/5676_phyCORE/hello-led-01/PRC1_Sources/Exceptions_p1.c src/board/5676_phyCORE/hello-led-01/PRC1_Sources/IntcInterrupts_p1.c src/board/5676_phyCORE/hello-led-01/PRC1_Sources/ivor_branch_table_p1.c src/board/5676_phyCORE/hello-led-01/PRC1_Sources/main_p1.c src/board/5676_phyCORE/hello-led-01/PRC1_Sources/__start_p1.c src/board/5676_phyCORE/hello-led-01/Prefix/MPC5676R_RAM_BOOKE_MC.prefix src/board/5676_phyCORE/hello-led-01/Prefix/MPC5676R_FLASH_BOOKE_MC.prefix src/board/5676_phyCORE/hello-led-01/Project_Headers/Exceptions.h src/board/5676_phyCORE/hello-led-01/Project_Headers/Exceptions_p1.h src/board/5676_phyCORE/hello-led-01/Project_Headers/IntcInterrupts.h src/board/5676_phyCORE/hello-led-01/Project_Headers/IntcInterrupts_p1.h src/board/5676_phyCORE/hello-led-01/Project_Headers/MPC5676R.h src/board/5676_phyCORE/hello-led-01/Project_Headers/MPC5676R_HWInit.h src/board/5676_phyCORE/hello-led-01/Project_Headers/typedefs.h src/board/5676_phyCORE/hello-led-01/Project_Settings/Debugger/hello-led-01_RAM_PnE USB-ML-PPCNEXUS.launch src/board/5676_phyCORE/hello-led-01/Project_Settings/Debugger/hello-led-01_FLASH_PnE USB-ML-PPCNEXUS.launch src/board/5676_phyCORE/hello-led-01/Project_Settings/Debugger/MPC5676R_RAM_BOOKE.tcl src/board/5676_phyCORE/hello-led-01/Project_Settings/Debugger/MPC5676R_FLASH_BOOKE.tcl src/board/5676_phyCORE/hello-led-01/Project_Settings/Debugger/MPC5676R.mem src/board/5676_phyCORE/hello-led-01/Project_Settings/Linker_Files/MPC5676R_FLASH.lcf src/board/5676_phyCORE/hello-led-01/Project_Settings/Linker_Files/MPC5676R_RAM.lcf src/board/5676_phyCORE/hello-led-01/Project_Settings/Startup_Code/MPC5676R_HWInit.c src/board/5676_phyCORE/hello-led-01/Project_Settings/Startup_Code/MPC5676R_init_flash.c src/board/5676_phyCORE/hello-led-01/Project_Settings/Startup_Code/MPC5676R_init_ram.c src/board/5676_phyCORE/hello-led-01/Project_Settings/Startup_Code/MPC5676R_Startup.c src/board/5676_phyCORE/hello-led-01/Project_Settings/Startup_Code/__ppc_eabi_init.c src/board/5676_phyCORE/hello-led-01/Sources/main.c
You must find and read the latest CodeWarrior license files yourself.
My current understanding, which is solely for your info, is:
These files are covered by the Freescale Software License Agreement Freescale_Software_EULA.pdf. This license agreement is part of CodeWarrior MCU 10.6 and can be found in the folder MCU/License in your installation folder of CodeWarrior.
Because of the Limited Distribution Rights these files may NOT be distributed in SOURCE form!
Because sometimes you have to enter commands on the command line, you will need a user friendly console application. I suggest to install: ConEmu. Usally this installer should be the right one: Download ConEmu Stable, Installer ( 32-bit, 64-bit). Yo can find it on the ConEmu download page.
Install Git from the Git downloads page. It will be installed into /C/Program Files (x86)/Git
. Open the Git Bash
application and enter following commands:
uname -s
The expected output is: Output:
MINGW32_NT-6.1
You can list the available commands:
ls -l /bin
You can show the environment macros:
env
Show the home folder of the current user:
echo ${HOME} ls -l ${HOME}
The Git tools create an enviroment which is similar to a Linux enviroment. You can use the commands in the same way as on Linux, when they are available.
After opening Git Bash
you can start ConEmu
and attach it to the Git Bash console window. In ConEmu select menue item 'Attach to .. '. In the dialog window select the console application MINGW32 and press attach. Now the content of the console window of Git Bash should appear in the window of ConEmu and you should be able to use it.
Download the archive ksp-0180-cw-01-src-2016-08-18-1.zip
into the folder ${HOME}/Downloads
. The archive ksp-0180-cw-01-src-2016-08-18-1.zip
is downloaded for your information. It contains the latest version of the source code.
Download the git bundle ksp-0180-cw-01-src-2016-08-18-1.git-bundle
into the folder ${HOME}/Downloads
.The git bundle contains the current version of the git repository and will be used to install the source code of the BSP on your computer.
Clone the git bundle ksp-0180-cw-01-src-2016-08-18-1.git-bundle
into the folder ${HOME}/Documents/KSP-0180/ksp-0180-cw-01-src-git
.
mkdir -p ${HOME}/Documents/KSP-0180 git clone ${HOME}/Downloads/ksp-0180-cw-01-src-2016-08-18-1.git-bundle -b ksp-0180-cw-03 ${HOME}/Documents/KSP-0180/ksp-0180-cw-01-src-git
The folder contains now the source code of the BSP
ls -l ${HOME}/Documents/KSP-0180/ksp-0180-cw-01-src-git
The same source code is also in the archive ksp-0180-cw-01-src-2016-08-18-1.zip
The BSP has been developed and tested with CodeWarrior MCU 10.6
You can find a description of CodeWarrior MCU 10.6 on the page http://www.nxp.com/products/software-and-tools/software-development-tools/codewarrior-development-tools/codewarrior-development-studios/codewarrior-for-microcontrollers/codewarrior-for-mcus-eclipse-ide-coldfire-56800-e-dsc-kinetis-freescale-56xx-rs08-s08-s12z-v10.6:CW-MCU10. Download the Evaluation edition by selecting the Download Eval button. You have to register at NXP before you can download it. After downloading the image you can install the software.
All the tests with this software have been done, without generating or registering a license key. The size limit seems to be at 512k Byte.
Open CodeWarrior MCU 10.6
Select Menue: File -> Import
Select Item: General -> Existing Projects into Workspace
Select the root directory: ${HOME}/Documents/KSP-0180/ksp-0180-cw-01-src-git
A list of projects appears. Select the project hello-led-01
Now you should be able to build both configurations RAM and FLASH of the project hello-led-01
Debugging has been tested with the P&E USB MultiLink PPCNEXUS device.
Configuration of the board Phytec phyCORE-MPC5676R.
Set the DIP switch BOOTCFG1 on the board to 1-ON, 2-ON. This selects booting from internal flash.
Connect a serial cable to the lower serial port P2. Serial port will be configured to 115200 8N1.
Set the jumpers of the LEDs D1..D4.
Output at lower serial port P2 at speed 115200 8N1Output:
Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31 Hello world from Phytec phyCORE-MPC5676R May 31 2016 20:46:31