Beagleboard: How do I send/receive data to/from the DSP?
Asked Answered
W

2

6

I have a beagleboard with TMS320C64x+ DSP. I'm working on an image processing beagleboard application. Here's how it's going to work:

  1. The ARM reads an image from a file and puts the image in a 2D array.
  2. The arm sends the matrix to the DSP. The DSP receives the matrix.
  3. The DSP performs the image processing algorithm on the received matrix (the algorithm code uses about 5MB of dynamically allocated memory).
  4. The DSP sends the processed image (matrix) to the ARM. The arm receives the matrix.
  5. The arm saves the processed image to a file.

I'v already written the code for steps 1,3,5. What is the easiest way to do steps 3+4 (sending the data)? Code examples are welcome.

Wan answered 15/1, 2011 at 10:14 Comment(0)
E
3

The easiest way is to use shared memory:

Use the CMEM kernel module to allocate a chunk of memory on the ARM that can be accessed from ARM and DSP. Then pass the pointer down to the DSP using the DspBios NOTIFY component.

Once the DSP is done with processing you can notify the ARM via NOTIFY.

This way there is no need to copy the data from the ARM to the DSP or vice versa. All you have to make sure is, that the data comes from the CMEM component. This makes sure the memory is contiguous (the DSP does not know about the ARM memory manager).

Eskil answered 15/1, 2011 at 14:55 Comment(0)
P
2

Shared memory is the right approach, but learning how to do it can be a pain. The C6Run tool can abstract the ARM/DSP communications for you making it easier. Although NOTIFY is really the right API to use, C6Run utilizes CMEM using an older API.

If you want to try C6Run out on the BeagleBoard, the easiest way is by following the instructions on the eLinux wiki for setting up C6Run for the ECE597 course given by Mark Yoder at Rose-Hulman. These instructions depend on running the Angstrom demo image(2). A stable version that was used to demonstrate functionality of the hardware is documented as well(3).

(2): www.angstrom-distribution.org/demo/beagleboard (3): code.google.com/p/beagleboard/wiki/BeagleBoardDiagnosticsNext

Perdurable answered 17/1, 2011 at 19:48 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.