Advanced Search

Search Results (Searched for: )

  • nejiman10
  • nejiman10's Avatar
02 Jul 2025 14:03 - 02 Jul 2025 14:13

LinuxCNC with RIO (FPGA) SPI Issue: Unexpected 'HXHP' Response

Category: General LinuxCNC Questions

Current Situation and Probrem
I am trying to establish stable SPI communication between a Raspberry Pi 4 and an ICE40UP5K FPGA (IceShield) using LinuxCNC and the RIO framework.
While basic SPI communication seems functional outside of LinuxCNC, I am currently encountering unexpected behavior during runtime: the system consistently logs "WRONG DATA" with "HXHP" as the received header.
My goal is to understand what SPI response LinuxCNC expects from the FPGA, and how to configure both ends to ensure correct communication.

Environment
  •     Raspberry Pi 4
  •     LinuxCNC version: 2.9.4 (same behavior also observed in 2.9.3 and 2.8.4)
  •     OS: Official LinuxCNC 2.9.4 Raspberry Pi 4 Bookworm image
  •     FPGA: ICE40UP5K-SG48I (IceShield)
  •     Clock source: Since gpio is not available on Bookworm, I use pigpiod to generate a 5 MHz clock on GPIO 4:
         
    #!/bin/bash sudo pigpiod pigs hc 4 5000000
      I also modified spiflash.sh to work with pigpiod under Bookworm

FPGA Status
  • The Verilog design (rio.v) is written to return the SPI response header "data" (0x64617461)
  • The FPGA’s LED is blinking and SPI data is returned via external tools. This suggests the FPGA is operating correctly with the supplied clock.

SPI Test Using Python
To confirm basic SPI functionality outside of LinuxCNC, I used this script:
import spidev
import time

SPI_BUS = 0
SPI_DEVICE = 0
SPI_SPEED_HZ = 25000  # 25 kHz

spi = spidev.SpiDev()
spi.open(SPI_BUS, SPI_DEVICE)
spi.max_speed_hz = SPI_SPEED_HZ
spi.mode = 0b00

try:
    print("Sending dummy byte 0x00 to read response...")
    result = spi.xfer2([0x00] * 8)
    print("Received:", " ".join(f"0x{b:02X}" for b in result))
finally:
    spi.close()
This consistently returns "data" from the FPGA, suggesting that low-level SPI transport is functioning properly.

Behavior in LinuxCNC
  • In the rio_readwrite() function, logging shows the SPI response always begins with "0:02" (0x30 0x3A 0x30 0x32)
  • However, the LinuxCNC log reports "WRONG DATA" with the string "HXHP" (0x48 0x58 0x48 0x50)
  • I did not find any logic in the Verilog code that would return "HXHP"
  • I suspect that "HXHP" is generated internally by LinuxCNC when an unrecognized or malformed header is received

Observations
  • SPI communication appears to be working, and the FPGA is returning a response
  • However, there may be a mismatch between the header format LinuxCNC expects and what the FPGA sends
  • LinuxCNC may be replacing the unrecognized header with "HXHP" as a default or fallback

Questions
  • Where in the LinuxCNC source is "HXHP" generated or substituted? Is this a fallback response?
  • Is the "0:02" sequence a standard header sent by LinuxCNC under the RIO configuration?
  • What header or message structure (e.g. MSGID) is LinuxCNC expecting from the FPGA?
  • Are there documented or example SPI response formats compatible with riocomp?

I would appreciate any advice or clarification.
I can provide Verilog and riocomp.c sources if helpful. Thank you.















 
  • PCW
  • PCW's Avatar
02 Jul 2025 13:57
Replied by PCW on topic Servo Driver Plasma Retrofit

Servo Driver Plasma Retrofit

Category: Plasmac

No, they are isolated optocoupler outputs rated 100 VDC and 50 mA max.
So the enable outputs may be used in place of relay contacts if the ratings
are not exceeded and polarity is observed.
  • PCW
  • PCW's Avatar
02 Jul 2025 13:40

homing with Phase Z encoder on MESA 7i96s

Category: Advanced Configuration

Did you set HOME_SEARCH_VEL to 0 as required by Index-only homing?

Otherwise homing B will search for a home switch before searching for index.

linuxcnc.org/docs/html/config/ini-homing.html#_configuration
  • TMinj
  • TMinj
02 Jul 2025 13:30
Replied by TMinj on topic Import pin value in handler.py

Import pin value in handler.py

Category: Qtvcp

Thank you for your response. The line pwmValue = self.h.hal.get_value('pwmgen.0.value') is working well.

However, I’m having trouble with the QPushButton (or Action button). I’m not receiving any callback when it’s clicked.
  • ALS
  • ALS
02 Jul 2025 12:36
Replied by ALS on topic Keyboard Functions

Keyboard Functions

Category: AXIS

Thank you very much for the quick response, it will be very useful to me...

Tanks
  • kn612
  • kn612
02 Jul 2025 11:59
Replied by kn612 on topic Servo Driver Plasma Retrofit

Servo Driver Plasma Retrofit

Category: Plasmac

How do the 7i97t drive enable pins work? Do they supply a voltage?
  • my1987toyota
  • my1987toyota's Avatar
02 Jul 2025 10:04
Replied by my1987toyota on topic FreeCAD 1.0 Who's using it?

FreeCAD 1.0 Who's using it?

Category: CAD CAM

well for me I will have to get more proficient in using Freecad. Now more then ever  especially now since the site
diyrcwings.com/app seems to be permanently down. (I used it to generate the g-code for my foam wings)
fortunately there is a workbench add-on that is available for Freecad by Shkolik. called Foamcut. it looks
like it's 4 axis plus a rotational axis. I will have to give it a shot and see how I like it. Anything else wants to
require Windows.
link to the github   github.com/Shkolik/Foamcut
  • Hakan
  • Hakan
02 Jul 2025 09:42
Replied by Hakan on topic General Questions about using ethercat

General Questions about using ethercat

Category: EtherCAT

As I said, first make sure the drive is in CIA 402 operation enable mode.


The cia402 component will make the drive go to operation-enable when you set cia402.0.enable true.
There should be a line that looks like this in your hal file
net x-enable <= joint.0.amp-enable-out => cia402.0.enable

If it doesn't go to operation-enable, check cia402.0.stat-op-enable in halshow,
you need to check the statusword and the controlword, and consult the manual
for reasons why the drive doesn't want to go operation enabled.
  • snowgoer540
  • snowgoer540's Avatar
02 Jul 2025 09:33
Replied by snowgoer540 on topic Keyboard Functions

Keyboard Functions

Category: AXIS

Key bindings for axis start here:

github.com/LinuxCNC/linuxcnc/blob/7fc59f...cripts/axis.py#L3129

If you are running a Run In Place version of LinuxCNC, you can simply navigate to that file and modify them.  It gets more tricky if you have a package install, but definitely possible.  
 
  • Edi_48
  • Edi_48
02 Jul 2025 09:17
Replied by Edi_48 on topic Referenzierungs Fehler

Referenzierungs Fehler

Category: Deutsch

jetzt gehts
Am Motor Endstufe Tipschalter andere Richtung
  • Johnnysacalu
  • Johnnysacalu
02 Jul 2025 08:42
Replied by Johnnysacalu on topic Configuración thcad2 con mesa 7i96s

Configuración thcad2 con mesa 7i96s

Category: General LinuxCNC Questions

Me podrías decir por favor que versión de Linux CNC tienes y si esta en Debian 12 o si no en cual y vuelvo a instalarlo todo a ver si me funciona gracias
  • JackRay
  • JackRay
02 Jul 2025 07:35 - 02 Jul 2025 07:35
Replied by JackRay on topic homing with Phase Z encoder on MESA 7i96s

homing with Phase Z encoder on MESA 7i96s

Category: Advanced Configuration

Yes, that's what I've done. My axis is configured in my .hal & .ini files with Z pulse detection on my rotary axis ( B ), which has no switch. The problem is that I can't detect my Z pulse during homing on this axis ( B ). The hardware tests you made me do comply.
On all my other axes, homing is done correctly (with switches) in accordance with the attached documentation.
  • Lcvette
  • Lcvette's Avatar
02 Jul 2025 06:58

User error or a strange event on probing. Broken ruby tip.

Category: QtPyVCP

Im saying you can add debug in the routines or try reviewing the logs linuxcnc leaves behind. You could add print commands in the routines that only print to the terminal log, just a matter of crazy you want to get with it. I used several while writing the routines as sanity checks.

But its almost always debounce issue, noise, possibly worn pitt d contacts in the probe or a too soft spring in the probe. I've owned about everyone under $300 at some point or a other. They are pretty well similar. If using 24v the contacts can pit if not lubricated with the correct grease fro repetitive micro arcing.

I would take it apart and clean it really well and put the special grease in check your spring pressure maybe give it a stretch.

Set some debounce in hal.

And bump your feed speed up. I don't even use the slow probe anymore so waste of time. My fast probe at 8 in a minute and call it good. Repeats within a tenth or two and is more consistent than fast+slow.
  • Aciera
  • Aciera's Avatar
02 Jul 2025 05:08
Replied by Aciera on topic Keyboard Functions

Keyboard Functions

Category: AXIS

Please don't double post.
  • ANGELOS13
  • ANGELOS13
02 Jul 2025 04:34

7i92M very weird communication problem!!!

Category: Installing LinuxCNC

OK here we go:
1. 7i92m with a BOB, and the latest Linuxcnc.
2. card is setup at ip 10.10.10.10 it pings and i can flash the card with the bin file using MesaCT
3. Tested the card with the pathpilot and it works and moved the table.
4. when i use the linuxcnc pncconf wizard or the linuxcnc all comunications with the card stops, even the ping stops responding.
I'm stuck here any ideas?

Angelos
Displaying 286 - 300 out of 25541 results.
Time to create page: 1.003 seconds
Powered by Kunena Forum