micander / atrias

Automatically exported from code.google.com/p/atrias
0 stars 0 forks source link

Medulla firmware hangs when switching states #81

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Occasionally when switching states the medulla firmware will hang while 
transmitting the ethercat data over SPI. When this happens the watchdog 
triggers and disables the medullas, but it is a problem that needs to be fixed.

Original issue reported on code.google.com by kit...@gmail.com on 14 Aug 2012 at 10:35

GoogleCodeExporter commented 9 years ago
I've solved this problem. This problem was caused by a bug in the SPI driver. 
If the SPI transmit function was called with a single byte, and another 
interrupt triggered at a specific point in the code, the transmitting flag 
would get set after the byte had been transmitted and the SPI interrupt had 
fired and cleared the transmitting flag. If the program was in a while loop 
waiting on that flag to be cleared (as the ethercat driver did) it would be 
waiting forever, thus causing the watchdog to trigger.

Original comment by kit...@gmail.com on 31 Aug 2012 at 2:50