Inserting SD Card crashes Ethernet interface #31
-
I'm using the latest PicoCNC with Ethernet Kit, compiling with the latest VS Code grblHAL build and the Ethernet works great until I insert an SD card. My scope shows a chip select contention of both SD Card chip enable and SPI Ethernet chip enable. Once the SDCard is inserted, the ethernet starts to hang and eventually loses connection due to an unhandled exception in ioSender. |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 8 replies
-
What does $pins give you? Post it here, please. |
Beta Was this translation helpful? Give feedback.
-
Thanks Phil,
That’s a very helpful command…
See below.
Cheers
>> $pins
[PIN:7,Feed hold]
[PIN:8,Cycle start]
[PIN:22,Emergency stop]
[PIN:28,Probe]
[PIN:6,X limit min]
[PIN:6,Y limit min]
[PIN:6,Z limit min]
[PIN:9,Aux in 0,P0]
[PIN:SR8.0,X step]
[PIN:SR8.1,Y step]
[PIN:SR8.2,Z step]
[PIN:SR8.4,X dir]
[PIN:SR8.5,Y dir]
[PIN:SR8.6,Z dir]
[PIN:SR16.0,X enable]
[PIN:SR16.1,Y enable]
[PIN:SR16.2,Z enable]
[PIN:SR16.4,Spindle on]
[PIN:SR16.5,Spindle direction]
[PIN:27,Spindle PWM]
[PIN:SR16.7,Mist]
[PIN:SR16.6,Flood]
[PIN:SR16.8,Aux out 0,P0]
[PIN:SR16.9,Aux out 1,P1]
[PIN:SR16.10,Aux out 2,P2]
[PIN:SR16.11,Aux out 3,P3]
[PIN:SR16.12,Aux out 4,P4]
[PIN:SR16.13,Aux out 5,P5]
[PIN:SR16.14,Aux out 6,P6]
[PIN:12,MISO]
[PIN:11,MOSI]
[PIN:10,SPI CLK]
[PIN:2,SPI CS]
[PIN:13,SD card CS]
[PIN:SR16.15,SPI reset]
[PIN:26,SPI IRQ]
[PIN:1,RX,Modbus]
[PIN:0,TX,Modbus]
ok
From: phil-barrett ***@***.***>
Sent: Friday, January 24, 2025 7:21 PM
To: phil-barrett/PicoCNC ***@***.***>
Cc: Robert Trescott ***@***.***>; Author ***@***.***>
Subject: Re: [phil-barrett/PicoCNC] Inserting SD Card crashes Ethernet interface (Discussion #31)
What does $pins give you? Post it here, please.
—
Reply to this email directly, view it on GitHub <#31 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB2RKBCPR52LLQ7YQYSN6Y32ML7JLAVCNFSM6AAAAABV24HAF2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOJUHE2DIOA> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AB2RKBGHHVEPMUBR22BSGOD2ML7JLA5CNFSM6AAAAABV24HAF2WGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAWZKYQ.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
Hi Phil,
One thing I’ve noticed is SDCard CS is very short.
While the SPI_CLK goes high for 15ns, the SPI_CS goes low for only 5ns on the rising edge of the clock then CS returns high.
I may consider this a glitch, or some artifact of the GPIO handler. Probably too short to affect the SDCard.
However, all this is happening while the WZCS is active low (10us).
The above occurs while the SDCard is not inserted.
Once I insert the SDCard, all the SPIbus signals begin to slow transitioning until after a few seconds, no SPIBus transitions occur. The MOSI and CLK both remain low while the others remain high. Ethernet disconnects and I must reboot the PicoCNC.
Hopefully, this helps narrow down some more tests I can perform, given your experience with this system.
Thanks.
From: phil-barrett ***@***.***>
Sent: Friday, January 24, 2025 7:21 PM
To: phil-barrett/PicoCNC ***@***.***>
Cc: Robert Trescott ***@***.***>; Author ***@***.***>
Subject: Re: [phil-barrett/PicoCNC] Inserting SD Card crashes Ethernet interface (Discussion #31)
What does $pins give you? Post it here, please.
—
Reply to this email directly, view it on GitHub <#31 (comment)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB2RKBCPR52LLQ7YQYSN6Y32ML7JLAVCNFSM6AAAAABV24HAF2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOJUHE2DIOA> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AB2RKBGHHVEPMUBR22BSGOD2ML7JLA5CNFSM6AAAAABV24HAF2WGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAWZKYQ.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
Hi Phil,
I believe I’m reasonably current on grblHAL and the plug-ins (see below).
With the exception of the SD Card, the board works great.
I’m wondering how the system discovers an SD Card is present? There is no card insert switch input.
Presumably, the system polls the SPI-bus looking for a possible SD Card response?
Apologies if I’m troubling you with issues beyond your purview. I figured I’d start with the hardware!
Thanks a bunch for any help or direction.
*** Fetching device version
>> $I
[VER:1.1f.20250120:]
[OPT:VNMSL,100,1024,3,0]
[AXS:3:XYZ]
[NEWOPT:ENUMS,RT+,ES,SED,RTC,ETH,MBIO,SD,YM]
[FIRMWARE:grblHAL]
[SIGNALS:HSEP]
[NVS STORAGE:*FLASH 4K]
[FREE MEMORY:121K]
[DRIVER:RP2040]
[DRIVER VERSION:250102]
[DRIVER OPTIONS:SDK_2.1.0]
[BOARD:PicoCNC]
[AUX IO:1,7,0,0]
[WIZCHIP:W5500]
[MAC:00:08:dc:12:34:56]
[IP:192.168.4.80]
[NETCON:Telnet]
[PLUGIN:MODBUS v0.18]
[PLUGIN:Robs Blinky LED v1.00]
[PLUGIN:MODBUS IO v0.1]
[PLUGIN:SDCARD v1.19]
[PLUGIN:FS macro plugin v0.15]
Ok
From: phil-barrett ***@***.***>
Sent: Saturday, January 25, 2025 12:54 AM
To: phil-barrett/PicoCNC ***@***.***>
Cc: Robert Trescott ***@***.***>; Author ***@***.***>
Subject: Re: [phil-barrett/PicoCNC] Inserting SD Card crashes Ethernet interface (Discussion #31)
The $pins output looks right.
There were some changes in that area of grblHAL. Are you using the latest version (ie a recent build)?
—
Reply to this email directly, view it on GitHub <#31 (reply in thread)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB2RKBCIBTPRPNVM2OSVIN32MNGJ5AVCNFSM6AAAAABV24HAF2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOJVGA2DMMQ> .
You are receiving this because you authored the thread. <https://github.com/notifications/beacon/AB2RKBETP6DDSYJYBSCQ5V32MNGJ5A5CNFSM6AAAAABV24HAF2WGG33NNVSW45C7OR4XAZNRIRUXGY3VONZWS33OINXW23LFNZ2KUY3PNVWWK3TUL5UWJTQAWZMX4.gif> Message ID: ***@***.*** ***@***.***> >
|
Beta Was this translation helpful? Give feedback.
-
After removing the WZ5500 Ethernet module and returning to USB comms, the SD Card interface became fully operational. |
Beta Was this translation helpful? Give feedback.
-
This is worth taking to the grblHAL RP2040 github issues page. I suspect it is a bug in the grblHAL PicoCNC. The $pins output shows there are 2 difference CS pins. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the update. Glad the problem is resolved. |
Beta Was this translation helpful? Give feedback.
Phil, we have resolved this issue thanks to Terje's perseverance! There is a new sdcard.c commit, which fixes the ethernet crashing issue.
I have validated its proper operation and closed this topic on the RP2040 grblHAL issues page.