Lab work done to complete the UTAustinX class Real-Time Bluetooth Networks-Shape the World is contained within this repository.
The Lab 1 starter project using the LaunchPad and the Educational BoosterPack MK-II (BOOSTXL-EDUMKII) is a fitness device. It inputs from the microphone, accelerometer, light sensor and buttons. It performs some simple measurements and calculations of steps, sound intensity, and light intensity. It outputs data to the LCD and it generates simple beeping sounds. Figure Lab1.1 shows the data flow graph of Lab 1. Your assignment in Lab 1 is to increase the rate of Task0 from 10 to 1000 Hz.
A scheduler was developed that runs two periodic event threads and four main threads. The SysTick Interrupt handler was written in assembly code and branched to a C function that scheduled threads. The main threads ran on a round robin scheduler. Semaphores and mailboxes were also used to synchronize threads.
The semaphores were reworked from spinlock to blocking. Periodic event tasks were implemented with dedicated timer interrupts. A FIFO queue was developed to implement data flow from producer to consumer. A sleeping mechanism was developed to recover wasted time. The round-robin scheduler is capable of implementing blocking and sleeping.
Priority was added to the thread control block. In addition to the periodic interrupts, edge-triggered interrupts are used. On the occurrence of an interrupt, the operating system signals one or more semaphores and then runs the scheduler. Assigning high priority to event threads reduces latency and jitter.
A simple file system was created with the following usage restrictions/specifications:
- The 128k flash memory is erased only once at the time of downloading the project;
- The act of erasing the entire flash is equivalent to "formatting" the disk;
- The disk is partitioned into 256 sectors of 512 bytes/sector;
- We can append data to a file but cannot delete data or files;
- We append data to a file in chunks of 512 bytes;
- We will read data in a sequential fashion;
- We assign file names as single 8-bit numbers (0 to 254);
- We limit the file system to a maximum of 255 files;
- We will mount (initialize the driver) the file system on startup;
- We will call flush (backup to disk) the file system before powering down.
This was done on four layers of abstraction:
- Physical layer with actions performed by the FlashProgram module.
- Disk layer which is implemented by the eDisk module.
- File system layer implemented with the eFile module.
- Uppermost layer containing the main function.
The objectives of Lab 6 are:
- Interface the 2650 BLE module to the LaunchPad
- Develop a set of NPI message packets to support BLE communication
- Connect the fitness device to a cell phone
- Understand the concepts of service, characteristic, and advertising