/var/www/restricted/ssh/stm32/www/stm32circle/ STM CircleOS forum / Definitive Usart2 with interrupt handler

Username:     
Password:     
             

Forum
  • Index
  •  » circleOS
  •  » Definitive Usart2 with interrupt handler

# 1   2010-03-11 22:26:26 Definitive Usart2 with interrupt handler

slimjim
New member
Registered: 2009-11-26
Posts: 9

Definitive Usart2 with interrupt handler

Would someone be so kind as to post a working example including it's ride7 project file of the usart 2 working? Either with old precompiled library or new, it doesn't matter as long as it has been tested and works.

So far I have tried every lead I could find in the forum search, with no joy.

The problem always seems to be to do with configuring the project in ride 7, which files to include? How to set the linker? All these questions would be answered if there were simply a working example with a project file.

I have tried to compile the "HANDHELD DATA COLLECTION"" project with no success, I managed to get the thing to compile a couple of times, but with warnings. these warnings were always to do with the line:

UTIL_SetIrqHandler(USART2_IRQChannel, (tHandler)Usart2Handler);  //pointing out the handler

and the warning was:

warning: passing argument 2 of '(u32 (*)(u32, u32))(*ptrCircle_API)[185]' makes integer from pointer without a cast

which I assume is why when in debug mode I can see that my serial hardware connected to the rx pin is generating a reaction - the Usart2 status register changes from 0x1C0 to 0x1f2 and RXNE changes to 'not empty' also. But the interrupt does not trigger the user defined function (in this case "Usart2Handler").

Any help would be appreciated, but a proven and working demo/example project would be best.

James

Last edited by slimjim (2010-03-11 22:29:33)


Ride 7                   : 7.24.09.0251
RKit-ARM for Ride7 : 1.22.09.0254
Primer2
CircleOS                : 3.8

Offline

 

# 2   2010-07-15 11:11:14 Definitive Usart2 with interrupt handler

matmout
Member
From: Grenoble
Registered: 2010-05-10
Posts: 12

Re: Definitive Usart2 with interrupt handler

Hello slimjim, I advise you to have look at my older project : http://www.stm32circle.com/projects/project.php?id=120

I used function handling and usart interface...

Last edited by matmout (2010-10-01 12:01:00)

Offline

 

# 3   2010-07-15 15:41:11 Definitive Usart2 with interrupt handler

ronald
New member
Registered: 2010-05-21
Posts: 5

Re: Definitive Usart2 with interrupt handler

hello matmout i`m trying to use the usart2 with the predefines functions
void USART_DeInit(USART_TypeDef* USARTx);
void USART_Init(USART_TypeDef* USARTx, USART_InitTypeDef* USART_InitStruct);
void USART_StructInit(USART_InitTypeDef* USART_InitStruct);
void USART_ClockInit(USART_TypeDef* USARTx, USART_ClockInitTypeDef* USART_ClockInitStruct);
void USART_ClockStructInit(USART_ClockInitTypeDef* USART_ClockInitStruct);
void USART_Cmd(USART_TypeDef* USARTx, FunctionalState NewState);
void USART_SendData(USART_TypeDef* USARTx, u16 Data);
u16 USART_ReceiveData(USART_TypeDef* USARTx);

but when i call them
USART_Init(USART2, &USART_InitStructure);
    USART_Cmd(USART2, ENABLE);
and build the project each function generated this error
expected expression before ',' token

you can helpme please.

Offline

 

# 4   2010-07-16 10:11:30 Definitive Usart2 with interrupt handler

diabolo38
Member
Registered: 2010-03-12
Posts: 50

Re: Definitive Usart2 with interrupt handler

if you use older stm lib then do you have a "stm32f10x_conf.h" in your project ?
this is where you "configure" perfiferal used
it seam that by default usarts are not configured hence "USART2" symbol might not be defined ,  at least thats the case  in my  stm32f10x_conf.h

Code:

/************************************* USART **********************************/
//#define _USART
//#define _USART1
//#define _USART2
//#define _USART3
//#define _UART4
//#define _UART5

uncomenting //#define _USART2 shall help .

Offline

 

# 5   2010-07-16 16:40:26 Definitive Usart2 with interrupt handler

ronald
New member
Registered: 2010-05-21
Posts: 5

Re: Definitive Usart2 with interrupt handler

well , yesterday I was work in that and i saw that, and the building ran ok.
now i´m trying to make a menu  to my aplication like the principal menu from circle OS. do you now something about that?

i´m trying to change the older stm lib for the 3.1 stm lib but all this changes create a lot of errors and warnings.

thanks for you comments "diabolo38"

Offline

 

# 6   2010-07-23 08:53:20 Definitive Usart2 with interrupt handler

far-far
Member
Registered: 2010-05-28
Posts: 10

Re: Definitive Usart2 with interrupt handler

There is a BUG in the source code!!!!

UTIL_SetIrqHandler(USART2_IRQChannel, (tHandler)Usart2Handler);  //pointing out the handler

It should be

UTIL_SetIrqHandler(USART2_IRQHandler, (tHandler)Usart2Handler);  //pointing out the handler

Offline

 

  • Index
  •  » circleOS
  •  » Definitive Usart2 with interrupt handler

Board footer