Error When Deploying Code

When deploying the robot code, I am getting a few errors.

  • Unhandled exception instantiating robot edu.wpi.first.hal.PWMJNI edu.wpi.first.hal.util.UncleanStatusException: Code: -1029. HAL: Resource already allocated

  • Error at frc.robot.subsystems.ClimberSubsystem.<init>(ClimberSubsystem.java:39): Unhandled exception instantiating robot edu.wpi.first.hal.PWMJNI edu.wpi.first.hal.util.UncleanStatusException: Code: -1029. HAL: Resource already allocated

  • at edu.wpi.first.hal.PWMJNI.initializePWMPort(Native Method)

  • at edu.wpi.first.wpilibj.PWM.<init>(PWM.java:63)

  • at edu.wpi.first.wpilibj.PWMSpeedController.<init>(PWMSpeedController.java:25)

  • at edu.wpi.first.wpilibj.Spark.<init>(Spark.java:47)

  • at frc.robot.subsystems.ClimberSubsystem.<init>(ClimberSubsystem.java:39)

  • at frc.robot.Robot.<clinit>(Robot.java:41)

  • at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:221)

  • at frc.robot.Main.main(Main.java:27)

  • Robots should not quit, but yours did!

  • Warning at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:234): Robots should not quit, but yours did!

  • Could not instantiate robot edu.wpi.first.hal.PWMJNI!

  • Error at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:235): Could not instantiate robot edu.wpi.first.hal.PWMJNI!

It was working, and then I changed a small snip-it of code relating to our drive system. When it did not work, I undid what I had changed and the error is still showing up.

If you posted your code it would be easier to tell what exactly the problem was, but it looks like you’ve either instantiated two PWM speed controllers with the same port number, or you never declared your subsystem/motor at all.

Again post your code if you’re still having trouble

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.