[#5315] awg test fails to show the generated wave on the oscilloscope

Document created by Aaronwu Employee on Sep 4, 2013
Version 1Show Document
  • View in full screen mode

[#5315] awg test fails to show the generated wave on the oscilloscope

Submitted By: Mingquan Pan

Open Date

2009-07-06 05:51:44     Close Date

2009-07-16 05:44:41


Medium High     Assignee:

Michael Hennerich


Closed     Fixed In Release:


Found In Release:

N/A     Release:


N/A     Board:



BF537     Silicon Revision:

Is this bug repeatable?:

Yes     Resolution:

Under Debugging

Uboot version or rev.:

    Toolchain version or rev.:


App binary format:


Summary: awg test fails to show the generated wave on the oscilloscope



awg test fails to show the generated wave on the oscilloscope.


Build the awg test and run on bf537 stamp board, it can caculate the defined waves but fail to show it on the oscilloscope.




--- Michael Hennerich                                        2009-07-08 07:03:41

The issue is caused by bfin_spi_giveback() deactivating the SPI SSEL while the

DMA is still running in autobuffer mode.

The whole DMA autobuffer stuff is a pretty bad hack, into the SPI bus driver.

I can add a fix on the branch to make the AWG demo run.

But long term I would like to see that we remove the autobuffer SPI DMA feature

completely from the SPI Bus Driver.



static void bfin_spi_giveback(struct driver_data *drv_data)





    if (!drv_data->cs_change)

        bfin_spi_cs_deactive(drv_data, chip);


    /* Not stop spi in autobuffer mode */

    if (drv_data->tx_dma != 0xFFFF)







Any objections?

1) remove the autobuffer SPI DMA feature from the Blackfin On-Chip SPI Driver

on trunk

2) Remove the AWG Demo on trunk




--- Michael Hennerich                                        2009-07-08 07:13:06



I checked a fix into kernel and awg app.

Can you test again?




--- Robin Getz                                               2009-07-08 08:03:04

>2) Remove the AWG Demo on trunk


Doesn't the netscope need the same?


I would prefer not to remove drivers. (you would be loosing the DAC driver



--- Mike Frysinger                                           2009-07-08 21:52:02

how can autobuffer dma with spi really be supported ?  it would make it pretty

hard to use multiple spi devices wouldnt it ?


it'd be better if these userspace things merely requested a chunk of data and

worked with that rather than saying "keep giving it to me" ...


--- Mingquan Pan                                             2009-07-09 03:04:32

I tried the branch head kernel again and the oscilloscope can show picture this

time. But it looks the shown picture doesn't go with the caculated one on the

host machine. The voltage shown is higher than set and the sine wave is


the picture is attached.


--- Michael Hennerich                                        2009-07-09 04:45:00


>>2) Remove the AWG Demo on trunk

>Doesn't the netscope need the same?

>I would prefer not to remove drivers. (you would be loosing the DAC driver



The netscope doesn't use the autobuffer DMA.

The whole thing is kind of dangerous. In the SPI Bus driver we just leave the

DMA and SPI running and then exit. The next message sent out the SPI Bus will

terminate the current ongoing one.

At least this is the theory. However time showed that every time we test it

during our release testing it is broken by some other bug fixes. I have the

impression that only our testing uses this feature.


I can check the same fix made on the branch also into trunk, if we think the

whole thing is kind of valuable. I personally think it's not. In case someone

wants this kind of functionality he should use the SPORT instead.




--- Michael Hennerich                                        2009-07-09 04:52:34



Works pretty ok for me.

Check your measurement equipment, connections, etc.

-or maybe your card is damaged.


See my scope captures including measurements attached.




--- Mike Frysinger                                           2009-07-09 13:23:37

cant we implement the awg demo without autobuffer dma ?  i dont have a problem

dropping the autobuffer dma mode since as you say, it isnt how the SPI framework



--- Michael Hennerich                                        2009-07-09 14:27:39

>cant we implement the awg demo without autobuffer dma ?


Not really - we only calculate and store one period in memory.

The autobuffer DMA feature makes it a periodic continuous wave.


I was thinking about using the generic SPORT driver instead of the SPI Bus





--- Mingquan Pan                                             2009-07-13 06:28:19

I can see the exactly same wave as yours by using ad5443 on bf533 stamp board.

But as to bf537 stamp board, I tried on 4 boards with the same ad5443, and still

fails to get the normal wave, on some boards vol gets lower to 1mv(defult 0.5v),

on the other boards gets higher to 10v.


--- Mingquan Pan                                             2009-07-16 05:44:41

I check out clean new source and tried again to find that the awg works right

and give out the right wave as yours on at least 2 bf537 boards. And another

board should has something wrong with the spi port, on which board also fails

with spi net case. So label it as bad  and close this bug.












File Name     File Type     File Size     Posted By

rect 1khz 1V.jpg    image/jpeg    161112    Michael Hennerich

config.awg    application/octet-stream    32687    Mingquan Pan

Image2.png    image/png    11852    Mingquan Pan

sine 1khz 1V.jpg    image/jpeg    181727    Michael Hennerich