8051 Core
Introduction
The CPU used by Duo contains an 8051 core. The 8051 subsystem is located in a module that is independently powered by the RTC. The subsystem is configured with an 8051, an I2C/UART/SPI NOR/SD controller, a Timer/WDT, interrupt management, and a Mailbox IP. The system software can use the 8051 to manage wake-up conditions and wake up the system while it is in sleep mode, and communicate with external devices through peripheral controllers.
Quick Start
8051 core compilation guide
Source Code: github.
run:
git clone https://github.com/milkv-duo/duo-8051.git
cd duo-8051/sdcc/mars/project/base_project
make clean && make
After successful compilation, the compiled firmware mars_mcu_fw.bin
can be found in sdcc/mars/project/base_project/output
.
How to load firmware
First download the firmware and tools and unzip the zip package:firmware.zip.
Ⅰ. Load firmware in 8051-SRAM:
-
Copy
8051_up
,mars_mcu_fw.bin
, andblink.sh
into/mnt/data
, and grant execution and read permissions. -
Execute
8051_up
to automatically update the firmware and start the 8051 core. -
Execute
blink.sh
. This script will send data to the 8051 core and cause the blue LED to flash (please confirm that /mnt/system/blink.sh has been removed before executing this script).
The 8051 kernel firmware cannot exceed 8KB when running this method. Exceeding the limit may cause it to not run.
Ⅱ.Load firmware in DDR memory:
- Change the memory allocation in the SDK and modify
build/boards/[chip model]/[board config]/memmap.py
.
Add the following content in MemoryMap:
# ==============
# 8051
# ==============
CHIP8051_SIZE = 512 * SIZE_1K
CHIP8051_ADDR = DRAM_BASE + DRAM_SIZE - CHIP8051_SIZE