/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Problems with TIM_OC3Init() from the Firmware Library

Username:     
Password:     
             

Forum

# 1   2008-08-10 12:46:41 Problems with TIM_OC3Init() from the Firmware Library

Lusbueb33
New member
Registered: 2008-01-23
Posts: 2

Problems with TIM_OC3Init() from the Firmware Library

Hi all,

This spring I got a Primer at work. Currently I've good the time to play around a little bit with this "toy". With the library I found at ST I'm trying now to elicit the buzzer some notes.

Does anyone knows why TIM_TimeBaseInit() can be found but not TIM_OC3Init()? (They're defined both in stm32f10x_tim.h)

Code:

// main.c

#include "st-library/inc/stm32f10x_lib.h"

int main(void){
    TIM_TimeBaseInitTypeDef Timer_Conf={
        0xffff/2,
        0xffff/2,
        TIM_CKD_DIV1,
        TIM_CounterMode_Up,
        0x00 // Parameter is irrelevant for TIM3
    };

    TIM_OCInitTypeDef Channel_Conf={
        TIM_OCMode_PWM1,
        TIM_OutputState_Enable,
        TIM_OutputNState_Enable,
        0x7ff,
        TIM_OCPolarity_Low,
        TIM_OCNPolarity_Low,
        TIM_OCIdleState_Set,
        TIM_OCIdleState_Reset
    };

    TIM_DeInit(TIM3);
    TIM_TimeBaseInit(TIM3,&Timer_Conf);
    TIM_OC3Init(TIM3,&Channel_Conf); // <-- Here is the problem

    while(1){
        //Code
    }
}

The Build-Log:

Code:

Building D:\Dokumente und Einstellungen\Admin\Desktop\Test\Test001.rapp 
 Running : LD 
 \"D:\Programme\Raisonance\Ride\arm-gcc\bin\arm-none-eabi-gcc.exe" -mcpu=cortex-m3 -mthumb  -Wl,-T -Xlinker "D:\Dokumente und Einstellungen\Admin\Desktop\Test\Output\Test001.elf.ld" -u _start -Wl,-static -Wl,--gc-sections -nostartfiles -Wl,-Map -Xlinker "D:\Dokumente und Einstellungen\Admin\Desktop\Test\Listing\Test001.map"   
 D:\Dokumente und Einstellungen\Admin\Desktop\Test\Output\main.o: In function `main':  
 D:\Dokumente und Einstellungen\Admin\Desktop\Test/main.c:25: undefined reference to `TIM_OC3Init'  
 collect2: ld returned 1 exit status  
  
Build failed

P.S.:
I succeeded to programm a LED-Flasher. But I was wondering that I had to declare a simple counter-variable as volatile. Why is this neccessary?

Code:

void delay(volatile unsigned long int _delaytime){
   for(;_delaytime!=0;--_delaytime);
}

Last edited by Lusbueb33 (2008-08-10 19:18:59)

Offline

 

# 2   2008-08-11 10:39:21 Problems with TIM_OC3Init() from the Firmware Library

matloub
Member
Registered: 2008-02-21
Posts: 98

Re: Problems with TIM_OC3Init() from the Firmware Library

Hi

The first question could  be an issue of library version.
Can you please precise what is the version of Ride7 and Rkit-ARM you use and also the STM32 library you use.

Best regards,
Matloub

Offline

 

# 3   2008-08-11 15:13:58 Problems with TIM_OC3Init() from the Firmware Library

Lusbueb33
New member
Registered: 2008-01-23
Posts: 2

Re: Problems with TIM_OC3Init() from the Firmware Library

I use STM32F10xFWLib in the version from July.
Ride7       7.01.0002
RKitARM   1.03.0003

Last edited by Lusbueb33 (2008-08-11 15:14:38)

Offline

 

# 4   2008-08-11 17:31:59 Problems with TIM_OC3Init() from the Firmware Library

Francis
Administrator
From: France-Grenoble
Registered: 2007-07-09
Posts: 890

Re: Problems with TIM_OC3Init() from the Firmware Library

The last version of RIDE7 (available on the raisonance.com web site contain these new ST libraries. The CircleOS Version 2.0 has been linked with these libraries too (all the tools must be realigned because of the new ST libraries).

Offline

 

Board footer