Skip to content

Chalandi/Baremetal_nxp_mpc5643l_dual_core_ppc_nosdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bare Metal MPC5643L Project

This repository contains a fully manually-written bare-metal project for the MPC5643L dual-core PowerPC e200z4 microcontroller, without using NXP's SDK.

Features

  • Dual-core PowerPC e200z4 booting support
  • MMU configuration
  • Cache enabled
  • SRAM ECC initialization
  • System clock configuration: 120 MHz
  • Interrupt vector tables for both cores
  • Timer interrupt generated from the PowerPC e200z4 private timer (Decrementer)
  • 1 Hz LED blinking on both cores via timer interrupt
  • SPE and FPU instructions supported
  • Only Book E is supported (no VLE code)

A clear and easy-to-understand implementation in C11 and assembly, with a build system based on GNU Make, makes this project both fun and educational.

This repository provides valuable insight into starting a bare-metal MPC5643L project.

Application Details

The MPC5643L's BAM module jumps to the application's entry function with only one TLB entry of 4KB configured in the MMU.

The low-level boot process begins on core0 and performs the following steps:

  • Configures the MMU to enable the full addressable space of 4GB
  • Enables instruction cache and SPE on the core
  • Initializes the SRAM ECC
  • Initializes the C/C++ environment and releases core1 from reset

Both cores then enable interrupts and enter an idle loop. Each core toggles an LED at a 1 Hz frequency using its private timer interrupt.

Building the Application

To build the project, you need an installed PowerPC GCC compiler (powerpc-eabivle) that supports the e200z4 cores (download it via the link below).

Run the following commands:

cd ./Build
Rebuild.sh

The build process generates the following artifacts in the Output directory:

  • ELF file
  • HEX mask
  • Assembly listing
  • Symbols listing

Flashing the Application

To flash the application's hex file, the PEmicro tool folder must be copied to ./Tools/pemicro (download it via the link below).

Once you have the tool in the right place, run the following commands:

cd ./Build
Flash.sh

Tools

These tools are needed to build, flash, and debug this project:

Tool Download link
PowerPC GCC compiler (powerpc-eabivle) for Windows Download
PowerPC GCC compiler (powerpc-eabivle) for Linux Download
PEmicro Debugger and Programmer (Starter Edition) Download

About

Bare-metal programming on NXP MPC5643L dual-core PowerPC e200z4 (TRK-USB-MPC5643L Board)

Topics

Resources

License

Stars

Watchers

Forks

Contributors