I tried to have my system reset using the posted function, but it seemed to not work, so I wrote a small application (LED Port for eXplorerKit):
Code: Select all
#include <xs1.h>
#include <platform.h>
out port leds = on tile[0]: XS1_PORT_4F;
void chipReset(void)
{
unsigned x;
leds <: 0x8; // red LED on
delay_ticks(100000000); // wait
// write to PLL for reset
read_sswitch_reg(get_local_tile_id(), 6, x);
write_sswitch_reg(get_local_tile_id(), 6, x);
}
int main() {
unsigned delay = 10;
leds <: 0x7;
delay_ticks(100000000);
leds <: 0x0;
delay_ticks(100000000);
while (1){
leds <: 0x7;
delay_ticks(10000000);
leds <: 0x0;
delay_ticks(10000000);
delay--;
if (!delay)
chipReset();
}
return 0;
}
Expected behavior on success:
- 1 slow on/off blink (all LEDs but Red)
- 10 fast on/off blinks (all LEDs but Red)
- Red LED turned on
- reset / repeat
- 1 slow on/off blink (all LEDs but Red)
- 10 fast on/off blinks (all LEDs but Red)
- Red LED turned on
- eternal fast on/off blinks (all LEDs but Red)
I searched for a register map on the XE216 devices (to check what register number 6 actually is - maybe i just have to adjust the number) but couldnt find any.