Remora for RP2040

More
11 Mar 2024 18:07 #295666 by Jaron
Replied by Jaron on topic Remora for RP2040
I've been trying to get Remora running on RP2040 via Ethernet on a Raspberry pi 5. The error i'm getting when trying to run LinuxCNC is:
Warning: Spoiler!

The error doesn't seem to be related to the pi 5 specifically so I'm hoping to get the pi 5 working with remora-ethernet, does anyone have a clue what I can try to fix it?

I've used the RP-2040-Ethernet-Remora firmware from:
github.com/scottalford75/Remora-RP2040-W5500
(UF2 file from the standard build folder, tried compiling it myself but came across multiple problems, I can give details if needed)

and using config and component from
github.com/scottalford75/Remora-NVEM/tre...Components/Remora-nv
and
github.com/scottalford75/Remora-NVEM/tre...es/remora-nvem-basic

When powering the RP-2040 all outputs seem to be flickering, can anyone tell if this is normal?
Warning: Spoiler!

I tried measuring the signal and it's lots of seamingly random peaks, my logic analyser only goes up to 24Mhz and it's all peaks at minimal time period. 
Warning: Spoiler!

In my setup I'm also connecting the W5500 with dupont wires, could this cause my problems maybe? (Read somewhere that the SPI communcation at stock speeds and these wires might not work)

Besides that I also read somethwere that the ethernet cable between pi and RP2040 needs to be a crossover cable. I've tried quickly making one but that also doesn't seem to make a difference.

I don't really know how to debug the error i'm getting so hopefully someone can help me.

I made a list of all commands I used to get my pi up and running, maybe it is usefull for someone trying to do the same or debugging my problem so here is what i've done:

Setting up my crappy touchdisplay:
in /boot/broadcom/config.txt adding
hdmi_force_hotplug=1
hdmi_drive=2
config_hdmi_boost=4

in cmdline.txt
adding "video=HDMI-A-1:1920x1080@60D" at the end

Setting up tightVNC:
Setting up other vnc servers was difficult, got this one working by
nano ~/.vnc/xstartup
change to:
#!/bin/sh
xsetroot -solid grey
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4 &

To automatically start it at boot:
sudo nano /etc/rc.local
add this:
sudo -u cnc /usr/bin/tightvncserver :1 -geometry 1920x1080
before the exit 0:

To automatically log in to linuxcnc account at boot:
sudo nano /etc/lightdm/lightdm.conf
autologin-user=cnc

Setting up the static ethernet connection on Raspberry pi 5:
in sudo menu-config I changed ipv4 to manual and set the adres to 10.10.10.11 and gateway 0.0.0.0
(There is no /etc/dhcpcd.conf anymore on pi 5 it seems but this does the trick it seems)

installing nvem-remora component:
sudo halcompile --install remora-nv.c

Settings up RP2040
first uploading remora.uf2 to the pico board
(for upload_config.py tftpy is needed, installing tftpy normally didn't work, forgot the exact error)
python3venv venv
source venv/bin/activate
pip install tftpy
deactivate
./venv/bin/python3 upload_config.py nvem-basic-config.txt

In basic config I changed pin designators from PE_13, PE_12 to GP2, GP3 and left nvem board designator the same, is this correct?

Is there any way to check the communication over ethernet and if everything is going correctly? when I do ping 10.10.10.10 it responds back perfectly fine it seems.

To run Linuxcnc:
linuxcnc remora-nvem.ini

and in the ini i changed AXIS to qrvcp qtdragon_hd (axis didn't want to run for some reason but qtdragon seems fine)

Please Log in or Create an account to join the conversation.

More
11 Mar 2024 23:27 #295701 by cakeslob
Replied by cakeslob on topic Remora for RP2040
but is that error stopping you from running? i dont think that error is keeping you from running linuxcnc

github.com/scottalford75/Remora-NVEM/blo.../remora-nvem.ini#L55

change servo period from 1000000 to 2000000, we are running successfully like that.

dupont cables, its a problem, but probably not the problem. jiggle the cables while its connected to linuxcnc and observe the effects on the dro.

but the RPI5 has some really good latency numbers from what ive seen.

your detailed post is appreciated.
The following user(s) said Thank You: Jaron

Please Log in or Create an account to join the conversation.

More
13 Mar 2024 14:22 - 13 Mar 2024 18:07 #295824 by Jaron
Replied by Jaron on topic Remora for RP2040
When I try to jog the X Y or Z axis this error pops up, I thought this servo period thing was the culprit. The error I get when trying to move an axis is as follows:
Warning: Spoiler!


When starting and pressing the E-stop in the GUI I get the previous error. Then I can turn the machine on and press the X Y o Z jog buttons. But then I get that error.
I don't think the E-stop can be triggered on the pico since I don't even have it defined in my config file.

I think the outputs acting up on the Pico means that the gpio's are not yet initialized. When running a simple LED blink via MicroPython on one output the LED toggles nicely. I'm guessing the GPIO's don't get initialized properly on the board, maybe that is due to my config file?

This is what I use currently:
(Config file)

​​​​​​​
{
"Board": "PICO_ETHERNET",
"Modules":[
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "X - Joint 0 step generator",
"Joint Number": 0,
"Step Pin": "GP2",
"Direction Pin": "GP3"
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "Y - Joint 1 step generator",
"Joint Number": 1,
"Step Pin": "GP4",
"Direction Pin": "GP5"
},
{
"Thread": "Base",
"Type": "Stepgen",
"Comment": "Z - Joint 2 step generator",
"Joint Number": 2,
"Step Pin": "GP6",
"Direction Pin": "GP7"
}
]
}
*I've also tried using the "Type": "Blink" in the config to Toggle an LED and I didn't have any success..
Last edit: 13 Mar 2024 18:07 by Jaron.

Please Log in or Create an account to join the conversation.

More
13 Mar 2024 18:39 #295848 by cakeslob
Replied by cakeslob on topic Remora for RP2040
blink will just strobe at a set rate as soon ass it connects to ethernet, so i would try to see if you can get that working first. if blink didnt work properly, its possible your stepper config was not loaded to the pico either, which would result in a following error.




I dont know what to tell you about the emctask error, except that ive seen several users with the issue recently, but I dont know what solved it

Please Log in or Create an account to join the conversation.

More
31 Mar 2024 12:19 #297274 by Jaron
Replied by Jaron on topic Remora for RP2040
I've tried to do some digging and got the uart debugging to work.
This is my output:
Remora for RP2040 starting (core0)...

netif link status changed up
netif status changed 10.10.10.10

Remora for RP2040 starting (core1)...

## Entering SETUP state


1. Loading JSON configuration file from Flash memory




2. Parsing JSON configuration file
Config deserialisation - Deserialization succeeded


3. Configuring threads
Creating thread 40000
Creating thread 1000

4. Loading modules

Creating a std module
Creating an Ethernet communication monitoring module

Base thread object

X - Joint 0 step generator

Creating a std module
Creating Pin @
pin = GP65508

It seems to stall when trying to initialize the first pin with very high pin number.
I've never initialized it like that so now I have some questions.
I've tried uploading a new config via python3 upload_config.py nvem-basic-config.txt and that doesn't seem to do anything. The command excecutes correctly but when rebooting the pico after it still give the same uart debug return.

It might be that the pico is just stuck with this config and because of it it won't boot and can't change it's config.. 
When I re-program the pico by flashing the UF2 image, does the configuration change to default from boardconfig.h?
I've tried flashing the pico also without setting a config file but this still happens, is there any way to hard code the pin definitons or maybe remove the pin configuration from the pico?

Thanks for the help, 
 

Please Log in or Create an account to join the conversation.

More
31 Mar 2024 15:45 #297291 by cakeslob
Replied by cakeslob on topic Remora for RP2040
alright its getting stuck from a bad config load?

wipe the whole chip probably before you reload the firmware, or just eraser the chip sector with the bad config
The following user(s) said Thank You: Jaron

Please Log in or Create an account to join the conversation.

More
31 Mar 2024 21:06 #297305 by Jaron
Replied by Jaron on topic Remora for RP2040
Good idea to wipe the whole chip, didnt know that was needed or possible for the RP2040.

Oh my god, it actually worked!
I used the flash_nuke.uf2 file from electrocredible.com/how-to-reset-raspberry-pi-pico-w/. At first I unplugged the pico after dropping the file on the pico directory and it makes the disconnecting sound from the computer, DON'T DO THIS. It seems like it takes quite a few seconds to wipe the whole memory of the pico and once it's done it returns to bootloader mode and shows up as a directory again.

After that I dropped the remora.uf2 on there and got a nice blinking LED and everything, error in linuxCNC is also gone, I'll check if everything else works aswell tomorrow. Really glad I got passed this though.

Thanks!
 

Please Log in or Create an account to join the conversation.

More
01 Apr 2024 13:50 #297371 by Jaron
Replied by Jaron on topic Remora for RP2040
After trying to change the board config.txt file (Uploading via upload_config.py) it still gets bricked and firmware gets stuck on either "pin = GP65508" or "pin = GP65518" on boot.
I thought I could just change the board configurations in boardconfig.h of the firmware, compile it and then use remora like that but sadly i've not gotten that to work yet. 
I thought it loaded the pin definitions from here but after trying numerous changes, wipes and re-compiles I can't even get another pin to blink.
The on board LED blinks and I though this was because of the line
BlinkPinConfig BlinkConfigs[] = {{"Blinky on GP25", "GP25", 0} 
in the file boardconfig.h
But changing this to for instance GP04 and having an LED attached to pin 4 of the pico. It still blinks the on board LED and not GP04.
I'm at a loss again as to what I can try. I've tried to do a complete re-build of the firmware thinking my code didn't compile poperly but I might just be misunderstanding this config file.

If anyone has tips or hints as tot what I could try I'd be really thankfull.

Please Log in or Create an account to join the conversation.

More
01 Apr 2024 14:56 #297375 by Jaron
Replied by Jaron on topic Remora for RP2040
I figured out why uploading the config file didn't work. when giving pins their names in config.txt you have to use GP01 and not GP1. (starting with a 0 for single digit numbers) Very confusing since when looking at pinouts online it is never shown like that.

I'm happy I've got it working now though.

If anyone else finds themselves with this issue, the solution is the first wipe the memory of the pico by uploading flash_nuke.uf2 and waiting for the flash drive of pico to show back up again, then uploading the fresh remora firmware. Then making sure you don't use GP1 pin definitions and always use two numbers after "GP" 
The following user(s) said Thank You: cakeslob, rambros

Please Log in or Create an account to join the conversation.

More
10 May 2024 11:53 #300310 by itsemast
Replied by itsemast on topic Remora for RP2040
As I understand, with the current implementation, Remora for RP2040 requires W5500 for UDP communication over Ethernet. Were there any attempts to implement direct SPI communication between RPi and RP2040? I couldn't find any, so I opened an issue on GitHub .

Please Log in or Create an account to join the conversation.

Time to create page: 0.133 seconds
Powered by Kunena Forum