TMS320LF2401AV: Reading a Part With No External Memory Bus
Most writing about DSP extraction concentrates on the security module, because that is the part that says no. On the LF2401AV the security module is the same as on its larger siblings, but the constraint that shapes the job is different: this is the part of the family with no external memory interface, and once the image is out of flash there is nowhere to put it except the same small internal RAM the program is using.
That single fact governs the whole procedure. A method that works on an LF2407 — where an external bus can be attached and a large buffer addressed directly — has to be rebuilt from the ground up here.
What the absence of an external bus removes
On a part with an external interface, extraction has an easy shape. Attach memory to the bus, point a routine at it, transfer the array in one sweep, then read the buffer out at leisure. The DSP does the work and the host only collects the result.
Without that interface, every byte that leaves the device has to leave through a peripheral. In practice that means the asynchronous serial port, occasionally the controller-area bus on parts that have one, and nothing else. The bandwidth is low, the transfer is interruptible, and the receiving side has to be able to recover from a gap in the middle.
| Constraint | Consequence for the extraction |
|---|---|
| No external memory bus | All output goes through a serial peripheral |
| Small internal RAM | Image must be moved in blocks, not as a whole |
| Flash read protected | Nothing can be read as data until the module is released |
| Single serial channel | One framing error can desynchronise the whole stream |
Why block size is a design decision, not a detail
The tempting choice is the largest block the RAM can hold. That choice fails for two reasons.
First, the block buffer competes with the routine that performs the transfer. The sending routine needs its own stack, its own transmit buffer, and in most designs a small ring for the interrupt handler. Sizing the block at the theoretical maximum leaves nothing for the code doing the work.
Second, a large block means a long time between checkpoints. If the transfer stalls halfway through a large block, everything in it has to be re-sent, and there is no way to know how much arrived.
The rule that holds up in practice: size the block so that one block transfers in a few seconds, and append a checksum to each block. A block of a few hundred words with a trailing sum is far more robust than a single multi-kilobyte burst, even though it looks less efficient.
The order of operations
- Establish that the device is alive and executing — check the clock output and a toggling pin before anything else.
- Read whatever is readable without releasing the array: boot ROM contents, peripheral registers, the reset vector if it is not protected.
- Determine the state of the code security module and whether the password is blank, weak, or set.
- If the module can be released, release it and confirm by reading a known address.
- Read the array in blocks under a checksum discipline.
- Verify the assembled image against the reset vector and the entry point before declaring it complete.
Step two is worth doing even when the answer seems obvious. On this family the boot ROM is separate from the flash array, is readable, and contains the loaders and the flash programming routines. Its contents tell you which boot sources this particular device supports, which determines whether a serial loader is available as a fallback path.
Framing the serial stream
A raw dump over an asynchronous port has no inherent structure. If the host loses a byte, every subsequent byte is misaligned and the image silently becomes garbage that still looks like data.
Three things prevent that:
- a start-of-block marker that cannot occur inside a payload,
- an address field in every block, so a lost block is detectable rather than shifting,
- a running sum over address plus payload, checked by the host, with the block re-requested on mismatch.
The address field is the important one. With an address in each block, the host does not need the stream to be continuous. It can acknowledge blocks, request retransmission, and assemble the image in whatever order the blocks arrive.
What a complete image contains
On a 24x device the array is not the only thing worth copying. A usable image includes the program and data sections, the interrupt vector table, and the initialised constants that the startup code copies from flash into RAM. It also includes any calibration values the design stores in flash rather than in the peripheral registers.
Missing the vector table is the classic failure: the image programs correctly, the device runs, and then the first interrupt jumps to an address that was never written, because the vectors were assumed to be generated by the linker rather than stored.
When the module will not release
If the password is set and unknown, the array does not become readable through any amount of re-reading. The options then narrow to password recovery, which is a search problem with a realistic ceiling, and physical work, which is a different discipline with a different cost structure.
It is worth being direct about the ceiling. A password derived from a device identifier or a fixed production constant can often be found. A password generated randomly per unit cannot be found by search, and no amount of diligence changes that. Establishing which of the two you are facing, before quoting any work, is the difference between a project and a wasted week.
Related reading
- TMS320F240 and the same core with a different memory map — useful as a contrast, since the F240 does have an external interface.
- TMS320LF2402AP and the password state problem — the decision that comes before any transfer.
- TMS320F241PG, the part that sits between the two generations — peripheral set differences that affect which channel you can use.
FAQ
Does the LF2401AV have a boot ROM loader? It has boot ROM, and the loaders it contains determine the fallback path. Read the ROM before assuming a serial loader exists.
Can the image be held in RAM during extraction? Not the whole image. The array is much larger than the RAM, which is why block transfer with per-block addressing is required.
Is the serial port fast enough to be practical? At the baud rates these devices support, an image takes minutes rather than seconds. That is acceptable if the framing is robust and unacceptable if it is not.
What happens if a block fails its checksum? Re-request that block only. This is the reason every block carries its own address.
Conclusion
The LF2401AV is limited by its lack of an external bus rather than by its security module. Every byte leaves through a serial peripheral, the block size is set by what the RAM can spare rather than by what it can hold, and robustness comes from per-block addressing and checksums rather than from transfer speed. Get the framing right and the rest of the procedure is ordinary.