cancel
Showing results for 
Search instead for 
Did you mean: 

CMOS data pass to ethernet interface throguh DMA channel

simonlee0311
Associate II
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.

34 REPLIES 34
simonlee0311
Associate II
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

 

alok472
Associate II
Posted on March 30, 2012 at 03:36

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

ANS-->> Yes, LwIP project on STM32F20x shall be good.

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

ery fast continuous transmission

? (CGI?)

ANS--> You just need to provide the BMP image pointer in GetImage Request. The sample code written by AMSN

3.    I had considered to convert the MJPEG stream

, but I think it will lose too much FPS.

    Because I don't use hardware codec.

ANS->>> Yes, using the JPEG encoder will take execution time for encoding. WHat is the FPS and Image size you are trying to stream ?

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

 

simonlee0311
Associate II
Posted on March 30, 2012 at 05:13

Dear Alokm:

Thanks for your kindly reply.

1. I already modify the LwIP sample code and it can link with my wifi module, also can show the web page on my iPad. (

Get a long time before I know how to do)

2. About bmp file, I try to save raw data from CMOS and store it on ex-sram now.

3. 

Because of cost with the mechanism issues, I can not use JPEG encoder.About FPS and image request, I list at below.

FPS: 30 FPS (

Perfect demand)

Image size: 640*480 (Min), 1280*720 (Max, but this time will not)

Perhaps you will think I'm crazy, i

t is almost impossible to achieve target.

But I still want to try it, and build this system. Because I want to learn more and more information about embedded system, and 

I want to build a base platform so that I could let the engineers do not need to re-head to learn it.

 Please 

hesitate to give me some advice. 

Thank for you very much.  Simon

alok472
Associate II
Posted on March 31, 2012 at 11:41

Pls consider the following. When a raw image (RGB) is captured from Camera, the size of image is high. for QVGA image 320x240x2 (2 bytes for each pixel) = 153K.

This image cannot fit into internal SRAM of STM32F2. So, you will need extra RAM.

So, in the BOM, pls add cost of RAM as per your requirement. In addition, the bandwidth occupation on Ethernet for BMP image will be higher.

If you wanna try smalled image, it will be good.or STM32F4 can be better choice.

i am not considering the BMP image from camera being streamed to Ethernet without the buffer RAM. Not sure, if it is possible to implement like this, since the Ethernet traffic timing is unpredictable.

Or, the other option is to use Precision time protocol on Ethernet to ensure data delivery. i havent used it though !!

simonlee0311
Associate II
Posted on April 01, 2012 at 05:11

Dear Alokm

Yes, I also think the image size issue. I also try to add a ex-sram to be a picture buffer.  (

IS61LV25616AL

 already mount on my EVB, but I think it too small)

1. Would you suggest any jpeg codec can fit my request?

2. Why you suggest STM32F4 series? Has it any special function inside?

Best regards,

Simon

 

alok472
Associate II
Posted on April 02, 2012 at 08:05

Hi Simon,

When i suggested the STM32F4, i mean it has more internal RAM, in addition, the software JPEG encoding will be faster (if you plan to implement it..)

simonlee0311
Associate II
Posted on April 02, 2012 at 09:53

Dear AMSN:

Thanks for your sample code. 

I probably know what you are trying to say.

But I did not write the CGI or the aspects of web programming experience.

I try to tacking sample code (ST provide, httpserver standalone).

I can't not found the cgi source file. But I found a file, httpd_cgi_ssi.c.

It simulate cgi handler file.(Actually, I don't know how it works, when and which function will call it). According to I think, I should modify this file, am I right?

I also visit the web side which you provide to me. It is Java scrip language.

I'm ashamed to want to ask How do I use the GET in HTML with javascrip to continue to read data.

Would you please teach me more about it? I will try it by myself. 

Thank you very much.

Simon

simonlee0311
Associate II
Posted on April 02, 2012 at 10:06

Dear Alokm

I know what you mean. But I don't know how to software encode CMOS data to JPEG.

Before, I try to search the encode method on web, but I don't found any sample code.

I also consider software encode data to MJPEG, but most application are linux running on ARM9 base. 

I'm stupid, so that I want to pass data directly to web side.

Simon

simonlee0311
Associate II
Posted on April 03, 2012 at 14:25

Dear AMSN:

I have traced the sample code that you suggest.

Yes, it is more easy to modify to fit my request.

But I have a question. I can not found any ''GET'' instruction in html file.

I use BlueGriffon (which is a html editor) try to open the html file. No matter in STM32F2x7.html or in STM32F2x7TASKs.html. 

I didn't found any GET method in these files.

I also trace the code, then I found it in httpserver-netconn.c.

Would you please tell me more? How do I add instruction in my html to communicate with my platform to get the picture data.

Now, I am following your suggestion try to move data to EX-SRAM and show it on my LCD through DMA (it sill not working, but I will fix it), after that I will combine it into network sample code.

Best regards,

Simon

simonlee0311
Associate II
Posted on April 19, 2012 at 05:55

Dear all:

At present, I have been to the stage to be integrated CMOS with web.

Software design is relatively poor than my hardware design.

Please if you have any experience about these issues and please tell me how do I fix these problems. Many thanks.

Code:

 if(00 == Camera_Capture_Image())

 {

  netconn_write(conn, (const unsigned char*) QVGAheader, (size_t) QVGAheader, NETCONN_NOCOPY);

netconn_write(conn, 0x60000000, 76800, NETCONN_NOCOPY);

 }

The compiler shows these information which lists at below.

..\src\httpserver-netconn.c(128): warning:  #223-D: function ''Camera_Capture_Image'' declared implicitly

..\src\httpserver-netconn.c(130): error:  #20: identifier ''QVGAheader'' is undefined

..\src\httpserver-netconn.c(131): error:  #167: argument of type ''int'' is incompatible with parameter of type ''const void *''

error1: Camera_Capture_Image'' declared implicitly

>About this issue, I already declared as extern uint8_t Camera_Capture_Image(void); 

  why it still implicitly?

error2: QVGAheader

> It is a const unsigned char array.

error3: 

>I really don't know how it happened.

Thanks

Simon