Problem with initializing RobotDrive/Talon objects

Hi,

I encountered a unique problem recently, I only found one thread with a similar problem which they didn’t manage to solve(or at least they didn’t post how).

I managed to reduce the problem to the point where I initialize my SpeedControllers, either through RobotDrive or Talon(we use Talon SR) object. When I initialized the the RobotDrive object I received an error in the driver station:
Error -52010 NIFPGA: Resource not initialized(something like this).

Additionally, the driver station said that there is no robot code. Surprisingly when I tried uploading a basically identical iterative robot there was no problem and the robot worked fine.

I tried initializing the Talons directly, this time I didn’t get the previously mentioned error however there was still no robot code.

I get the following error at the breakpoint of the initialization while debugging the robot:
Can’t find a source file at “/var/lib/jenkins/workspace/WPILib/WPILib - Release/hal/lib/athena/DigitalInternal.cpp”

I have tried reimaging, repairing the toolchain, reinstalling the plugins yet nothing seems to solve the problem.

Huge thanks to anyone who tried helping!

If you are seeing “Error -52010 NIFPGA” in the Driver Station after adding a CANTalon, I would recommend reading section 16.36 in latest Talon SRX Software Reference Manual.

For the lazy

16.36. Adding CANTalon to my C++ FRC application causes the Driver Station log to report: ERROR -52010 NIFPGA: Resource not initialized, GetFPGATime, or similar.
A full example of the crashed call stack is below…


ERROR -52010 NIFPGA: Resource not initialized GetFPGATime
[Utility.cpp:171]
Error at GetFPGATime [Utility.cpp:171]: NIFPGA: Resource not initialized
at frc::GetFPGATime()
at frc::Timer::GetFPGATimestamp()
at frc::MotorSafetyHelper::MotorSafetyHelper(frc::MotorSafety*)

… this can happen if a CANTalon is constructed before the C++ WPILIB initialization routine is called. At the time of writing, this condition can occur when cleanly creating a C++ Command-based project with the latest Eclipse Plugins. An example workaround can be found here… 
https://github.com/CrossTheRoadElec/FRC-Examples/commit/24deb61fef6df69f83d5f6436d74df894f7bbf2d
…demonstrating how to ensure motor controller object is constructed after WPILIB initialization.

C++ Command-based projects generated with latest Robot Builder appears to ensure that motor controller objects are created after WPILIB initialization, and therefore do not cause this failure symptom.

More information on C++ Command-based projects can be found at the FRC screenstepslive page, as this is not maintained by CTRE. https://wpilib.screenstepslive.com

Hey that’s cheating.

Wasn’t using Talon SRX but I guess the section applies to all Speed Controllers. Anyways this fixed the problem, so thanks a lot!

That’s how good our support is. :wink: