Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 514
snakile Avatar asked Jan 15 '11 10:01

snakile


1 Answers

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).

like image 199
Nils Pipenbrinck Avatar answered Sep 22 '22 13:09

Nils Pipenbrinck