Although the contest submissions have ended, I have not abandon my project and continue to work and improve on it in an effort to get to some sort of level of completion.  The issues I had run into on my part could have been prevented had I looked at the modules available within the TI SDKs and see what effort it would take to combine my own effort with these SDK modules.  However, I did not have a crystal ball and could not have predicted the issues I would run into without knowing how the module worked in the first place. I know more now.

I am not sure how long I will be allowed to post to this, but will do so to keep the project info together if possible.


So , part of my switch in project, was to use the The SimpleLink™ SDK Bluetooth Plugin for the MSP432, more specifically Project 0.


This can be accomplished by added the Bluetooth Plugin to the main project via Properties:



The way this is designed is that the main project and the TI-RTOS part are in separate projects within the workspace. I highlight the two projects that I am using for this after setting things to GCC. The other projects are my attempt with my original C++ project that still fails to compile as well as the original Project 0 project folders:


With this, the config file for the combined project is located under the tirtos_builds_# folder (seen as release.cfg above), so if there are any overall project settings needed, these are made in this location.


One of the main issues I ran into was that I had tasks with associated semaphores used to control difference events in the tasks that were in separate files in my main project folder.  This seems to pose an issue with the BIOS kernel in that it seems to treat items such as tasks and semaphores defined in a file as static to that particular file and is not visible to other tasks located in another file.

To get around this, I ended up putting these tasks and associated semaphores into the release.cfg file and then added the 'global' define into the appropriate file where these are referenced.


These are defined in the .cfg as such:


/* create ADC Task */
var task8Params = new Task.Params(); = "adcTask";
task8Params.arg0 = 200000;
task8Params.stackSize = 1024;
task8Params.priority = 3; = Task.create("&taskADCSample", task8Params);

/* create Menu task */
var menutaskParams = new Task.Params(); = "mainMenuTask";
menutaskParams.arg0 = 30000;
menutaskParams.stackSize = 4096;
menutaskParams.priority = 1; = Task.create("&MainMenu_taskFxn", menutaskParams);

/* Create a menu static semaphore */
var semaphore0Params = new Semaphore.Params(); = "semaphore0";
semaphore0Params.mode = Semaphore.Mode_BINARY; = Semaphore.create(0, semaphore0Params);

/* Create a adc static semaphore */
var semaphoreADCParams = new Semaphore.Params(); = "semaphoreADC";
semaphoreADCParams.mode = Semaphore.Mode_BINARY; = Semaphore.create(0, semaphoreADCParams);

/* Create a menu static semaphore */
var semaphoreMenuParams = new Semaphore.Params(); = "semaphoreMenu";
semaphoreMenuParams.mode = Semaphore.Mode_BINARY; = Semaphore.create(0, semaphoreMenuParams);


When these need to be referenced, the following needs to be added to the file includes:

#include <xdc/std.h>
#include <xdc/cfg/global.h>
#include <xdc/runtime/System.h>



This resolved the issue I had with referencing the tasks and semaphores in my project.


Since I abandoned using C++ in this project, I ended up switching to attempting to mimic this by using structs:


I defined the structure of my menu as such:

#define MENUIDSIZE  10

struct myMenu {
    char const *menuID;
    int currentItem;
    int listVal;
    char const *menuList[MENULISTNUM];

typedef enum menuStuff {MAIN_MENU, DB_MENU, USER_MENU, EXIT } menus;
typedef enum menuItems {ITEM1, ITEM2, ITEM3 } M_ITEMS;

typedef struct menuState {
    menus thisMenu;
    M_ITEMS m_Items;
} mStates;

extern volatile mStates m_States;


Then where these are referenced, I created the menu items:

/* Menu defines  */
volatile int16_t m_numItems = 0;
volatile mStates m_States;

struct myMenu mainMenu = {"Main Menu", 0, 3, {"1. db Menu", "2. User Menu", "3. Exit"}};
struct myMenu dbMenu = {"db Menu", 0, 3, {"1. Show Level", "2. Show Thresh", "3. Exit"}};
struct myMenu userMenu = {"User Menu", 0, 3, {"1. Show ID", "2. Show User", "3. Exit"}};

volatile uint8_t itemSelect = 0;
volatile uint8_t menuMode = 0;



This is fairly close to what I had with the classes but without the getters and setters so that had to be handled separately.

This also required minimal changes to the way I was displaying the menu when selected from the MSP432 launchpad buttons.


The end results thus far is shown in the video below:


I continue to work on this and have not abandoned it and will continue to update this as I am allowed to, or move the postings elsewhere.