/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Read ADC on Primer2 under CircleOS 3.8

Username:     
Password:     
             

Forum

# 1   2010-01-05 23:09:28 Read ADC on Primer2 under CircleOS 3.8

erks
New member
Registered: 2009-11-24
Posts: 2

Read ADC on Primer2 under CircleOS 3.8

Hi,

I know how to read ADC without CircleOS, but I got several compiler errors with CircleOS.
Can anybody provide a working sample project for reading ADC for Primer2 under CircleOS 3.8?

Erkki

Offline

 

# 2   2010-01-06 07:24:45 Read ADC on Primer2 under CircleOS 3.8

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Read ADC on Primer2 under CircleOS 3.8

Hi,

What kind of compiler errors do you get ? Can you give us more details ?
Anyway, you can take a look of the battery, temperature and touchscreen acquisition in the CircleOS (file adc.c).

Yves

Offline

 

# 3   2010-01-06 08:02:02 Read ADC on Primer2 under CircleOS 3.8

erks
New member
Registered: 2009-11-24
Posts: 2

Re: Read ADC on Primer2 under CircleOS 3.8

I made a new fresh Circle2 project and included headers like this:
#include "circle_api.h"
#include "stm32f10x_adc.h"
#include "stm32f10x_dma.h"
#include "stm32f10x_gpio.h"

I also defined __STM32F10x_H

Building C:\Users\erkki\STM\AdcTest3\Application.c
Running: GCC
\"C:\Program Files\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -MD -D_STM32F103VET6_ -D_STM3x_ -D_STM32x_ -mthumb   -mcpu=cortex-m3 "C:\Users\erkki\STM\AdcTest3\Application.c" -o "C:\Users\erkki\STM\AdcTest3\objdebug\Application.o" -I "." -I "C:\Program Files\Raisonance\Ride\Lib\ARM\STM32F10x_LIB_V3.0.1\Libraries\STM32F10x_StdPeriph_Driver\inc" -I "C:\Program Files\Raisonance\Ride\Lib\ARM\include" -c     -fsigned-char -D __STM32F10x_H  -D OLD_STM32LIB_USED -g         -ffunction-sections         -mlittle-endian
In file included from C:\Users\erkki\STM\AdcTest3\Application.c:11: 
C:\Users\erkki\STM\AdcTest3\/circle_api.h:124: error: expected declaration specifiers or '...' before '*' token 
C:\Users\erkki\STM\AdcTest3\/circle_api.h:124: error: 'u32' declared as function returning a function 
C:\Users\erkki\STM\AdcTest3\/circle_api.h:125: error: 'tCircleFunc1' declared as function returning a function 
C:\Users\erkki\STM\AdcTest3\/circle_api.h:126: error: 'tCircleFunc2' declared as function returning a function 
C:\Users\erkki\STM\AdcTest3\/circle_api.h:127: error: 'tCircleFunc3' declared as function returning a function 
......

Erkki

Offline

 

# 4   2010-01-07 09:05:26 Read ADC on Primer2 under CircleOS 3.8

yrt
Administrator
From: Grenoble-France
Registered: 2008-06-11
Posts: 520
Website

Re: Read ADC on Primer2 under CircleOS 3.8

Hi,

It's a problem around ST library version.

Now, in order to be independant with ST library version, with the new version of Ride, we do not provide precompiled librairies v3.x. So, we suggest to integrate ST sources files into your project.

First, you have to unckeck the "LD Linker/Libraires/Use OLD Precompiled" option
and suppress the define __STM32F10x_H (it would be set by a ST header). For compatibility with old projects, the option is checked on when you created the new Circle project.

Add necessary ST source and header files (adc, dma..) into your project (version 3.x).

We will add soon a FAQ about this issue.

Yves

Offline

 

# 5   2010-01-08 15:26:09 Read ADC on Primer2 under CircleOS 3.8

logictechs
Member
Registered: 2009-05-07
Posts: 68

Re: Read ADC on Primer2 under CircleOS 3.8

Erkki, check out my post about similar problem for possible solution.

Offline

 

Board footer