DM870 Bootloader Level 1 DeepWiki
Complete reverse-engineered architectural reference for dm870_bootloader_l1.bin (1.41 MiB, CRC-32 0x181df020) — extracted from NOR partition 0x050000..0x1C0000 of the full 8 MiB MX29GL640E flash dump. A full KnOS recovery OS with UART1 CnE menu, fburn, XMODEM-over-SPI/UART, TFTP, HTTP OTA, GoAhead webs, USB Mass Storage/MTP/FAT, and SuluWLAN/WPA2.
01 Bootloader Level 1 Architecture Overview
On the BridgeCo DM870-CE2, Bootloader Level 1 (build stamp 20130829081037, NOR 0x050000..0x1C0000) sits between the 64 KiB First Level Bootloader (FLB at 0x000000) and the 3.88 MiB main AirPlay application (0x1C0000, see DM870 AirPlay DeepWiki). Rather than being a minimal stub, BL1 is a self-contained KnOS RTOS rescue & factory provisioning operating system sharing 1,781 exact SDK routines with the main application.
Codebase Composition (6,313 Documented Functions)
02 Full 8 MiB MX29GL640E NOR Flash Partition Map
Dumped cleanly over UART1 via fburn rd + XMODEM-CRC (16 × 512 KiB chunks, 0 NAKs, saved in firmware/dm870_full_flash.bin), revealing the complete NOR flash layout mapped at CPU address 0x40000000:
| Flash Offset | CPU NOR Addr | Size | Partition & Verification |
|---|---|---|---|
0x000000 – 0x00FFFF | 0x40000000 | 64 KiB | FLB (First Level Bootloader) — 33,252 B used (0x0000..0x81E4). Checks Rescue pin / app validity and chains into BL1 or App Stage-2. |
0x010000 – 0x01FFFF | 0x40010000 | 64 KiB | PersParam — unit-specific persistent parameters (TLV records managed by 0x6004CB4C). |
0x020000 – 0x02FFFF | 0x40020000 | 64 KiB | CnE Factory — factory defaults (CRC-32 0x5A64D9D0, 0 diffs vs original firmware). |
0x030000 – 0x04FFFF | 0x40030000 | 128 KiB | CnE User / Temp — runtime Wi-Fi profiles, device name, AirPlay password, and config overlay. |
0x050000 – 0x1BFFFF | 0x40050000 | 1.44 MiB | Bootloader Level 1 (this wiki) — MetaInfo header (20130829081037, CRC-32 0x181DF020) + 8 KiB Stage-2 @ +0x80 + 1.41 MiB BL1 @ +0x2080 (Fletcher-32 0x5CAA4428). |
0x1C0000 – 0x5AFFFF | 0x401C0000 | 3.94 MiB | Application + Stage-2 — MetaInfo (20150804070002, CRC-32 0xCDC12327, Fletcher-32 0xAFB432F9, 0 diffs vs dm870_airplay.bin). |
0x700000 – 0x7BFFFF | 0x40700000 | 768 KiB | FFSResources / WebUI — embedded web setup assets & resource containers (CRC-32 0x4A3C98A7). |
0x7E0000 – 0x7FFFFF | 0x407E0000 | 128 KiB | CnE User / Backup — backup configuration partition. |
03 Boot Sequence & Runtime Memory Map
BL1 uses the exact same 8 KiB on-chip SRAM Stage-2 loader binary as the main application (differing in only 8 bytes of its 0x18-byte payload descriptor: NOR source 0x40052080, length 0x16A0A4, Fletcher-32 0x5CAA4428). Once copied to SDRAM at 0x60008000, _start sets SP = 0x0040FA00, calls early_hw_init (0x6000C8D8), and runs RVCT __scatterload (table at 0x6016E580..0x6016E5E0):
| Block | Address Range | Size | Origin & Role |
|---|---|---|---|
| TCM_CODE | 0x00400000 – 0x00401BCF | 7.0 KiB | Copied from 0x6017046C by __scatterload_copy. Zero-wait-state ARM IRQ dispatcher, context switch, and TCB queues. |
| TCM_DATA | 0x00401BD0 – 0x00401C37 | 104 B | Copied from 0x6017203C (uncompressed). Hot kernel/IRQ state. |
| TCM_BSS | 0x00401C38 – 0x004029CF | 3.4 KiB | Zeroed by __scatterload_zeroinit. Fast IRQ/timer scratch. |
| TCM_STACK_ID | 0x004029D0 – 0x0040FFFF | 53.5 KiB | Boot/IRQ stacks (initial SP 0x0040FA00), Stage-2 slot (0x0040DA00), device ID byte at 0x0040FFFF. |
| SDRAM_LOW_BSS | 0x60000000 – 0x600047FF | 18 KiB | Low SDRAM zero-initialized region. |
| SDRAM_CODE (ram) | 0x60008000 – 0x601720A3 | 1.41 MiB | Full loaded dm870_bootloader_l1.bin: ARM/Thumb code, 208 RTTI records, 156 vtables, strings, and compressed init data. |
| SDRAM_DATA | 0x602EA000 – 0x602ED53B | 13.3 KiB | Unpacked from 0x6016E72C via RVCT __decompress1 (LZ77 + zero-run, 0x6000805C). |
| SDRAM_BSS | 0x602ED53C – 0x602FE3F7 | 67.7 KiB | Zero-initialized globals, lwIP/USB/WLAN state; followed by SDRAM heap and staging RAM for downloaded images. |
dm870_airplay.bin uses RVCT's pure-LZ77 decompressor for SDRAM_DATA and TCM_DATA, Bootloader L1 (compiled in 2013) uses RVCT __decompress1 (bit 3 selects zero-run vs 8-bit backreference) for SDRAM_DATA and copies TCM_DATA raw.
04 UART1 CnE Bootloader Console & fburn
When entered via the Rescue pin (Bootloader_reportRescuePin @ 0x60037120), UART1 break, invalid application checksum, or STM32 upgrade command, BL1 runs the interactive CnE console menu (cne_mainMenu @ 0x6004A654) and BridgeCo shell:
| Function / Command | Address | Behavior |
|---|---|---|
cne_mainMenu | 0x6004A654 | Main interactive UART1 bootloader menu: image/config/resource download, boot app, erase app, factory config & diagnostics. |
cne_cmd_programGuid | 0x60049B74 | Displays current GUID, reads 16 hex digits, confirms, and writes to persistent flash. |
cne_cmd_programMac | 0x60049CB0 | Displays current MAC address, reads 6 colon-separated hex bytes, and programs unit MAC. |
cne_cmd_programTvid | 0x60049E9C | Reads and programs the 37-digit TVID device identifier. |
cne_cmd_setJtagStartMode | 0x6004A230 | Prompts y/n to toggle JTAG start-mode flag in persistent configuration. |
Bootloader_eraseApplication | 0x60037154 | Masks interrupts and erases the application NOR flash regions (0x1C0000..). |
flashBurn_registerCommands | 0x600D24E8 | Registers the fburn shell commands (bin, ebin, img, image, read/rd — used to dump the 8 MiB flash!). |
flashBurn_command | 0x600AF1B4 | fburn execution handler: confirms, erases target flash range, and transfers raw/image data via XMODEM-CRC. |
05 Five Firmware Update & Recovery Transports
Every transport funnels through FirmwareUpdate (firmwareUpdate_init @ 0x6004BE2C, firmwareUpdate_commitImage @ 0x6004BE68, firmwareUpdate_buildMetaInfo @ 0x6004C2B8) and FlashUpdateServiceImpl / MemoryBlobFirmwareUpdateService, which verify CRC-32, optionally decrypt BCD-wrapped images, build the MetaInfo header, and program NOR flash:
1. UART1 & SPI XMODEM-CRC cne_runXmodemDownload
0x6004A474 (UART1 console) and xmodem_outbyte / xmodem_readByte (0x60048DD4) drive 128-byte XMODEM-CRC transfers over UART1 or over the STM32 SPI transport (used by STM32 Task 5 during USB HK_AURA.bin upgrades).
2. TFTP Client / Server (5 Modes) 0x60037260
Bootloader_downloadViaTftp supports 5 menu selectors: Image Only (0x00000001), Resources (0x01000000), Bootloader (0x00010000), Image+Resources (0x01000001), and Image+Config+Resources (0x01010001).
3. HTTP OTA & URL Transfer FwUpdateInternet
FwUpdateInternet_doDownload (0x600530D4) fetches from FirmwareDownload/DownloadURL; FileTransferServiceImpl_transfer (0x60072E88) unifies file://, http://, mem://, and rr:// URLs.
4. USB Mass Storage / MTP FileUsb
Mounts FAT12/16/32 USB drives via USBStackImpl + MassStorageDeviceClient + RDMFileSystemServiceImpl to flash recovery images directly from USB media.
06 USB Host Stack, MTP, SCSI & FAT Filesystem
BL1 includes BridgeCo's full C++ USB Host stack built on SuluUSBBusDriverImpl and USBStackImpl (0x11C-byte multiple-inheritance MessageThread):
- Enumeration State Machines: Dedicated sequence classes (
AddressSequence,ConfigurationSequence,HubDescriptorSequence,GetMaxLUNSequence,StringDescriptor,OSStringDescriptor) orchestrate USB device attachment. - Class Drivers:
HubDeviceClient(size ≥0xD8),MassStorageDeviceClient(massStorage_sendScsiCommand@0x6000F2FC,USB_SCSI_Read/Write, BOT CSW handling),MTPDeviceClient(DeviceInfo/ObjectInfo/storage queries), andIpodUSBDeviceClient(HID report/sequence support). - FAT Volume & RDMFS: Full 8.3/UTF-16 dirent parser, cluster-to-sector mapper, SCSI-backed volume mount (
0x600E48C4..0x600E51D8), andRDMFileSystemServiceImpl/RDMFSFileReaderImpl.
07 Sulu Wi-Fi, lwIP/NetPort TCP/IP & GoAhead Web Server
Even in Bootloader Level 1, the DM870 can bring up Wi-Fi or wired MACB Ethernet to serve recovery pages or pull images over TFTP/HTTP:
SuluWLAN + WPA2 / WPS 878 funcs
Bootloader_loadWirelessProfile (0x60036E4C) reads Profile0 from CnE; includes full Broadcom/hostap wpa_supplicant (EAPOL-Key, PMKSA cache, RSN/WPA IE, WPS SimpleConfig, RF/antenna control).
lwIP / NetPort Stack TCP / UDP / IP
Full BSD socket layer (soc_*, sbappend/sbdrop), TCP engine (tcp_input, tcp_output, tcp_reass, tcp_tmr), ARP, ICMP, IGMP, DHCP, AutoIP (AutoIP.cpp), JBCONNECT DNS, and macb_rx_task.
GoAhead webs HTTP Server Embedded WebUI
Complete GoAhead-style HTTP server (request/header/auth parsing, ROM file handler, ASP/form dispatch, base64/URL decode, HTML escaping) for browser-based firmware recovery.
STM32 SPI & RemoteReg AVRPlayer
SPIRegisterTransportLayer, AVRPlayerServiceImpl, and RemoteRegCtrldFileTransferService keep the STM32 host MCU synchronized and accept rr:// / XMODEM-over-SPI updates.
08 Reconstructed C++ RTTI Classes & KnOS RTOS
Like the main application, BL1 preserves full Itanium/ARM C++ ABI RTTI (__class_type_info @ 0x60169AD8, __si_class_type_info @ 0x60169AE8, __vmi_class_type_info @ 0x60169AF8) across 208 classes (17 root, 174 single-inheritance, 17 multiple-inheritance) and 156 vtables, all applied into Ghidra's /DM870_CPP type library with 395 class-bound methods and 364 vtable/typeinfo labels.
Key Multiple-Inheritance Classes in Bootloader L1
| Class | Est. Size | Base Subobjects (Exact Offsets from RTTI) |
|---|---|---|
AVRPlayerServiceImpl | ≥ 0x2A8 | IAVRPlayerService @ +0x0, IRemoteHandler @ +0x4, MessageThread @ +0x8 |
SuluUSBBusDriverImpl | ≥ 0x29C | IUSBBusDriverService @ +0x0, WorkerThread @ +0x4 |
USBStackImpl | ≥ 0x11C | MessageThread @ +0x0, USBStackInternalAccess @ +0x114, IUSBStackService @ +0x118 |
SPIRegisterTransportLayer | ≥ 0x11C | IRemoteRegisterTransportLayer @ +0x0, WorkerThread @ +0x4 |
MemoryBlobFirmwareUpdateService | ≥ 0xEC | IMemoryBlobFirmwareUpdateService @ +0x0, FunctorThread @ +0x4 |
RemoteRegCtrldFileTransferService | ≥ 0xEC | IRemoteRegCtrldFileTransferService @ +0x0, FunctorThread @ +0x4 |
RDMFileSystemServiceImpl | ≥ 0xEC | IRDMFileSystemService @ +0x0, FunctorThread @ +0x4 |
HubDeviceClient | ≥ 0xD8 | USBDeviceClient @ +0x0, IEndpointHandler @ +0xC4, IUSBDeviceClientHandler @ +0xC8, IUSBCommandSequenceHandler @ +0xCC |
MassStorageDeviceClient | ≥ 0xD0 | USBDeviceClient @ +0x0, IUSBCommandSequenceHandler @ +0xC4 |
MTPDeviceClient | ≥ 0xD0 | USBDeviceClient @ +0x0, IUSBCommandSequenceHandler @ +0xC4 |
CnE_SystemData | ≥ 0x28 | BaseSystemData @ +0x0, IPersistentControl @ +0x24 |
09 Interactive BL1 Function, Class & Label Explorer
Browse and filter all 6,313 live Ghidra Bootloader Level 1 functions (395 bound to C++ class namespaces), 208 RTTI-reconstructed C++ classes, and 364 vtable & typeinfo labels synced from ghidra/hk_aura.gpr (/dm870_bootloader_l1.bin). Press / anywhere to focus search.