FPGA - nRF24L01 `RPI Net' server
Hi, I have recoded Net.ReceiveHead() slightly. ... (*IF ~head1.valid & (Oberon.Time() >= time) THEN head1.typ := 0FFH*) END UNTIL head1.valid OR (Oberon.Time() >= time) (*head1.typ = 0FFH*) END ReceiveHead; Once the loop falls through on timeout, it keeps `0FFH' in buffer, making it return immediately before `time' lapses in all subsequent calls. Also `0FFH' message type is reserved for broadcast, correct? -- Tomas Kral <thomas.kral@email.cz>
Tomas Your change is not a good idea... 1) How would the code following the ReceiveHead() detect whether a timeout occurred? 2) You wrote "it keeps `0FFH' in buffer". Does it? What does SCC.ReceiveHead(head1) do? br Jörg -----Original Message----- From: Oberon [mailto:oberon-bounces@lists.inf.ethz.ch] On Behalf Of Tomas Kral Sent: Wednesday, May 23, 2018 5:35 PM To: Oberon@lists.inf.ethz.ch Subject: [Oberon] FPGA - nRF24L01 `RPI Net' server Hi, I have recoded Net.ReceiveHead() slightly. ... (*IF ~head1.valid & (Oberon.Time() >= time) THEN head1.typ := 0FFH*) END UNTIL head1.valid OR (Oberon.Time() >= time) (*head1.typ = 0FFH*) END ReceiveHead; Once the loop falls through on timeout, it keeps `0FFH' in buffer, making it return immediately before `time' lapses in all subsequent calls. Also `0FFH' message type is reserved for broadcast, correct? -- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Wed, 23 May 2018 19:51:03 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
How would the code following the ReceiveHead() detect whether a timeout occurred? Add 1) `head.typ = 0FFH' is not checked in the code after ReceiveHead(), I do not see the point yet
What does SCC.ReceiveHead(head1) do?
Add 2). SCC.ReceiveHead(head1) does clear the receiver ResetRcv(), but it must first see the data in FIFO. Oberon Transmit Log: =================== typ len sadr dadr Net.Gettime RPI ~ 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 71 4 180 94 valid time set Net.ReceiveFiles RPI Test.Mod ~ file size 640 Test.Mod receiving 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 0 512 180 94 valid seqno 0 1 128 180 94 valid seqno 1 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 ... many iterations follow until timeout, no other seqno sent 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 <= timeout sets head0.typ := 255 640 Net.Gettime RPI ~ 255 128 180 94 <= first pass through the loop RX-FIFO has data though 00000040 RX_DR data ready 00000010 RX_FIFO not empty -- Tomas Kral <thomas.kral@email.cz>
Tomas head1.typ is very important as it steers/controls the whole state machine of Net.Mod. 1) How do you get to reply(5) in ReceiveFiles? 2) What is the value of head1.typ in case SCC does not receive anything? Jörg
Am 23.05.2018 um 22:15 schrieb Tomas Kral <thomas.kral@email.cz>:
On Wed, 23 May 2018 19:51:03 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
How would the code following the ReceiveHead() detect whether a timeout occurred? Add 1) `head.typ = 0FFH' is not checked in the code after ReceiveHead(), I do not see the point yet
What does SCC.ReceiveHead(head1) do?
Add 2). SCC.ReceiveHead(head1) does clear the receiver ResetRcv(), but it must first see the data in FIFO.
Oberon Transmit Log: ===================
typ len sadr dadr
Net.Gettime RPI ~
53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 71 4 180 94 valid time set
Net.ReceiveFiles RPI Test.Mod ~ file size 640
Test.Mod receiving 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 0 512 180 94 valid seqno 0 1 128 180 94 valid seqno 1 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 ... many iterations follow until timeout, no other seqno sent 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 <= timeout sets head0.typ := 255 640
Net.Gettime RPI ~
255 128 180 94 <= first pass through the loop
RX-FIFO has data though 00000040 RX_DR data ready 00000010 RX_FIFO not empty
-- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Thu, 24 May 2018 06:45:54 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
head1.typ is very important as it steers/controls the whole state machine of Net.Mod.
Now I see, Net.Mod states = (0, 1, 2, 4, 5). 5 means `no repsonse' and is set by the timeout, head1.typ = 255; But I need to somehow distinguish when the receive transaction completes through a timeout normally (last seqno) / abnormally (lost seqno). Solutions [1] ReceiveFiles* ... IF done THEN Files.Register(F); (**) head1.typ := 0 (**); reply(0) ELSE end := 0 END [2] Introduce a new / reuse an existing message, confirming normal transfer completion, telling last seqno sent, file transfer done and complete. In all cases, 255 is kept in the header1 and confuses next Net file user operation. Net.ReceiveHead() needs typically 20> iterations until it sees data and only then SCC.ReceiveHead() clears the receiver. -- Tomas Kral <thomas.kral@email.cz>
On Thu, 24 May 2018 06:45:54 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
head1.typ is very important as it steers/controls the whole state machine of Net.Mod.
How about this? PROCEDURE reply(msg: INTEGER); BEGIN IF msg = 0 THEN head1.typ := 0 (* reset state machine *) ELSIF msg = 1 THEN Texts.WriteString(W, " no link") ... ... -- Tomas Kral <thomas.kral@email.cz>
Try to understand the meaning of head1.valid. Jörg
Am 24.05.2018 um 09:34 schrieb Tomas Kral <thomas.kral@email.cz>:
On Thu, 24 May 2018 06:45:54 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
head1.typ is very important as it steers/controls the whole state machine of Net.Mod.
How about this?
PROCEDURE reply(msg: INTEGER); BEGIN IF msg = 0 THEN head1.typ := 0 (* reset state machine *) ELSIF msg = 1 THEN Texts.WriteString(W, " no link") ... ...
-- Tomas Kral <thomas.kral@email.cz> -- Oberon@lists.inf.ethz.ch mailing list for ETH Oberon and related systems https://lists.inf.ethz.ch/mailman/listinfo/oberon
On Fri, 25 May 2018 07:21:50 +0200 Jörg <joerg.straube@iaeth.ch> wrote:
Try to understand the meaning of head1.valid. Jörg
Hi Joerg, This bit I hope I understood already. I admit, I missed the idea of states, which I hope I understand now as well. I resolved by adding extra ACK, after senddata(); in serve(); as the Net.ReceiveHead() really waits for either `seqno' or `timeout'. When 255 timeout header is left in head1 after REC, it confuses next file operation. After time request 53 0 180 94 53 0 180 94 53 0 180 94 53 0 180 94 71 4 180 94 valid time set I got this Test.Mod receiving 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 0 512 180 94 valid seqno 0 1 128 180 94 valid seqno 1 1 128 180 94 16 0 180 94 valid ACK received 640 Instead of this Test.Mod receiving 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 71 4 180 94 0 512 180 94 valid seqno 0 1 128 180 94 valid seqno 1 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 1 128 180 94 ... many iteration follow 255 128 180 94 until timeout 640 -- Tomas Kral <thomas.kral@email.cz>
participants (2)
-
Jörg -
Tomas Kral