Z IGBEE and OSAL Jaehoon Woo KNU RTLAB. KNU RTLAB.
1. ZIGBEE 2. Z-Stack and OSAL Contents
What’s ZIGBEE ZigBee is a standard networking protocol aimed at the wireless control market. The ZigBee protocol fits on 8-bit microcontrollers, with 16- and 32-bit solutions available.
ZIGBEE is.. Cost-Effective - A single chip solution yields prices in the $3 to $5 range, on averageLow-Power - ZigBee devices can achieve 5 years on a pair of AA batteries. Highly Reliable - ZigBee enhances reliability through mesh networking, acknowledgments and use of the robust IEEE standard. Highly Secure -ZigBee uses AES 128-bit security for encryption and authentication Low Data Rate - ZigBee through-put is typically 25 kilobits per seconds.
ZIGBEE Markets
Network topology
ZIGBEE Stack Architecture IEEE 표준
CC2530
CIRCUIT DESCRIPTION
Why Use an OS? Stack App App Hardware Platform Separate S/W development from H/W development OSAL supports: Task registration, initialization and starting Task synchronization Message exchange between tasks Interrupt handling Timers Memory allocation Power management
OSAL / HAL Z-Stack Application(s) OSAL provides scheduling, memory management and messaging features. HAL provides easy programming access to hardware and isolates the software from the hardware specifics Because of its very limited functionality, the OSAL is not, strictly speaking, considered and Operation System OSAL = Operating System Abstraction Layer HAL = Hardware Abstraction Layer
Tasks, Events and Messages Event… An occurrence used to Trigger a task to run Event… An occurrence used to Trigger a task to run Task… A complete piece of code … A thread Task… A complete piece of code … A thread Message… Information exchanged from One Task to another
Tasks Initialization Code (Setup) Run-Time Code (Processing) Run on OSAL start up Run by OSAL on Event A single tread of code that performs a function can be encompassed in a task A task is made up of an initialization section and a run-time section Once started, a task runs to completion An event causes the run-time section to execute
Task APIs osal_set_event() Sets the event flags for a task – runs task osal_init_system() Creates the tasks defined in the task table osal_start_system() Starts the OSAL main loop osal_self() Returns the ID of the current task
Events Definition : An action to be completed by a Task. event_flag, used for defining the type of event, is 16 bits long 150 SYS_EVENT_MSG(Reserved for OSAL) A special event type used for inter-task communication Event other bit position is managed by the application #define TRANSMITAPP_SEN_MSG_EVT0x0001 #define TRANSMITAPP_RCVTIMER_EVT0x0002 #define TRANSMITAPP_SEND_ERR_EVT0x0004
Messaging … Inter–Task Communication Managed by the OSAL Messaging used for triggering over the air communication as well as internal command messaging between tasks. Commands between tasks use osal_msg_send() to create SYS_EVENT_MSG events Osal_msg_allocate() allocates a bugger for message transfer between tasks Osal_msg_deallocate() deallocated buffer Osal_msg_send() place a message in the buffer Osal_msg_receive() TSK1 TSK2 Message
Scheduling Example Tasks do not pre-empt, but rather run to completion Round-robin task servicing loop
Q&A
Thank you!