From: "Christophe Coutand" <ccoutand@stmi.com>
To: "jayant biswas" <biswasj@gmail.com>
Cc: <ecos-discuss@ecos.sourceware.org>
Subject: [ECOS] RE: stm3210e eval board adc question
Date: Tue, 19 Apr 2011 07:27:00 -0000 [thread overview]
Message-ID: <D6050C555CC56940A7AF32652283027603DAC869@mail2.STMIRV01.COM> (raw)
In-Reply-To: <BANLkTi=STiWKO4HbzLx=K9q+T=CoHhKvBg@mail.gmail.com>
Hi Jayant,
From this documentation: http://www.st.com/stonline/books/pdf/docs/14220.pdf, the potentiometer is connected to PC4.
Looking at the IOs definition in: packages\hal\cortexm\stm32\var\current\include\var_io.h, you can sample PC4 using ADC1/14.
#define CYGHWR_HAL_STM32_ADC12_IN14 CYGHWR_HAL_STM32_GPIO( C, 4, IN, ANALOG )
#define CYGHWR_HAL_STM32_ADC1_IN14 CYGHWR_HAL_STM32_ADC12_IN14
The adc2 test does not log any sampling results. It is used to check that the sampling rate is correct over a period of 10 seconds. The output of your test does not look good. The \0x09 is a tabulation that your terminal is not interpreting (which terminal do you use)? But the result is 0 for all channels, meaning that no samples are read.
----------------------------------------
Samples expected after 10210 milliseconds: 10210
Samples read (per channel):
/dev/adc00 \0x09= 0
Do you have a way to step into the code? I don't clearly see how the test can complete without reading samples. Line 181 is a loop waiting for samples:
// Read & count samples
do {
cyg_uint32 len = sizeof(sample);
res = cyg_io_read(chan->handle, &sample, &len);
if (res == ENOERR)
chan->count++;
} while (res == ENOERR);
You can also try the adc1 test which shall read and display the sampled data. I don't own a STM3210e boards therefore can't give it a try.
Regards,
Christophe
-----Original Message-----
From: jayant biswas [mailto:biswasj@gmail.com]
Sent: 18. april 2011 16:49
To: Christophe Coutand
Cc: ecos-discuss@ecos.sourceware.org
Subject: Re: stm3210e eval board adc question
Dear Christophe!
Thanks for your support. I have a feeling I am getting closer, but not
quite there yet. So I appreciate your time in helping me out. Now I
have been able to add the adc io, as in the screenshot you sent using
only the cvs code. So I am not mixing anymore ecos-3.0 and the cvs.
But when I run the tests on my stm3210e eval board I do not get the
desired output. The output of adc2 test is shown below. It shows that
no samples have been read. I am also not sure what to make of the
\0x09 stuff before the '=' signs.
My goal is to be able to read the value from the potentiometer on the
board (http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATA_BRIEF/CD00278458.pdf
as shown on page 2/3) and eventually also from the 3 bnc connectors.
First of all, how can I know which input (BNC or Potentiometer) is
connected to which device on which channel? And secondly why when I
try to display values from all channels on both devices I receive
nothing. One of these channels must be connected to the potentiometer
no? The BNC connectors are currently left open.
Hope I can make this work.
Regards,
Jayant
\0x00INFO:<ADC performance test>
INFO:<Opening available ADC channel
s>
Opened 32 ADC channels
INFO:<Preparing ADC channels for test>
INFO:<Starting measurement>
/dev/adc00 \0x09= 0
/dev/adc01 \0x09= 0
/dev/adc02
\0x09= 0
/dev/adc03 \0x09= 0
.
.
.
/dev/adc113 \0x09= 0
/dev/adc114 \0x09= 0
/dev/adc115 \0x09= 0
INFO:<Finished measurement>
----------------------------------------
Samples expected after 10210 milliseconds: 10210
Samples read (per channel):
/dev/adc00 \0x09= 0
.
.
.
On Mon, Apr 18, 2011 at 11:47, Christophe Coutand <ccoutand@stmi.com> wrote:
> Hi Jayant,
>
> You are using ecos-3.0 with the additional STM32 ADC package from CVS? It is usually not recommended to mix source code as it make it more difficult to get support from the mailing list.
>
> It is not enough to copy the directory packages\devs\adc\cortexm\stm32 in your repository, you must also include the package entry in the database (i.e. ecos.db):
>
> package CYGPKG_DEVS_ADC_CORTEXM_STM32 {
> alias { "STM32 ADC driver" adc_stm32 }
> hardware
> directory devs/adc/cortexm/stm32
> script adc_stm32.cdl
> description "
> This package provides a driver for the ADC interfaces found on the
> ST STM32 microcontroller family."
> }
>
> To build the STM32 HAL with ADC support from CVS repository, I do:
> $ ecosconfig.exe new stm3210e default
> $ ecosconfig.exe add io_adc
>
> You can configure the ADC from the GUI:
> $ configtool.exe ecos.ecc
>
> Example:
>
> http://dl.dropbox.com/u/21589565/misc/stm32_adc.JPG
>
> Regards,
> Christophe
>
> -----Original Message-----
> From: jayant biswas [mailto:biswasj@gmail.com]
> Sent: 18. april 2011 10:47
> To: John Dallaway; Christophe Coutand
> Cc: ecos-discuss@ecos.sourceware.org
> Subject: Re: stm3210e eval board adc question
>
> Thank you Christophe and John for your replies.
>
> I did checkout the cvs repository and was able to get the right folder
> i.e. packages\devs\adc\cortexm\stm32
>
> However, this hasn't solved my problem. I am still getting the same
> output as before when calling cyg_io_lookup and cyg_io_read.
>
> To integrate the new packages from the cvs. I copied the entire
> repository over my ecos-3.0 folder. Then I regenerated the ecos.ecc
> file for stm3210e. I noticed here that the
> CYGPKG_DEVS_ADC_CORTEXM_STM32 checkboxes were grayed out. I then
> recompiled my application with the newly generated libraries.
>
> Please let me know if I am missing some steps. I am sure I am. Is
> there a guide that I can follow that shows how to integrate the ecos
> cvs packages?
>
> Best regards,
> Jayant
>
> On Wed, Apr 13, 2011 at 20:11, John Dallaway <john@dallaway.org.uk> wrote:
>> Hi Jayant
>>
>> jayant biswas wrote:
>>
>>> I installed ecos as indicated here
>>> http://ecos.sourceware.org/getstart.html .
>>
>> ... so you have the eCos 3.0 release repository.
>>
>> The STM32 ADC driver is not present in eCos 3.0. You will have to
>> checkout the eCos CVS repository in order to gain access to
>> CYGPKG_DEVS_ADC_CORTEXM_STM32. Ref:
>>
>> http://ecos.sourceware.org/anoncvs.html
>>
>> I hope this helps...
>>
>> John Dallaway
>> eCos maintainer
>> http://www.dallaway.org.uk/john
>>
>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
next prev parent reply other threads:[~2011-04-19 7:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-12 15:27 [ECOS] " jayant biswas
2011-04-12 16:22 ` Christophe Coutand
2011-04-13 8:48 ` jayant biswas
[not found] ` <D6050C555CC56940A7AF3265228302761394EC@mail2.STMIRV01.COM>
2011-04-13 12:38 ` jayant biswas
2011-04-13 18:11 ` [ECOS] " John Dallaway
2011-04-18 8:48 ` jayant biswas
2011-04-18 9:49 ` [ECOS] " Christophe Coutand
2011-04-18 14:49 ` [ECOS] " jayant biswas
2011-04-19 7:27 ` Christophe Coutand [this message]
2011-04-19 12:43 ` jayant biswas
2011-05-02 10:16 ` jayant biswas
2011-05-02 21:45 ` [ECOS] " Christophe Coutand
2011-05-03 7:58 ` [ECOS] " jayant biswas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=D6050C555CC56940A7AF32652283027603DAC869@mail2.STMIRV01.COM \
--to=ccoutand@stmi.com \
--cc=biswasj@gmail.com \
--cc=ecos-discuss@ecos.sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).