Go to Post I love losing my voice in the name of F.I.R.S.T :) - Athleticgirl389 [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-04-2009, 17:51
Cadyyan Cadyyan is offline
The Button Man
FRC #1716 (Redbird Robotics)
Team Role: Mentor
 
Join Date: Sep 2008
Rookie Year: 2007
Location: Wisconsin
Posts: 11
Cadyyan is an unknown quantity at this point
VxWorks Kernel

So I've been wondering...I've heard that the VxWorks kernel is open source. Is this true? If it is true where would I be able to download the source code for it?
Thanks for any responces!
~Cadyyan~
__________________
Watch your face!
Reply With Quote
  #2   Spotlight this post!  
Unread 03-04-2009, 17:54
Dave Flowerday Dave Flowerday is offline
Software Engineer
VRC #0111 (Wildstang)
Team Role: Engineer
 
Join Date: Feb 2002
Rookie Year: 1995
Location: North Barrington, IL
Posts: 1,366
Dave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond reputeDave Flowerday has a reputation beyond repute
Re: VxWorks Kernel

Quote:
Originally Posted by Cadyyan View Post
I've heard that the VxWorks kernel is open source. Is this true?
Definitely not.

What are you trying to accomplish? There are plenty of open-source kernels out there if you're interested in browsing some source and learning a bit.
Reply With Quote
  #3   Spotlight this post!  
Unread 03-04-2009, 18:05
Cadyyan Cadyyan is offline
The Button Man
FRC #1716 (Redbird Robotics)
Team Role: Mentor
 
Join Date: Sep 2008
Rookie Year: 2007
Location: Wisconsin
Posts: 11
Cadyyan is an unknown quantity at this point
Re: VxWorks Kernel

I'm currious about how the watchdog actually turns off the robot. I had an idea, not sure if it is already implemented in the library and I just don't know about it, about having the DS display where in the code the watchdog timed out at. I hate having to hunt through code to find watchdog errors when I program blind.
__________________
Watch your face!
Reply With Quote
  #4   Spotlight this post!  
Unread 03-04-2009, 18:25
The Lucas's Avatar
The Lucas The Lucas is offline
CaMOElot, it is a silly place
AKA: My First Name is really "The" (or Brian)
FRC #0365 (The Miracle Workerz); FRC#1495 (AGR); FRC#4342 (Demon)
Team Role: Mentor
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Dela-Where?
Posts: 1,564
The Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond reputeThe Lucas has a reputation beyond repute
Send a message via AIM to The Lucas
Re: VxWorks Kernel

Quote:
Originally Posted by Cadyyan View Post
about having the DS display where in the code the watchdog timed out at.
The watchdog doesn't know where in your code it is when it times out. It just knows it hasn't been fed. I would guess the watchdog is implemented in the FPGA.
__________________
Electrical & Programming Mentor ---Team #365 "The Miracle Workerz"
Programming Mentor ---Team #4342 "Demon Robotics"
Founding Mentor --- Team #1495 Avon Grove High School
2007 CMP Chairman's Award - Thanks to all MOE members (and others) past and present who made it a reality.
Robot Inspector
"I don't think I'm ever more ''aware'' than I am right after I burn my thumb with a soldering iron"
Reply With Quote
  #5   Spotlight this post!  
Unread 03-04-2009, 22:37
RyanCahoon's Avatar
RyanCahoon RyanCahoon is offline
Disassembling my prior presumptions
FRC #0766 (M-A Bears)
Team Role: Engineer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Mountain View
Posts: 689
RyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond reputeRyanCahoon has a reputation beyond repute
Re: VxWorks Kernel

Quote:
Originally Posted by Cadyyan View Post
I'm currious about how the watchdog actually turns off the robot. I had an idea, not sure if it is already implemented in the library and I just don't know about it, about having the DS display where in the code the watchdog timed out at. I hate having to hunt through code to find watchdog errors when I program blind.
The watchdog timer is a hardware device; there's may not even be a dedicated function in the kernel that manages it, because VxWorks can run on many different hardware architectures. While I can't tell you how watchdog is specifically implemented on the cRIOs, I can tell you how they work in general. (For more information, you can also look at the Wikipedia article or one of these articles on NI.com)

One of the fundamental hardware devices in a microcontroller is a hardware timer. The function of such a device is, when told, periodically decrement a number in its internal memory, and then when that number gets to 0, set its output to a high state (output a "1" if you want to think in binary). The processor in the microcontroller is hooked both to control lines for the timer in order to start and stop it and to set the timer's counter value, and to the timer's output line so that the program running can use it like any other digital input (or more commonly the output will be connected to a hardware interrupt line so that the program is actively notified whenever the counter reaches zero). Timers (also called counters) are used for many things in embedded programming, including generating PWM signals to control motors, control operating system scheduling routines, to regulate transmission rates over communication ports such as RS232, I2C, or SPI, etc.

A watchdog timer is a hardware timer whose output line, instead of being connected to an input to the processor, is instead connected to the processor's reset line. Thus if the timer is allowed to reach 0, it will cause the processor to reset. When you first open the watchdog (Watchdog Open.vi or new Watchdog(); ) it enables the watchdog, meaning the watchdog starts counting down. Whenever you feed the watchdog, you are resetting the counter value to a large enough number. Thus, if the watchdog isn't fed often enough, the timer will reach 0 and the processor will reset, all as hardware functions. Because the watchdog is a hardware device, as [The Lucas] pointed out, it's probably connected through the FPGA, as that seems to be how most hardware devices are connected in the cRIO, but this will be part of NI's proprietary hardware design, so I doubt anyone who knows could tell you.

So basically (as [The Lucas] also pointed out) it's not possible to know where the watchdog timed out because if the watchdog is working properly it will only reset when the code is frozen. The best thing you can do is routinely update the DS's display with some indicator of the last thing that was run in your code, and so when the Watchdog throws the display will be stuck there.

Good luck,
--Ryan

P.S. For a good free open source kernel, check out the FreeRTOS project.


EDIT: Looks like link to the second NI article is dead for the moment.
__________________
FRC 2046, 2007-2008, Student member
FRC 1708, 2009-2012, College mentor; 2013-2014, Mentor
FRC 766, 2015-, Mentor
Reply With Quote
  #6   Spotlight this post!  
Unread 04-04-2009, 10:40
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: VxWorks Kernel

The FRC watchdog is not implemented in the kernel, but in the FPGA. cRIO, which NI pronounces see-ree-oh, rather than kree-oh, stands for compact Reconfigurable I/O. The reconfigurable piece is the FPGA which can be used to implement lots of custom circuit fabric.

In the FPGA for FRC, almost all of the outputs are conditional. If the system watchdog timer is happy and fed, then the setpoints for PWMs, relays, etc. will be in control of the I/O. If the watchdog is unhappy and unfed, the outputs are forced to the disabled state.

The watchdog itself is simply a counter, like an egg timer. Each time it is fed, the countdown timer is reset to the watchdog period, ~200ms I think. The e-stop and kill immediately set the value to zero, and prevent a simple feed from enabling again. Much of the watchdog circuitry is actually the interconnection to the I/O.

The system watchdog is completely controlled by the communications protocol. If the system watchdog goes unfed it is because the DS control packets have stopped arriving, or possibly because the task on the cRIO that handles the packets has somehow died and is no longer feeding the watchdog.

The second watchdog, the user watchdog, is also not implemented in the kernel. It is implemented in the WPI layer. If it is used, it must be fed. If your user watchdog goes off, search for the feed calls. It means that NONE of those were called for the watchdog period. Personally, I think there are a number of API changes that can make watchdogs easier and even safer, but that is for another year.

Greg McKaskle
Reply With Quote
  #7   Spotlight this post!  
Unread 04-04-2009, 19:37
Cadyyan Cadyyan is offline
The Button Man
FRC #1716 (Redbird Robotics)
Team Role: Mentor
 
Join Date: Sep 2008
Rookie Year: 2007
Location: Wisconsin
Posts: 11
Cadyyan is an unknown quantity at this point
Re: VxWorks Kernel

Thank you guys for all the great information. I think I have an idea now of where to start. I think I'm just going to update a new class as to specific code events and have it display to the cRIO so that you can look at the last event.
__________________
Watch your face!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Disassemble VxWorks (WindRiver) ELF Binaries? GeneralFailure C/C++ 5 20-01-2009 19:41
Run Kernel Task w/o reboot byteit101 Programming 4 12-01-2009 12:08


All times are GMT -5. The time now is 13:28.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi