Jump to content
43oh

edX course Real-Time bluetooth Networks - Shape the World


Recommended Posts

I'm doing Lab #2 right now, which is where you write your first RTOS scheduler and make the whole time-slicing scheduled thread concept work for the first time... and I just want to add, this is a ton of fun!!!

 

Class is taking more time to go through than I thought it would, mostly the lectures, but I'm making time for it here and there.  There are 6 sections to the class and only 1-5 are up right now, #6 I think is the actual communication with the CC2650 Bluetooth Low Energy coprocessor (where you use either the TI CC2650 BoosterPack or the CC2650 LaunchPad in boosterpack mode).  The bulk of the code being run here is already written by the professors in the "BSP" library, e.g. for communicating with the LCD and drawing lines/text, reading the temperature sensor, accelerometer, etc.  Your job is just to learn the specific core facilities that an RTOS provides.

 

The "magic" of an RTOS and simulating multiple threads on a single CPU wasn't as complicated as I thought, and while the particulars of this course only teach ARM's specific way of context switching I generally understand the analysis required to implement this on another chip:

 

1. Understand exactly which registers get pushed onto the stack when an interrupt occurs and in which order

2. Push the remaining registers

3. Know exactly how to exit an ISR correctly - the actual context "switch" relies on this

Link to post
Share on other sites

@@spirilis you're an animal - saw that you'd finished lab 3!  I'm about 1/2 of the way through section 2 - there are a LOT of videos to watch and content to read.  Are you going through both, or just doing one or the other?

Both, although some of the videos I might skim the text interpretation and then skim the content after... all depends.  Excited for lab 4, we get to run a game!!

Link to post
Share on other sites

I just started it yesterday too. I'm kinda late to the party so I figured I'd try to catch-up as much as possible. I've done all of chapter 1 and lab 1 yesterday and watched all of chapter 2 today. I'll do lab 2 tomorrow.

 

There was a LOT of material in chapter 2! None of it is super complicated but there's still a lot of it. It's great to see and understand how an RTOS works though! 

 

I'll certainly go for the verified certificate like for the previous course! :)

Link to post
Share on other sites

One of the cooler things about the course is the casual introduction to various use-cases, section 4.1 particularly.

 

4.1.4, "Real-Time Control Systems" had one of the best descriptions of PID control that I've seen as it involved both practical descriptions and math--including casual mention of such scary terms as "Lorenz transforms" (which I still don't understand) but no requirement that you truly grok them, as the page included very practical advice on what the P/I/D segments do.

 

The 4.1 subsections prior talk about DSP and introduce the MACQ, or Multiple Access Circular Queue, along with tacitly demonstrating an optimization (where you allocate 2X the memory required and maintain 2 copies so that 1 copy can always be walked by simple address incrementing without having to check the circular buffer address boundary).  Having noticed that many DSP oriented chips include hardware support for "circular buffers" (where the address can increment or decrement ad infinitum and the hardware does the modulo/bounds checking for you), I understand now why they're such a big deal.

 

Cool stuff.

Link to post
Share on other sites

@@spirilis

 

Do you think you will apply the RTOS code / techniques developed in this course directly in your own projects or is it more a good educational experience on how things work? Just curious...

My current projects have all used TI-RTOS since the platform basically requires it and/or is unsupported without it (CC1310), so the course has been mostly educational experience, however, I will pay closer attention to the Clock module and use of hardware timer interrupts for clocking any hard-real-time stuff from now on.  The practical advice on handling DSP process flow was useful and I can see that coming into play, the PID stuff too.  I think the use of some sort of tick or GPIO toggle to indicate task switching/execution bears serious consideration -- if TI-RTOS has a "hook" you can execute upon beginning a task (something I will research shortly), that would be a great place to put a GPIO toggle so I can view my tasks' execution & suspension with a logic analyzer.

 

So yeah, some of this & that.  Chips without an RTOS or without one I like, I feel like I'm now armed to build my own.

Link to post
Share on other sites

I'll admit I haven't finished the training on TI-RTOS (next plan after I'm done with this course) - but the concepts introduced in the course are clarifying some of the settings I was seeing with TI-RTOS (Like WTF is StackSize used for).  So I can see this helping my understanding of using another RTOS.

Link to post
Share on other sites
  • 4 weeks later...

I've just completed the course.

 

Fun, although the last lab about BLE was much of copy-paste as some parameters werer rather cryptic.

 

As an exercise, I took Lab 4 and implemented it on a MSP432 with Energia MT and the Galaxia library with embedXcode.

 

No major surprises, clocks, semaphores and mailbox work as expected.

 

post-12238-0-08202300-1478526955_thumb.png

 

Below, the trace of the tasks with a logic analyser.

 

post-12238-0-32137300-1478526920_thumb.jpg

Link to post
Share on other sites
  • 3 weeks later...

Glad to see you guys got the course done!

 

I failed miserably in freeing up time for it. I'm doing a different course (also on edx) for work that is very time demanding (~10-12 hours / week) and was too optimistic in thinking I could squeeze this one in as well.

 

Well, I got the boards at least but I'm getting depressed by having all these boards laying around and no time to do anything with them :(

Link to post
Share on other sites

Yes, it's certainly hard to make time for it sometimes (work, kids and all) but I managed to get half-way into lab 6 so far. I should be done this weekend. I already paid for the verified certificate too.

 

As for the parameters, well, yeah. There's a lot of "magic numbers" used to chat with the CC2650 app (all listed in the datasheet). It's pretty usable once you abstract it away though.

 

Edit: ALL DONE! Finally! 100% on all... Glad to see that certificate! :)

Link to post
Share on other sites
  • 3 years later...

Hello guys,

I completed this course more than 1 year ago, but recently I just finished to implement this RTOS in a C28x processor (C2000 MCU series); The main purpose was to get a deep understanding of how a RTOS, Scheduler, the stack and Priorities work.
For the moment I didn't implement  the code for FIFO Buffer / mailbox. It will be implemented, eventually.

So, in the following two URLs you would find the code, it's open source: Please, fell free to download/clone it and test it:

https://github.com/FranciscoGomezR/Real-Time-Bluetooth-Networks-for-C28x

https://Francisco_GomezR@bitbucket.org/Francisco_GomezR/real-time-bluetooth-networks-for-c28x.git

Your feedback would be appreciated it or even you can contribute with your commits.

image.thumb.png.6c5bf7bfcb42ab569963981a69f9ff3a.png
The RTOS is handling 5 Threads and 3 Periodic Event-Threads, Line5m is the auxiliar HW timer (EventTick) which also is he timer for the Sleep state of each Thread.

Regards

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...