Folknology wrote:What I am unsure about (due to lack of switch setup experience) is how the links between the ADC on its tile and the user tile are setup, it looks like it may be a non-routed link but don't quote me on that,
I'll call the two processors the "application node" and the
"debugger node". The app node is node # 0, the debug
node is # 0x8000, and the analogue node is # 0x8001.
The two switches are connected by their links G,H,E,F
(to F,E,H,G in that order). Link C on the debug node's
switch is connected to the analogue tile (which has no
switch, it does no routing, it ignores its node # even).
The OTP code on the debug node sets up link C (to the
analogue) and its link E (to the app node). Link C gets
direction 0, link E gets direction 1. Routing is not set up,
so everything is sent to direction 0.
Thanks for pasting the code, zips are hard to read in a
web browser :-)
read_node_config_reg(tile[0], 0x87, data);
if (data == 0) {
Read the config of the app node's link F; run the rest
only if it is disabled so far.
write_node_config_reg(tile[0], 0x85, 0xC0002004); // open
write_node_config_reg(tile[0], 0x85, 0xC1002004); // and say hello
Open link H from the app node (to link E on the debug node).
write_sswitch_reg_no_ack(0x8000, 0x86, 0xC1002004); // say hello
write_sswitch_reg_no_ack(0x8000, 0xC, 0x11111111); // open and say hello
Say hello in the other direction (did that before but the link
on the app side was still disabled); set up routing on the
debug node to route directions 8..15 (i.e., anything with
the top eight bits zero) to the app node.
read_sswitch_reg(0x8001, 5, data);
read_sswitch_reg(0x8000, 5, data);
Read the node # from the analogue node and the debug
node, to test if it all is set up right. This hangs if not.
Does that help?
Cheers,
Segher