Freescale S12

From ErikaWiki

(Difference between revisions)
Jump to: navigation, search
(MCUs)
Line 97: Line 97:
= How to run MODISTARC regression tests =
= How to run MODISTARC regression tests =
* [[A brief description on how to run MODISTARC regression tests for Freescale S12XS]]
* [[A brief description on how to run MODISTARC regression tests for Freescale S12XS]]
 +
 +
 +
[[Category:Supported Devices]]

Revision as of 08:59, 7 April 2011

Contents

Freescale S12 support

ERIKA Enterprise supports HCS12X microcontrollers. The support for RT-Druid is now available on release 1.5.0. The HCS12X support includes:

  1. support for COSMIC compiler.
  2. support for single and multi stack configurations (multi stack will be available soon...).
  3. ISR interrupt supported.
  4. support for Freescale Debugger.
  • Supported compiler
    • COSMIC C cross compiler and ELF module generation for debugging information.
  • Mode of operation
    • Mono-stack: The Monostack configuration of the ERIKA Kernel models the fact that all tasks and ISRs in the system share the same stack.
    • Multistack HAL: Every thread can have its private stack, or it can share it with other threads.
  • Handling of paging registers
The compiler supports bank switching for code and data, using the internal window mechanism provided by the HCS12X processor.
Bank switching mechanism delivers 32-bit performance with all the advantages and efficiencies of a 16-bit MCU.
Bank switching is supported via:
- @far type qualifier to describe a function relocated in a different bank. Calling such a function implies a special calling
sequence, and a special return sequence. Such a function has to be defined @far and referenced as @far in all the files using
it. The compiler also provides a specific option +modf to automatically consider all the functions to be @far. The @far type
modifier is also used to declared variables allocated in a data bank.
- Linker options are required to ensure proper physical and logical addresses computations. The linker is also able to
automatically fill banks without any need to take care of the page boundaries.

MCUs

  • The MCUs currently supported are the following:
    • Freescale MC9S12XS128; (an efficient 16-bit microcontroller with four modes of operation: normal single chip mode, normal single chip mde with active background debug mode, stop low power mode, wait low power mode).
  • List of functions:
    • void EE_pit0_init( unsigned char pitmtld0, unsigned char pitld0, unsigned char prio ); // To init PIT0
    • void EE_pit0_close( void ); // To close PIT0
    • void EE_pit0_clear_ISRflag( void ); // To clean PIT0 ISR flag
    • void EE_sci_open(unsigned char sci_num, unsigned long int busclock, unsigned long int baudrate); // To open the serial interface
    • void EE_sci_close(unsigned char sci_num); // To close the serial interface
    • Bool EE_sci_send_byte(unsigned char sci_num, unsigned char buffer); // To send a byte
    • Bool EE_sci_send_string(unsigned char sci_num, const char* s, unsigned int num); // to send a string
    • Bool EE_sci_send_bytes(unsigned char sci_num, char* v, unsigned int num); // To send a vector of bytes
    • Bool EE_sci_get_byte(unsigned char sci_num, unsigned char *buffer); // to get a byte
    • Bool EE_sci_getcheck(unsigned char sci_num); // to check the serial reception of a byte

Boards

  • The boards currently supported are the following:
    • SofTec Microsystems DEMO9S12XSFAME demo board.
  • List of functions:
    • void EE_demo9s12xsfame_leds_init(void); // To configure the leds port
    • void EE_demo9s12xsfame_leds( EE_UINT8 data ); // To set the led port vaules
    • void EE_demo9s12xsfame_led_0_on(void); // To turn on LED0
    • void EE_demo9s12xsfame_led_0_off(void); // To turn off LED0
    • void EE_demo9s12xsfame_led_1_on(void); // To turn on LED1
    • void EE_demo9s12xsfame_led_1_off(void); // To turn off LED1
    • void EE_demo9s12xsfame_led_2_on(void); // To turn on LED2
    • void EE_demo9s12xsfame_led_2_off(void); // To turn off LED2
    • void EE_demo9s12xsfame_led_3_on(void); // To turn on LED3
    • void EE_demo9s12xsfame_led_3_off(void); // To turn off LED3
    • void EE_demo9s12xsfame_leds_on(void); // To turn on all the leds
    • void EE_demo9s12xsfame_leds_off(void); // To turn off all the leds
    • void EE_demo9s12xsfame_buttons_init( EE_UINT8 bx, EE_UINT8 prio ); // To init the buttons port
    • void EE_demo9s12xsfame_buttons_close( void ); // To reset the buttons port
    • void EE_demo9s12xsfame_buttons_disable_interrupts( EE_UINT8 bx ); // To disable interrupt related to the buttons
    • void EE_demo9s12xsfame_buttons_enable_interrupts( EE_UINT8 bx ); // To enable interrupt related to the buttons
    • void EE_demo9s12xsfame_buttons_clear_ISRflag( EE_UINT8 bx ); // To clear button ISR flag
    • EE_UINT8 EE_demo9s12xsfame_button_get_B0( void ); // To get the BUTTON0 value
    • EE_UINT8 EE_demo9s12xsfame_button_get_B1( void ); // To get the BUTTON1 value
    • void EE_demo9s12xsfame_adc_init( unsigned char res, unsigned char numconvseq ); // To init ADC
    • void EE_demo9s12xsfame_adc_convert( void ); // To start conversion
    • unsigned int EE_demo9s12xsfame_adc_getvalue( unsigned int adcch ); // To get a value
    • void EE_demo9s12xsfame_adc_close( void ); // To close ADC
    • EE_UINT16 EE_demo9s12xsfame_analog_get_light( void ); // To get light sensor value
    • EE_UINT16 EE_demo9s12xsfame_analog_get_pot( void ); // To get potentiometer value

Examples

  • The examples and tests are available in the new release (see below...).

Download and install pre-release

Procedure for installation:

  • Step 1:
Open Eclipse;
From the menu Help select Install New Software...;
Add with the button Add... the reference site mentioned above (fill the Loaction field with this: http://retis.sssup.it/~durin/rtd_150/site_s12/);
Tick all the plug-ins and install them clicking on the button Next;
Restart Eclipse;
  • Step 2:
From the menu File select New and then RT-Druid Oil and C/C++ Project;
From the Project menu select one of the available S12 demo tests;
Then click on the project name with the right mouse button and build to obtain the elf object module for debugging;

How to build a project in RT-DRUID

How to run MODISTARC regression tests

Personal tools