scottalford75 / Remora-RP2040-W5500

Remora firmware for RP2040 with W5500 Ethernet
5 stars 7 forks source link

Remora-RP2040-Outputs #9

Closed baaz24 closed 1 week ago

baaz24 commented 3 weeks ago

hello everyone, I am a newbie to linuxcnc but have learn alot in the past few months.

This is my scenario: I am using W5500-EVB-Pico board as a controller for 3-axis cnc machine. Loaded with the remora firmware, followed https://github.com/jschoch/Remora-RP2040-W5500/commits?author=jschoch , and did what had to be done to get it working. The problem is that when i add outputs in the config.txt fie, it stops working. Whatever i do it just doesn't work.

The hale file:

https://github.com/scottalford75/Remora-NVEM/blob/main/LinuxCNC/ConfigSamples/remora-nvem-basic/remora-nvem.hal

The config.txt file: (The thing causing the problem)

{ "Thread": "Servo", "Type": "Digital Pin", "Comment": "light", "Pin": "GP12", "Mode": "Output", "Data Bit": 0 }

baaz24 commented 2 weeks ago

Hi @scottalford75 , I really appreciate the work you have done and has made it a lot easier for us beginners like me. I have researched quite a bit here and there. Went through the code and some other stuff. What i have come up with so far is that the board (W5500-EVB-Pico) shall take the stepgen, dir, inputs, and outputs from the JSON file that we upload through the upload_config.py. And it works fine as long as there are no outputs placed in the JSON file. If the mode of only a single digital pin is set to output. The board doesn't work then. And we can observe that from the blink pin - GP25. it doesn't blink then. Which shows that it didn't upload.

I also went through the linuxcnc forum and this guy "telmoram" also had this issue and nobody responded to him. The link is given below to his exact same matter: https://forum.linuxcnc.org/18-computer/49156-remora-for-rp2040?start=90

This sam issue also appeared when i was going through the github page: https://github.com/scottalford75/Remora/issues/11 here @aaroncnc also had issues with outputs and then you went on and said there was something wrong with the data structure packing was the issue meaning that the "outputs" data byte was not included in the SPI packet.

And yo said, "Ok, I've found the problem. It looks like the data structure packing was the issue meaning that the "outputs" data byte was not included in the SPI packet.

Structure corrected in both remora.c and firmware. Fix has been pushed to the repository and firmware.bin has been updated.

I've now got a light working on pin 2.7 :-)".

so it it still corrected in the remora.c or is the fix like commented out or something like that.

I would really appreciate if you could help me out or point me in the right direction.

Huge thanks

scottalford75 commented 2 weeks ago

Hi, I can't replicate your issue. Please share your full config.

baaz24 commented 2 weeks ago

hey, I am going to share my working and the non-working config files. working-config.txt not-working-config.txt

This must be kept in mind that i am not using picoBOB but instead the W5500-EVB-Pico, and a reference to its pins is also provided: https://docs.wiznet.io/Product/iEthernet/W5500/w5500-evb-pico

Even if i insert a single output, the controller just hangs.

[Uploading not-working-config.txt…]()

baaz24 commented 2 weeks ago

Even inserting a single output just hangs it: not-working-config.txt

And @scottalford75 , I really appreciate what you are doing, i really do. Thank you once again.

And one thing more, i am using the uf2 file from the Remora-RP2040-W5500 repository and the link is: https://github.com/scottalford75/Remora-RP2040-W5500/tree/main/build

The hal and ini files are from the picoBOB repository. The link to which is: https://github.com/scottalford75/PicoBOB/tree/main/LinuxCNC/configs/remora-rp2040

And i ran the hal compile on the these files - remora-nv.c https://github.com/scottalford75/Remora-NVEM/tree/main/LinuxCNC/Components/Remora-nv

scottalford75 commented 1 week ago

Ok, some more investigation. Using the publish uf2 file and your config I confirm the issue. I've recompiled my master branch which had some unpublished clean-ups (debug info) from the ping-pong buffer implementation, and your config happily loads and runs.

I've also added a firmware folder to the repo to make finding the uf2 file easier.

github.com/scottalford75/Remora-RP2040-W...ora-rp2040-1.0.1.uf2

I'm working on making the RP2040 version compatible with the latest LinuxCNC Remora ethernet component, but currently this version still uses the legacy remora-nv component.

scottalford75 commented 1 week ago

Updated to use the remora-eth-3.0 component.

baaz24 commented 6 days ago

hey @scottalford75 , This is great. Everything is working smoothly man. I can now see the outputs working absolutely fine. I appreciate the effort and time you took to make it work and i thank you for this.

I will post my work when its done and mention the hurdles i faced so that others can benefit. Thanks