element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Safe and Sound
  • Challenges & Projects
  • Design Challenges
  • Safe and Sound
  • More
  • Cancel
Safe and Sound
Blog Safe and Sound Wearables- Hearing Guard System : Postmortem #1
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: jomoenginer
  • Date Created: 24 Jul 2017 3:43 PM Date Created
  • Views 1030 views
  • Likes 3 likes
  • Comments 3 comments
  • 430boost-sharp96
  • msp432
  • safe&sound
  • ti-rtos
Related
Recommended

Safe and Sound Wearables- Hearing Guard System : Postmortem #1

jomoenginer
jomoenginer
24 Jul 2017

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 SimpleLinkTm SDK Bluetooth Plugin for the MSP432, more specifically Project 0.

http://www.ti.com/tool/simplelink-sdk-bluetooth-plugin

 

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

 

image

 

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:

image

 

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();
task8Params.instance.name = "adcTask";
task8Params.arg0 = 200000;
task8Params.stackSize = 1024;
task8Params.priority = 3;
Program.global.adcTask = Task.create("&taskADCSample", task8Params);


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


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


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


/* Create a menu static semaphore */
var semaphoreMenuParams = new Semaphore.Params();
semaphoreMenuParams.instance.name = "semaphoreMenu";
semaphoreMenuParams.mode = Semaphore.Mode_BINARY;
Program.global.semaphoreMenu = 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
#define MENULISTNUM 4
#define MENULISTLENGTH 15


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:

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

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.

  • Sign in to reply

Top Comments

  • DAB
    DAB over 8 years ago +1
    I can sympathize with your learning curve on the TI development software. There is just an overwhelming amount of information, which is good in that they have it, but bad in that you cannot find what you…
  • dougw
    dougw over 8 years ago +1
    Thanks for sharing. I think you can edit and add forever. I've made changes years later....
  • jomoenginer
    jomoenginer over 8 years ago in reply to DAB +1
    It wasn't so much a matter of a learning curve but more an issue where there is no consistency among the examples in the TI SimpleLink SDKs. Also, the lack of support with GCC and C++ was a bit frustrating…
  • jomoenginer
    jomoenginer over 8 years ago in reply to DAB

    It wasn't so much a matter of a learning curve but more an issue where there is no consistency among the examples in the TI SimpleLink SDKs. Also, the lack of support with GCC and C++ was a bit frustrating.  I had one individual on the TI forum suggest that I dump CCS altogether and just go command line.  In the end, I suppose I should have just kept it simple and used the basic samples in Energia and focus on slapping something together in the end.  But, that is not me.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • dougw
    dougw over 8 years ago

    Thanks for sharing. I think you can edit and add forever. I've made changes years later....

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 8 years ago

    I can sympathize with your learning curve on the TI development software.

    There is just an overwhelming amount of information, which is good in that they have it, but bad in that you cannot find what you specifically need without a bit of effort.

     

    Meanwhile I do hope you continue to refine your project and continue to post on Element 14.  You have a very interesting application and I would like to see what you end up with.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube