Custom Firmware on the OP-1

3) The .ldr files

The OP-1 works with a BF-524 as main CPU. That is a “BlackFin” DSP chip made by Analog Devices. It is also used in digital storage oscilloscopes because of its DSP capabilities.

The blackfin uses a weird format for files and documentation isn’t that easy to find. Essentially, the LDR (or “loader”) format is what the CPU expects as download format. It consists of “blocks” of data, each with a header and there is a bit of “compression” involved (namely there are headers which say “the following X Bytes are all 0”) thus when loading that file, the CPU fills its memory according to the instructions in the loader file.

According to AD documents, the file that is represented by all the blocks in the LDR file is a “DXE” file. I found some mentions about DXE being a lot like ELF, which says a lot and nothing at the same time.

So essentially, to really run your own code on the OP-1 you would have to:

  1. write a decoder software to turn the LDR file back into DXE
  2. find out the format of DXE
  3. write a disassembler for blackfin (or hope that e.g. radare works with it)
  4. analyze the codeflow and delete/insert parts where needed
  5. turn the DXE file into LDR again
  6. re-package the whole OP-1 firmware update package
  7. upload! \o/
and yes. That is about as much pain as it sounds.
At first I thought that the OP-1 would run ucLinux on there because there are some tools and eval kits for the BlackFin running that. But there is no reference whatsoever to Linux in there, so the theory of it using VDK (the kernel from VisualDSP) is much more likely
2 Likes