It is currently Thu Jan 22, 2026 3:29 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Oct 30, 2006 9:46 am 
Offline

Joined: Thu Jan 12, 2006 8:04 am
Posts: 116
Location: Germany / 88471
i encountered the following strange situation:
i am coding some rr-net using code on PC and transfer it via codenet to c64. then I reset the c64 (reset button) AND switch RR in Flashmode then i start my code and it won't run properly, that is it seems that the rr-net is somehow blocked and won't recieve anything when i throw some frames on it...
as said the same code runs roperly if i save it to disk, turn on and off again the c64 load and run it... is codenet messing up the rr-net in some way that even a hard reset and a chip reset (which i do in the code) "survives"...?!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 10:53 am 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
what address range are you transferring to?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 6:21 pm 
Offline
Site Admin

Joined: Wed Jan 11, 2006 11:22 am
Posts: 874
Is using the clockport in Flashmode actually documented to be safe?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 9:53 pm 
Offline

Joined: Thu Jan 12, 2006 8:04 am
Posts: 116
Location: Germany / 88471
i transfer mostly to $c800-$cfff but i think i used other areas too... why are you asking??!

i tried in flash mode and not in flash mode. i often switch into flashmode while developing something to be sure that the TFR doesn't interfere in any way with my code...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Oct 30, 2006 11:30 pm 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
hannenz wrote:
i transfer mostly to $c800-$cfff but i think i used other areas too... why are you asking??!

I'm asking because you said it didn't work when transferring using CodeNet, but worked when loading from floppy. Does CodeNet support loading to the addresses you're using is the real question I think.
You could try transferring a known pattern to the addresses you're using instead of your binary and then examine the transferred data and/or save it to disk for examination. This should reveal if the stuff you transfer using CodeNet is actually what you expect.
Hurhrmm.. :roll: Graham has made weird errors before :P

..oh, and personally I have seen lots of transfer errors. If you do a check with known data, use a pattern that will reveal byteswapped data, e.g. the alphabet. If the data is byteswapped at some places, well.. then you're fucked - but I can explain that further if that's what you find. ;-)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 12:15 am 
Offline

Joined: Thu Jan 12, 2006 8:04 am
Posts: 116
Location: Germany / 88471
oh no, the code is transfered correctly and executes properly in the first place, that's not the problem (yes, codenet uses the first two bytes as "load" address)
the transfered data isn't corrupted either - the problem is more that if i run the transmitted code which itself uses the rr-net, rr-net reception of frames seems to be blocked. Normally the code should recieve a frame from my pc and react upon - and it does this very well if started without having used codenet before, e.g. if loaded from disk - but after a transfer with codenet the reception of frames fails and nothing happens (well the rr-net actually recieves the frames since the green LED is flashing but something goes wrong "on its way to my code" if you know what i mean...)
i have a workaround now of simply not using codenet anymore for this purpose but my own tool netmon instead but i think this is strange anyway.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 9:42 am 
Offline
User avatar

Joined: Fri Jan 13, 2006 12:27 pm
Posts: 30
I noticed the same thing. (I think)

I get around it by pinging the c64 twice . I wrote a little batch file to do it before I try another xfer.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 10:00 am 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
If I remember correctly this loading via CodeNet works with my code/rr-net. How does your init code look?

My init does the following:

1 - Reset NIC
1.1 - Wait for NIC to reset, verify this by reading back SelfST and checking for INITD bit. This verification doesn't work in Vice though!
2 - Detect NIC by reading ProductIDCode
3 - If NIC detected OK, setup NIC
3.1 - Set bits RxCTL_BroadcastA, RxCTL_IndividualA and RxCTL_RxOKA in register RxCTL (write #$0d05 to $0104)
3.2 - Set the MAC address
3.3 - Finally enable transmission and reception by setting bits LineCTL_SerTxON and LineCTL_SerRxON in register LineCTL (write #$00d3 to $0112)


I'll just confirm that it actually works when loading it via CodeNet and resetting, once I get home tonight.. just to be sure ;-)

oh, and are you writing the same MAC address to the NIC as CodeNet is using? - and if not, are you remembering to flush the relevant ARP caches on the connected systems? - This is only relevant if your CodeNet and you own code uses the same IP address of course.
- just checking ;-)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 10:49 am 
Offline

Joined: Thu Jan 12, 2006 8:04 am
Posts: 116
Location: Germany / 88471
@bones: yes, pinging helps but it needs much more than two pings inmy case, if i issue pings ina n 0.2 sec interval it needs up to one minute until the rr-net is "free"...
@devia: i'll check my init against yours, maybe i missed something...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 10:58 am 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
hannenz wrote:
@bones: yes, pinging helps but it needs much more than two pings inmy case, if i issue pings ina n 0.2 sec interval it needs up to one minute until the rr-net is "free"...


erhm.. doesn't linux do negative ARP caching?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 10:39 pm 
Offline
Site Admin

Joined: Wed Jan 11, 2006 11:22 am
Posts: 874
I don't do a software reset of the 8900 and I've never had any problems with CodeNet, but I'm not using the same IP address either. Hence no ARP problems.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 10:51 pm 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
Just to follow up:

I just tested loading some ICMP code to my RR using CodeNet from TFR and then running the program (no reset) and it works perfectly (as in, I can ping my ICMP code) as long as I flush my arp cache in between the CodeNet load and my following ping test (my code uses a different MAC than CodeNet).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 10:57 pm 
Offline
User avatar

Joined: Thu Jan 12, 2006 12:52 am
Posts: 203
Location: Denmark
RaveGuru wrote:
I don't do a software reset of the 8900

Well, I don't think it is at all necessary. I just think it's a good practice to re-initialize hardware that "might" have been used by something else prior to my use. As is the case in this situation.
In other words: It's good practice and it takes up very little space to do it.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Oct 31, 2006 11:04 pm 
Offline
Site Admin

Joined: Wed Jan 11, 2006 11:22 am
Posts: 874
Agreed.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Nov 07, 2006 2:00 am 
Offline

Joined: Thu Jan 12, 2006 8:04 am
Posts: 116
Location: Germany / 88471
ok, i solved the problem. it is that i use in fact another mac address and so the pc's arp cache contains still the mac-address set by TFR and of course these packets are rejected by the rr-net since it has another mac address now.
just delete the pc's arp-cache with
Code:
arp -d 192.168.0.64

or what have you as ip-address... that's it. so, devia, you were perfectly right and tfr isn't to blame either ;)
btw: isn't there a possibility to flush the whole cache or something shorter in linux?!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 26 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group