This repository contains a fully manually-written bare-metal project for the MPC5643L dual-core PowerPC e200z4 microcontroller, without using NXP's SDK.
- 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.
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.
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.shThe build process generates the following artifacts in the Output directory:
- ELF file
- HEX mask
- Assembly listing
- Symbols listing
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.shThese 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 |