Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When ARDI2C is started up it chokes on reading the I2C bus #26

Open
Ximidar opened this issue Apr 22, 2017 · 1 comment
Open

When ARDI2C is started up it chokes on reading the I2C bus #26

Ximidar opened this issue Apr 22, 2017 · 1 comment
Assignees
Labels
Milestone

Comments

@Ximidar
Copy link
Contributor

Ximidar commented Apr 22, 2017

killed: 0

Failed to write reg: Connection timed out
Failed to write reg: Connection timed out
depth: 0

killed: 1

Failed to write reg: Connection timed out
Failed to write reg: Connection timed out
depth: 0

killed: 1

^CFailed to write reg: Connection timed out
Failed to write reg: Connection timed out
depth: 0

killed: 1

We need to make code to restart the teensy on ArdI2C startup.

@Ximidar Ximidar added the bug label Apr 22, 2017
@Ximidar Ximidar added this to the I2C Works! milestone Apr 22, 2017
@Ximidar Ximidar self-assigned this Apr 22, 2017
@Ximidar
Copy link
Contributor Author

Ximidar commented Apr 22, 2017

In the teensy we can use the following code to reset the board.

// Should restart Teensy 3, will also disconnect USB during restart

// From http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0337e/Cihcbadd.html
// Search for "0xE000ED0C"
// Original question http://forum.pjrc.com/threads/24304-_reboot_Teensyduino%28%29-vs-_restart_Teensyduino%28%29?p=35981#post35981

#define RESTART_ADDR       0xE000ED0C
#define READ_RESTART()     (*(volatile uint32_t *)RESTART_ADDR)
#define WRITE_RESTART(val) ((*(volatile uint32_t *)RESTART_ADDR) = (val))

void setup(){

  // startup routine
  pinMode(13, OUTPUT);

  digitalWrite(13, HIGH);
  for(int i = 0; i < 10; i++){
    digitalWrite(13, !digitalRead(13));
    delay(200);
  }  

  delay(1000);

  // 0000101111110100000000000000100
  // Assert [2]SYSRESETREQ
  WRITE_RESTART(0x5FA0004);
}

 // Should never get here. 
void loop(){}

We can bind this to a registry and have ARDI2C write to the registry on startup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant