
The Erika Kernel Dr. Paolo Gai Evidence S.r.l. Pisa, Italy Email: [email protected] FLEX boards a quick introduction …in collaboration with 2 some details …and also… FLEX Others • cheap! (99-119 €) • switching power supply • small size (7x10 cm) • big! • 100 pin dsPIC • limited pin counts MCU • resettable fuses • all pins free on connectors • most of the pins used for • dsPIC programming from USB (march 2008) LEDs, buttons, … • 2.54 pitch, • difficult to expand! • daughter boards (Thru Hole, CAN, Ethernet, SPI, no SMD expertise required! RS232, RS485, RS422, …) • PIC18 for USB connection • no USB • software included 3 4 hardware – Flex Light hardware – Flex Full 5 6 board layout thru hole and multibus board Available: add-on boards • Thru Hole • MltibsMultibus (2xCAN, SPI, I2C, Serial, Main processing board 232, 485, 422, TTL, Ethernet) 7 8 demo board demo2 (motion) board 2 DC motors+2Enc plugin LCD 2x16 2 Servo+touchscreen plugin 8 LED 4 buttons Ethernet 3-axis Accelerometer CAN 2 DAC Serial module Temperature sensor I2C (Lego NXT) Light sensor Dip switch Infrared I/O buttons RS232/485/422 socket leds zigbee connector 3-axis accelerometer buzzer Zigbee connector potentiometer trimmer IR in-out eeprom serial I/O 9 10 FLEX mini Amazing Ball PIC24FJ64JA004 (16 Mhz) Ball & plate PIC battery monitor Real-time clock demo2 board 1KB Serial EEProm 2 servo motors ZigBee touchscreen Pins for PICkit programming power supply 3-axis accelerometer Buzzer ScicosLab support Thermal sensor Light sensor 2 x DIP switches 2 x LEDs 9 V battery connector + DC in jack 11 12 summary • ERIKA Enterprise features • comparison of the various versions ERIKA Enterprise • OIL definition for Microchip dsPIC ® DSC Configuration details 13 14 erika enterprise - features http://erika.tuxfamily.org supported API • OSEK OS (BCC1, BCC2, ECC1, ECC2) • OSEK OIL 1.4.1 ERIKA Enterprise • OSEK ORTI 2.1.1 for Lauterbach Trace32 support for • basic (with stack sharing) / extended tasks • resources • events • hooks • alarms 15 16 erika enterprise erika enterprise – licensing and RT-Druid currently available for ERIKA is distributed under the GPL with linking exception • Microchip dsPIC license (also known as GNU Crosstool license) • ARM7TDMI (Samsung KS32C50100, UniBo MPARM) • AVR • Nios II (with multicore support) ERIKA Enterprise is available together with the RT-Druid • ARM7TDMI (Triscend A7, ST Janus, ST STA2051) IDE code generator • Tricore 1.3 • PPC e200 z7 Mamba • PIC32 (will soon be released under the EPL) • Lattice MICO32 and also for • Hitachi H8 (RCX/Lego Mindstorms) • integrated into Eclipse • C167/ST10 (Ertec EVA 167, tiny/large mem. model) • code generation for ERIKA Enterprise 17 18 comparison comparison (2) *CC* FP, EDF, FRSH Error Handling and Hooks Conformance classes • error codes, standard and • No extended status • BCC1, BCC2, • FP (similar to BCC2, ECC1, ECC2 or ECC2 if multistack), EDF, • support for ErrorHook and • No FRSH macros Startup /Shutdown PreTaskHook / PostTaskHook • StartOS, application modes, • No, the main is already the • Support for PreTaskHook and • No StartupHook, autostartSystem main thread! PostTaskHook / nothing Shutdown • ShutdownOS and • No ORTI ShutdownHook • Yes (Nios II) • Yes (FRSH on Nios II) 19 20 comparison (3) comparison (4) Task Number of pending activations • TerminateTask and ChainTask • No (less RAM!) • BCC1 and ECC1 = only one • the number of pending pending activation. activations as an integer value, Informations on tasks BCC2 and ECC2 = more than maximum value is one (in OIL file), activations of implementation dependent. No • GetTaskID and GetTaskState • No (monostack does not have a task state!) tasks with same priorities in FIFO order. FIFO order Basic / extended tasks • Basic and Extended Tasks • blocking primitives to be called within tasks with a private Events stack • Yes, in ECC1 and ECC2 • No 21 22 comparison (5) erika enterprise Blocking / non-blocking • OSEK BCC1, monostack, 2 Tasks, 1 resource, dsPIC semaphores Code footprint (24-bit instructions): 379 (1137 bytes) • ECC1/ECC2 Blocking and non • Semaphore primitives only in • ISR2 stub (for each IRQ) 27 blocking semaphores multistack configuration. • IRQ end 36 • BCC1/BCC2 non blocking • Synchronization objects • kernel global functions 99 semaphores available for FRSH • ActivateTask 57 • GetResource 12 Primitives for disabling interrupts • ReleaseResource 41 • Yes • No • StartOS 26 • Task end (TerminateTask) 81 Data footprint (bytes) • ROM 18 • RAM 52 23 24 erika enterprise board support for dsPIC • FP kernel, monostack, 4 tasks, 1 resource, dsPIC ERIKA Enterprise supports the following boards: • Evidence / Embedded Solutions FLEX board Code footprint (24-bit instructions): 244 (732 bytes) supported devices: LEDs, various external devices using add-on • ISR2 stub (for each IRQ) 24 boards • IRQ end 23 • Microchip Explorer 16 • kernel global functions 67 • ActivateTask 43 both PIC33 and PIC24 • GetResource + ReleaseResource 42 supported devices: LEDs, Buttons, LCD, Analog • Task end 45 • Microchip dsPICDEM 1.1 Plus supported devices: LEDs, Buttons, LCD, Analog, Data footprint (bytes) Audio (tbd) • ROM 26 • RAM 42 25 26 OIL for EE OIL (OS object) • the OIL presented in the following slides is a subset of definition example the OSEK OIL standard OIL_VERSION = "2.4"; CPU mySystem { IMPLEMENTATION ee { • it is a quick tutorial to the OIL definition which can be OS { OS myOs { used for ERIKA Enterprise on the Microchip dsPIC ® STRING EE_OPT[]; EE_OPT = "DEBUG"; DSC STRING CFLAGS[]; EE_OPT = “MYDEFINE”; STRING ASFLAGS[]; • tocolmnstwo columns STRING LDFLAGS[]; CFLAGS = – the first column contains the definition STRING LDDEPS[]; "-IC:/…/scicos"; STRING LIBS[]; – the second column contains examples BOOLEAN USERESSCHEDULER = USERESSCHEDULER = FALSE; • it does not include EDF or FRSH OIL details TRUE; […] 27 28 OIL (OS object : CPU data) OIL (OS object : MCU data) definition example ENUM [ MCU_DATA = PIC30 { ENUM [ PIC30 { MODEL = PIC33FJ256GP710; CPU_DATA = PIC30 { […] ENUM [ }; PIC30 { APP_SRC = "code.c"; CUSTOM { STRING APP_SRC[]; MULTI_STACK = FALSE; ICD2 = TRUE; STRING MODEL; BOOLEAN [ MCU_DATA = PIC30 { TRUE { }; STRING LINKERSCRIPT; MODEL = CUSTOM { BOOLEAN [ STRING DEV_LIB; TRUE { LINKERSCRIPT = UINT32 SYSSYS_SIZE; SIZE; CPU_DATA = PIC30 { STRING INCLUDE_C; "p33FJ256GP710.gld"; }, APP_SRC = "code.c"; STRING INCLUDE_S; DEV_LIB = FALSE MULTI_STACK = TRUE { }, "libp33FJ256GP710-elf.a"; IRQ_STACK = TRUE { ] IRQ_STACK; PIC24FJ128GA006, INCLUDE_C = }, SYS_SIZE=64; "p33FJ256GP710.h"; }; PIC24FJ128GA008, FALSE INCLUDE_S = ] MULTI_STACK = FALSE; }; […] "p33FJ256GP710.inc"; ICD2 = TRUE; BOOLEAN ICD2 = FALSE; ] MODEL; }; ENABLE_SPLIM = TRUE; BOOLEAN ENABLE_SPLIM = TRUE; } }; }, }; ] CPU_DATA[]; ] MCU_DATA; 29 30 OIL (OS Object: board data) OIL (OS Object: libraries and kernel type) ENUM [ BOARD_DATA = ENUM [ definitionLIB = ENABLE example { NO_BOARD, MICROCHIP_EXPLORER16 { ENABLE { NAME = SCICOS; EE_FLEX { USELEDS = TRUE; STRING NAME; }; BOOLEAN USELEDS; USEBUTTONS = TRUE; } }, USELCD = TRUE; MICROCHIP_EXPLORER16 { USEANALOG = TRUE; ] LIB; KERNEL_TYPE = FP; BOOLEAN USELEDS; }; }; BOOLEAN USEBUTTONS; ENUM [ BOOLEAN USELCD; BOARD_DATA = EE_FLEX { FP { BOOLEAN USEANALOG; USELEDS = TRUE; BOOLEAN NESTED_Q; IRQ; } }; }, MICROCHIP_DSPICDEM11PLUS { BCC1, BOOLEAN USELEDS; BOARD_DATA = BOOLEAN USEBUTTONS; MICROCHIP_DSPICDEM11PLUS { BCC2, BOOLEAN USELCD; USELEDS = TRUE; ECC1, BOOLEAN USEANALOG; USEBUTTONS = TRUE; ECC2 BOOLEAN USEAUDIO; USELCD = TRUE; ] KERNEL_TYPE; } }; }; … ] BOARD_DATA = NO_BOARD; 31 32 OIL (tasks) OIL (resources) TASK { TASK TaskFlash { RESOURCE { TASK LowTask { UINT32 PRIORITY; PRIORITY = 1; ENUM [ RESOURCE = "myResource"; UINT32 ACTIVATION = 1; STACK = SHARED; STANDARD { […] ENUM [NON, FULL] SCHEDULE; SCHEDULE = FULL; STRING APP_SRC[]; }; TYPE RESOURCE[]; }; }, ENUM [ […] RESOURCE myResource { SHARED, TASK Producer { PRIVATE { PRIORITY = 2; ] RESOURCEPROPERTY; RESOURCEPROPERTY=STANDARD; UINT32 SYS_; SIZE; STACK = PRIVATE { }; }; } SYS_SIZE = 64; ] STACK = SHARED; }; }; SCHEDULE = FULL; }; 33 34 OIL (counters and alarms) COUNTER { COUNTER myCounter; […] }; ALARM AlarmFlash { ALARM { COUNTER = "myCounter"; COUNTER_TYPE COUNTER; ACTION = ACTIVATETASK { ENUM [ TASK = "TaskFlash"; ACTIVATETASK { }; TASK_TYPE TASK; }; }, […] ALARMCALLBACK { STRING ALARMCALLBACKNAME; } ] ACTION; }; }; 35 Real-time kernels for embedded systems part I Paolo Gai embedded systems Evidence Srl - http://www.evidence.eu.com typical features Evidence Srl - [email protected] – 2008 Evidence Srl - [email protected] – 2008 software used in automotive systems typical microcontroller features The software in powertrain systems let's try to highlight a typical scenario that applies to embedde boot and microcontroller related features platforms real-time operating system embedded microcontroller provides abstractions (for example: task, semaphores, …) depending on the project, that microcontroller will be @ 8, 16, or 32 an interaction model between hardware and application bit separates behavior from infrastructures typically comes with a rich set of interfaces debugging simplification timers (counters / CAPCOM / Watchdog / PWM) A/D and D/A I/O Libraries communication interfaces (I2C, RS232, CAN, Infrared, ...) completes the OS with the support of the platform HW ~50 interrupts (the original PC interrupt controller had only 15!!!) 10 times bigger than a minimal OS memory application SRAM / FLASH / ... implements only the behavior and not the infrastructures
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages28 Page
-
File Size-