Pc386 bsp problem

Arquer Stephane stephane.arquer at stage.cnes.fr
Mon May 14 15:34:24 UTC 2007



> -----Message d'origine-----
> De : Daron Chabot [mailto:djc915 at mail.usask.ca] 
> Envoyé : lundi 14 mai 2007 15:37
> À : Arquer Stephane
> Cc : RTEMS
> Objet : Re: RE : Pc386 bsp problem
> 
> 
> 
> On 14-May-07, at 3:12 AM, Arquer Stephane wrote:
> 
> > Hi,
> >
> > Effectively, 50 microseconds was originily set to generate a clock
> > at 32Hz.
> > But I don't use it for the moment.
> 
> Setting CONFIGURE_MICROSECONDS_PER_TICK to 50 will generate  
> interrupts at 20000 Hz.

To generate a clock at 32Hz precisely, I needed to create a period with a precision of 50 microseconds due to 0.03125 seconds of clock period.
Anyway at this time I don't want to work at this period. So I've changed this parameter to 1000 (normaly 1 tick every 1 ms ).


> 
> >
> > I changed this defines to avoid any other problems:
> > #define CONFIGURE_MICROSECONDS_PER_TICK	1000
> > #define CONFIGURE_INIT_TASK_ATTRIBUTES	RTEMS_FLOATING_POINT +  
> > RTEMS_GLOBAL
> >
> > The tasks are created to use floating point, I think the creation
> > function tdemar is correct.
> >
> > Attached, you 'll find the code I use.
> 
> Hmmmm... What exactly is the nature of the failure you are seeing ?

The failure is an execption raised bay the "simuLoi" task when it calls the step function.
The task is canceled by the scheduler, only "trwsr" and "trwsw" are running for a moment then a complete crash occurs.
When I compile the same code with the leon3 bsp, tsim simulator works fine.

> 
> I see that you've configured the "trwsr" , "trwsw" , and "simuLoi"  
> threads with RTEMS_MINIMUM_STACK_SIZE.  IIRC, this is 4 kB, 
> which may  
> be inadequate if your application is floating-point intensive.

I configured an EXTRA_TASK_STACK to add more space to the task data. It isn't correct ? 

Yes I use floating point calculation in the simulink regulation law.



> 
> However, of more concern to me is the RTEMS_GLOBAL attribute you've  
> assigned to these threads. I have no idea what the effect will be on  
> your single-processor system.
> 
> -- dc
> 
> >
> > Thanks.
> >
> > Stéphane.
> >
> >> -----Message d'origine-----
> >> De : Daron Chabot [mailto:daron.chabot at usask.ca]
> >> Envoyé : vendredi 11 mai 2007 17:49
> >> À : Arquer Stephane
> >> Cc : rtems-users at rtems.org
> >> Objet : Re: Pc386 bsp problem
> >>
> >>
> >> Without seeing the code in question, it's difficult to 
> diagnose. But, 
> >> as a general comment, 50 microseconds per tick is 
> *extremely* fast: 
> >> your system will spend a good portion of each tick responding to 
> >> timer interrupts...
> >>
> >>
> >> -- dc
> >>
> >> On Fri, 2007-05-11 at 16:09 +0200, Arquer Stephane wrote:
> >>> Hi,
> >>>
> >>> I am trying to work with code generated by matlab RTW. This
> >> soft must
> >>> be able to run under a Leon 3 or a pc386 platform. I work 
> with Tsim 
> >>> and my code seems to work correcly but when I try to run it
> >> on a pc,
> >>> the task calling the matlab step function crash.
> >>>
> >>> Is there a specific configuration to do ?
> >>>
> >>> This is my init configuration variables:
> >>>
> >>>
> >>> #define CONFIGURE_TEST_NEEDS_CONSOLE_DRIVER
> >>> #define CONFIGURE_TEST_NEEDS_CLOCK_DRIVER
> >>> #define CONFIGURE_TEST_NEEDS_TIMER_DRIVER
> >>>
> >>> #define CONFIGURE_INIT_TASK_PRIORITY			110
> >>>
> >>> #define CONFIGURE_MAXIMUM_TASKS				
> >> 	128
> >>> #define CONFIGURE_MAXIMUM_SEMAPHORES			20
> >>> #define CONFIGURE_MAXIMUM_MESSAGE_QUEUES		10
> >>> #define CONFIGURE_MAXIMUM_TIMERS				16
> >>> #define CONFIGURE_MAXIMUM_PERIODS				16
> >>>
> >>> #define CONFIGURE_MICROSECONDS_PER_TICK			
> >> 50		// 1 tick toute les 50µs
> >>> #define CONFIGURE_TICKS_PER_TIMESLICE			200
> >>>
> >>> #define CONFIGURE_RTEMS_INIT_TASKS_TABLE
> >>>
> >>> #ifdef pc386
> >>> #define CONFIGURE_HAS_OWN_DEVICE_DRIVER_TABLE
> >> rtems_driver_address_table Device_drivers[5] = {
> >> CONSOLE_DRIVER_TABLE_ENTRY,    TTY1_DRIVER_TABLE_ENTRY,
> >>>    TTY2_DRIVER_TABLE_ENTRY,
> >>>    CLOCK_DRIVER_TABLE_ENTRY,    {NULL, NULL, NULL, NULL,
> >> NULL, NULL} }; #endif	//pc386
> >>>  #define CONFIGURE_EXTRA_TASK_STACKS         (3 *
> >> RTEMS_MINIMUM_STACK_SIZE)
> >>> #define CONFIGURE_NUMBER_OF_TERMIOS_PORTS		10
> >>> #define CONFIGURE_LIBIO_MAXIMUM_FILE_DESCRIPTORS	10
> >>>
> >>> #include <confdefs.h>
> >>>
> >>>
> >>> Regards.
> >>>
> >>> Stephane.
> >>>
> >>> _______________________________________________
> >>> rtems-users mailing list
> >>> rtems-users at rtems.com 
> >>> http://rtems.rtems.org/mailman/listinfo/rtems-users
> >>
> >>
> >> <init.h>
> >> <init.c>
> >> <gestionModeleSimulink.c>
> >> <gestionModeleSimulink.h>
> 
> 




More information about the users mailing list