2007-01-18 12:47 AM
2011-05-17 12:35 AM
Hi!
I have a problem with StartUp in RIDE IDE. I use the STR912F processor and I have two development environments - KEIL uVision and Raisonance RIDE IDE. If I make the project in Keil, I must use the StartUp file str91x.s and configure the needed parameters. it's easy configurable by ''Wizard Configuration''. Can I do something like this in Raisonance RIDE? How can I configure the StartUp file in Raisonance? For example: If I use the interrupts of TIMMERS, I must enable the clock gating for timmers in Peripheral Clock Gating Register.(in StartUp) I have the same code in both of environments, but I can´t run the program in RIDE correctly. How can I configure the initial parametres of the chip? Thanks2011-05-17 12:35 AM
Hi hanzz,
Could you be more precise on the error messages? :o if you are working with ST lib,try to comment,in Conf.h, the line below to put the library in release mode ;) //#define DEBUG Goodluck :-]2011-05-17 12:35 AM
Hi MBS!
Thanks for you reply, but it is not what I need. I am able to translate the program and load to the Flash memory. The problem isn't in program code. But I don't know how to make available the interrupt routine in str91x.it file. The program is correct, but the interrupt routine is not called. In Keil uVision it runs all correctly - all required peripheral parameters are set in StartUp file. I don´t know how to set them in Raisonance RIDE environment regards [ This message was edited by: hanzz on 12-01-2007 14:00 ]2011-05-17 12:35 AM
Hi hanzz;
First, you have to give the clock to VIC, after, configure the VIC and enable the interruption. (See the list of VIC interrupt channels in the Reference manual.) :D Finally, write the code in the corresponding interrupt function. Now it should work! Find attached a simple project with watch dog which could be helpful (I work on ST evalboard STR910). Good luck mirou2011-05-17 12:35 AM
Hi,
There was a bug in an earlier version of the STR9 startup installed by RIDE. It was related to the interrupts, so it could be your problem. (but I'm not sure I understand your description of the problem correctly) Please make sure that you have the latest version of RIDE for STRx: ''BN746-P1''. (click ''help''->''about'') The BN746 and all versions before it had the problem, and patch P1 corrected it. If you have ''BN746'' or ''BN746_1'', then you'll just need to download and install the patch. If you have an older version, then you'll have to upgrade to BN746 first. All these downloads are available for free there: Best Regards, Vincent [ This message was edited by: VincentC on 15-01-2007 17:43 ]2011-05-17 12:35 AM
One more thing:
When you are sure you have the latest version, you can try this example, which uses interrupts and which I personally tested: C:\RIDE\LIB\STRX\STR91X_LIB\EXAMPLES\ADC\EXAMPLE2\... BR Vincent2011-05-17 12:35 AM
I have the same problem with STR912FW44. I want to use the timer0 in this very simple program:
*****************mainn.c******************** #include ''91x_lib.h'' TIM_InitTypeDef TIM_InitStructure; GPIO_InitTypeDef GPIO_InitStructure; u8 Value=1; long int i=0; /******************************************************************************* * Function Name : main * Description : Main program * Input : None * Output : None * Return : None *******************************************************************************/ int main(void) { #ifdef DEBUG debug(); #endif SCU_APBPeriphClockConfig(__TIM01, ENABLE); /* Enable the clock for TIM0 and TIM1 */ TIM_DeInit(TIM0); /* TIM0 Deinitialization */ SCU_APBPeriphClockConfig(__GPIO6, ENABLE); /* Enable the clock for GPIO9 */ GPIO_DeInit(GPIO6); /* GPIO9 Deinitialization */ SCU_AHBPeriphClockConfig(__VIC, ENABLE); VIC_DeInit(); GPIO_DeInit(GPIO6); GPIO_InitStructure.GPIO_Direction = GPIO_PinOutput; GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3; GPIO_InitStructure.GPIO_Type = GPIO_Type_PushPull ; GPIO_InitStructure.GPIO_Alternate = GPIO_OutputAlt1; GPIO_Init (GPIO6, &GPIO_InitStructure); /* TIM0 Structure Initialization */ TIM_StructInit(&TIM_InitStructure); /* TIM0 Configuration in PWM Mode */ TIM_InitStructure.TIM_Mode = TIM_PWM; TIM_InitStructure.TIM_Clock_Source = TIM_CLK_APB; TIM_InitStructure.TIM_Prescaler = 0xFF; TIM_InitStructure.TIM_Pulse_Level_1 = TIM_HIGH; TIM_InitStructure.TIM_Period_Level = TIM_LOW; TIM_InitStructure.TIM_Pulse_Length_1 = 0x3FF; TIM_InitStructure.TIM_Full_Period = 0xFFF; TIM_DeInit(TIM0); TIM_Init (TIM0, &TIM_InitStructure); VIC_DeInit(); VIC_Config(TIM0_ITLine, VIC_IRQ, 0); VIC_ITCmd(TIM0_ITLine, ENABLE); TIM_ITConfig(TIM0, TIM_IT_TO, ENABLE); TIM_CounterCmd(TIM0, TIM_CLEAR); TIM_CounterCmd(TIM0, TIM_START); GPIO_WriteBit(GPIO6,GPIO_Pin_0,Bit_RESET); while(1) { for(i=0;i!=200000;i++); GPIO_WriteBit(GPIO6,GPIO_Pin_1,Value); Value=!Value; } } *****************91x_it.c****************** void TIM0_IRQHandler(void) { GPIO_WriteBit(GPIO9,GPIO_Pin_2,Bit_RESET); TIM_ClearFlag(TIM0, TIM_FLAG_TO); } I used for translation ''RIDE IDE BN745'' and evaluation board REva v2.0. But program didn't work all correctly. The command ''TIM_CounterCmd(TIM0, TIM_START);'' stopped (or destroyed) the execution of the program in the chip (LED 1 are for ever shining). This command had influece on the neverending loop ''while(1)'' and the interrupt rutine weren't calling. When I debugged this program in the virtual machine mode I didn't find any errors which blocked the function of the loop. When I use BN746 with patch P1,the TIM_Counter command works correctly, but interrupts don't. :-[ I don't have any problems with this program when I work in Keil. Has anybody the user manual of the GNU ARM compiler with the syntax of C code? [ This message was edited by: Vendelin on 16-01-2007 14:15 ] [ This message was edited by: Vendelin on 16-01-2007 14:17 ]2011-05-17 12:35 AM
Hi,
First, please make sure that you have ''BN746-P1'' and not ''BN746_1'', which are two different things. If you do have the correct ''BN746-P1'', then please try the ADC example as I explain in my previous post and tell me if it works. Please also make sure that you are not using the old startup from BN745. We saw that happening when a customer copied it in his project's folder, and updated RIDE afterwards. Maybe you did the same...? If you still don't manage to make your interrupts work, then please send an email to ''support@raisonance.com'' including an example project showing the problem. (send the complete project including all files: .c, .h, .prj, .lst, etc) Best Regards, Vincent2011-05-17 12:35 AM
I just re-read your post and saw you were asking about the docs...
You should find all the documentation you need there: (in RIDE) ''help''->''PDF''->''STRx tools''->... Especially in these three documents: Getting Started STRx STR9x-lib manual Compiler (GCC) manual BR Vincent