Skip to main content
simonlee0311
Associate II
March 24, 2012
Question

CMOS data pass to ethernet interface throguh DMA channel

  • March 24, 2012
  • 34 replies
  • 5062 views
Posted on March 24, 2012 at 04:32

Dear All:

I try to pass my CMOS data to ethernet interface through DMA. (Before transfer to ethernet interface, I will add bmp file header.)

I already show the CMOS data on my LCD. But I don't have any idea how to pass data to ethernet interface.

I have readed the sample code, LwIP, which in stander library director.

My plan is add my CMOS control code in LwIP (httpserver-standalone project).

Anyone has experience or idea about this? Would you please give me some idea to do this?

Thanks.

    This topic has been closed for replies.

    34 replies

    alok472
    Associate
    March 24, 2012
    Posted on March 24, 2012 at 04:55

    Your idea is to show on webpage or sepcific graphical user interface ?

    If web page, then make a webpage with embedded image. In lwIP, check for request for image (when user opens the webpage from remote client) and provide pointer to the BMP image.

    simonlee0311
    Associate II
    March 24, 2012
    Posted on March 24, 2012 at 05:33

    Dear Alokm:

    First of all, thanks for your kindly reply.

    Yes, you are right. I want to show the picture on web browser and continue show the picture very quickly.

    If web page, then make a webpage with embedded image.

    > I know how to make a webpage, which my plan is modify from LwIP sample code. But I don't know what you mean. with embedded imgae?? You mean I make a default image in webpage?

    In lwIP, check for request for image (when user opens the webpage from remote client) and provide pointer to the BMP image.

    > That's a big problem. That's what I ask. I don't know how to modify the sample code, I know how to add bmp file header with my cmos data to make a bmp file. But I don't know how to pass it to Ethernet by DMA. I am so sorry, would mine give me more experience with this, please.

    simonlee0311
    Associate II
    March 24, 2012
    Posted on March 24, 2012 at 05:37

    Dear Alokm:

    First of all, thanks for your kindly reply.

    Yes, you are right. I want to show the picture on web browser and continue show the picture very quickly.

    If web page, then make a webpage with embedded image.

    > I know how to make a webpage, which my plan is modify from LwIP sample code. But I don't know what you mean. with embedded imgae?? You mean I make a default image in webpage?

    In lwIP, check for request for image (when user opens the webpage from remote client) and provide pointer to the BMP image.

    > That's a big problem. That's what I ask. I don't know how to modify the sample code, I know how to add bmp file header with my cmos data to make a bmp file. But I don't know how to pass it to Ethernet by DMA. I am so sorry, would mine give me more experience with this, please.

    Tesla DeLorean
    Guru
    March 24, 2012
    Posted on March 24, 2012 at 15:53

    You can't just dump it to the ethernet interface with DMA. You do understand the concepts of TCP packets, and socket connections, right? You have perhaps implemented a http client/server socket application?

    Go find a web server (HTTP GET) implementation that you can understand.

    Make a web page, index.html, that describes the name of the BMP ''file'' you want read, let's call it foo.bmp

    When foo.bmp subsequently is requested, by an HTTP GET, you shovel the BMP data as the payload portion of the transfer.
    Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
    simonlee0311
    Associate II
    March 28, 2012
    Posted on March 28, 2012 at 06:09

    Dear Sir:

    I try to make a new webpage and transfer by makefsdata.exe. (It is include in original example).

    But it can't compile. MDK shows me these errors.

    ..\src\fsdata.c(9): error:  #65: expected a '';''

    ..\src\fsdata.c(10): error:  #65: expected a '';''

    ..\src\fsdata.c(271): warning:  #12-D: parsing restarts here after previous syntax error

    ..\src\fsdata.c(2594): error:  #65: expected a '';''

    ..\src\fsdata.c(2600): warning:  #12-D: parsing restarts here after previous syntax error

    ..\src\fsdata.c(2603): error:  #20: identifier ''Connections_jpg'' is undefined

    ..\src\fsdata.c(2603): error:  #28: expression must have a constant value

    I try to compare the files(fsdata.c). Is it cause my pitcure too large? Or, I need to modify the other variable in ST sample code?

    amin23
    Visitor II
    March 28, 2012
    Posted on March 28, 2012 at 08:06

    Hello,

     

    I think it is easy to start by httpserver_netconn FreeRTOS project then switch to standalone project

    1 - first configure DMA2_Stream1 to manage data transfer from DCMI interface to Ext. SRMA

    2 - prepare the BMP image header QQVGA or QVGA

    3 - check the DMA TC flag

    4 - check for image request

    if (strncmp((char const *)buf, ''GET /image.bmp'', 14))

    {

      if(BufferIsFilled) // BufferIsFilled should be set when DMA TC

      {

        netconn_write(); // Send image header

        netconn_write(); // Send image data

        BufferIsFilled = 0;

       // Start new image capture

      }

    }

    simonlee0311
    Associate II
    March 29, 2012
    Posted on March 29, 2012 at 04:42

    Dear AMSN:

    Thanks for your kindly reply. May I ask you some questions?

    1. Can I use LwIP example to modify to fit my request? 

    2. How do I make my bmp pass to web browser v

    ery fast continuous transmission

    ? (CGI?)

        I had considered to convert the MJPEG stream

    , but I think it will lose too much FPS.

        Because I don't use hardware codec.

    I already can light on the cmos and show the picture on my LCD, and I also can show the html through wifi on my iPad. But I know how to show the picture on my iPad through wifi.

    Hope everyone can give me some guidance. 

    Thanks and best regards,

    Simon

    amin23
    Visitor II
    March 29, 2012
    Posted on March 29, 2012 at 16:08

    Hello,

    1. yes, you should modify the html page

    2. use timing events

    http://p2p.wrox.com/javascript/14922-settimeout-image-cycling-circle.html

    &

    http://www.w3schools.com/js/js_timing.asp

    amin23
    Visitor II
    March 29, 2012
    Posted on March 29, 2012 at 16:09

    Hello,

    1. yes, you should modify the html page

    2. use timing events

    http://p2p.wrox.com/javascript/14922-settimeout-image-cycling-circle.html

    &

    http://www.w3schools.com/js/js_timing.asp

    simonlee0311
    Associate II
    March 30, 2012
    Posted on March 30, 2012 at 03:18

    Dear AMSN:

    First of all, thanks for your kindly reply.

    I am so sorry, my English is very poor.

    I make a mistake, that I typing error.

    But I know how to show the picture on my iPad through wifi.

    > I typos. It should be I don't know how to show the picture on my iPad through wifi.

       

    I mean yes. I have modified to render the Web page, but I don't know how to transfer the

       picture through wifi on my iPad.

    As I know, I should decode the package which from web side, right?

    I need to decompose the packet passed over from the web.

    Would you please provide me some advise?

    Thanks and best regards,

    Simon