System Reboot
The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 864 - File: showthread.php PHP 7.2.30 (Linux)
File Line Function
/showthread.php 864 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
System Reboot
#1
We've found that occasionally rebooting the Bpod and AOM helps things run smoothly (occasionally the system can get in a non-functional state and this is the only way to get it out, though we're still trying to figure out exactly what's causing the non-functional state).  Since the power comes from the USB hub on the computer, rebooting or even powering the computer down does not cut power to the teensy.  So to force a reboot in the bpod we added the following code to the firmware in the section that starts

if ((PC.available() > 0) && (smaPending == false)) {
CommandByte = PC.readByte();

switch (CommandByte) {

case 'Q':  // SYSTEM RESET
          digitalWrite(GreenLEDPin, LOW);
          analogWrite(BlueLEDPin, 250);
          analogWrite(RedLEDPin, 128);
          delay(1000);
          SCB_AIRCR = 0x05fa0004;
      break;

Sending a Q causes the LED to turn magenta for 1s before it reboots and the LED goes back to blue flashing.

For the AOM we added the following in the section that starts

if (newOpCode) {
newOpCode = false;
switch(opCode) {

case 'Q': // SYSTEM RESET
        stopPlayback();
        SCB_AIRCR = 0x05fa0004;
      break;

Sending a Q will stop sounds and reboot the teensy causing the orange light to blink. 

We've added these commands to the function EndBpod.m after the write Z command

 BpodSystem.SerialPort.write('Z', 'uint8');
 pause(1);
 BpodSystem.PluginObjects.SoundServer.Port.write('Q','uint8')
 pause(1);
 BpodSystem.SerialPort.write('Q', 'uint8');
              


Just a thought to maybe include in other module firmware if people are having any issues.

Chuck
Reply


Messages In This Thread
System Reboot - by ckopec - 02-18-2020, 07:10 PM
RE: System Reboot - by Josh - 02-18-2020, 07:47 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)