grblHAL / STM32F4xx

grblHAL driver for ST STM32F4xx (Nucleo-64, Blackpill)
Other
90 stars 85 forks source link

STM32F411 SD&W5500 Is it possible to have both #168

Closed auxp closed 5 months ago

auxp commented 5 months ago

STM32F411 SD&W5500 Is it possible to have both

terjeio commented 5 months ago

yes, if the pin map allows it

auxp commented 5 months ago

是的,如果引脚映射允许的话

Thank you, do you have a template

auxp commented 5 months ago

是的,如果引脚映射允许的话

谢谢,你有模板吗

SPI Can it be shared

terjeio commented 5 months ago

Here is an example.

auxp commented 5 months ago

下面是一个示例。 I am trying [PIN:PA6,MISO] [PIN:PA7,MOSI] [PIN:PB12,SPI CS] [PIN:PA4,SD card CS] [PIN:PB14,SPI reset] [PIN:PB13,SPI IRQ] [PIN:PA5,I2C SCK]

[PLUGIN:Bootloader Entry v0.02] [WIZCHIP:W5500] [MAC:56:34:12:dc:08:00] [IP:] [PLUGIN:SDCARD v1.13] [PLUGIN:FS macro plugin v0.07]

Unable to obtainip

terjeio commented 5 months ago

Unable to obtainip

You get IP whe SD card is disabled?

auxp commented 5 months ago

无法获取ip

您获得 IP whe SD 卡被禁用了吗?

Can't they be used at the same time?

terjeio commented 5 months ago

They can - but when debugging it is sometimes better to check stuff separately.

auxp commented 5 months ago

他们可以 - 但是在调试时,有时最好单独检查内容。

Disabled SD still unable to obtain

terjeio commented 5 months ago

Add strcpy(IPAddress, "N/A"); before this line. If IP is reported as N/A then SPI communication with the WizChip is not working and you will have to debug that. If still blank there is no network connection or DHCP is not supported by the router. The magjack status LEDs may indicate what is wrong.

auxp commented 5 months ago

strcpy(IPAddress, "N/A");``N/A

[WIZCHIP:W5500] [MAC:56:34:12:dc:08:00] [IP:N/A] Green light always on, yellow light irregular slow flashing

warning: 'ethernet_frame_crc' declared 'static' but never defined [-Wunused-function] 110 | static uint32_t ethernet_frame_crc(const uint8_t *data, int length);

auxp commented 5 months ago

IP is reported as then SPI communication with the WizChip is not working and you will have to debug that.

SPI communication with the WizChip is not working Where is the problem

terjeio commented 5 months ago

Where is the problem

Bad wiring? Incorrect SPI port? ...?

auxp commented 5 months ago

问题出在哪里

接线不良?SPI端口不正确?...?

[PIN:PA6,MISO] [PIN:PA7,MOSI] [PIN:PB12,SPI CS] [PIN:PA9,SPI reset] [PIN:PA10,SPI IRQ] [PIN:PA5,I2C SCK]

It is very clear that there is no wrong connection. Can't the above pins be used

auxp commented 5 months ago

问题出在哪里

接线不良?SPI端口不正确?...?

[PIN:PA6,味噌] [引脚:PA7,MOSI] [引脚:PB12,SPI CS] [PIN:PA9,SPI复位] [引脚:PA10,SPI IRQ] [引脚:PA5,I2C SCK]

很明显,没有错误的连接。上面的引脚不能用吗 my-machineHow to configure it inside

terjeio commented 5 months ago

Ok, then MCU pins or the WizChip might be damaged? Or PA10 is not interrupt capable due to another port having pin 10 allocated to an interrupt? Or clashes in the pin map leaving one of the pins in the wrong configuration? Check with the $pins command. If you have access to a scope or a logic analyzer then it might be a good idea to check the signalling. The reset and IRQ pins can be checked with a voltmeter - IIRC both sould be high level, the IRQ pin most of the time.

FYI I have the code working on a F412 - even running the WebUI at this very moment so I assume the code is ok.

auxp commented 5 months ago

好的,那么MCU引脚或WizChip可能损坏了吗?或者 PA10 由于另一个端口将引脚 10 分配给中断而无法中断?或者引脚映射中的冲突使其中一个引脚处于错误的配置中?使用命令进行检查。如果您有权访问示波器或逻辑分析仪,那么检查信令可能是个好主意。复位和 IRQ 引脚可以用电压表检查 - IIRC 都是高电平的,IRQ 引脚大部分时间都是高电平。$pins

仅供参考,我有代码在 F412 上工作 - 甚至在此时运行 WebUI,所以我认为代码没问题。

mo sck by L?

3 warnings, disappear after recompiling

networking/wiznet/port/w5x00_lwip.c:167:17: warning: 'ethernet_frame_crc' defined but not used [-Wunused-function] 167 | static uint32_t ethernet_frame_crc(const uint8_t *data, int length)

networking/wiznet/port/w5x00_lwip.h:110:17: warning: 'ethernet_frame_crc' declared 'static' but never defined [-Wunused-function] 110 | static uint32_t ethernet_frame_crc(const uint8_t *data, int length);

Src/w5x00_ll_driver.c:122:42: warning: passing argument 2 of 'reg_wizchip_spi_cbfunc' from incompatible pointer type [-Wincompatible-pointer-types] 122 | reg_wizchip_spi_cbfunc(spi_get_byte, spi_put_byte);

terjeio commented 5 months ago

mo sck by L?

I do not understand this.

The warnings can be ignored.

auxp commented 5 months ago

$pins

$pins [PIN:PA5,I2C SCK] I2C?

terjeio commented 5 months ago

$pins [PIN:PA5,I2C SCK] I2C?

I have recently added SPI specific names used for the $pins report but not yet updated all the code where SPI and I2C clock pins is named the same.

You may change these from Output_SCK to Output_SPICLK - but note it does not change the function, only the report output.

auxp commented 5 months ago

$pins [PIN:PA5,I2C SCK] I2C?

我最近添加了用于$pins报告的 SPI 特定名称,但尚未更新 SPI 和 I2C 时钟引脚命名相同的所有代码。

您可以将这些更改为 - 但请注意,它不会更改函数,只会更改报告输出。Output_SCK``Output_SPICLK

Thank you! Replaced the W5500 module to solve the problem.STM32F411 unavailable ESP3D?//#define WEBUI_ENABLE 3// Enable ESP3D-WEBUI plugin along with networking and SD card plugins. // NOTE: Only fully compatible with F412 and F429 MCUs.

auxp commented 5 months ago

$pins [PIN:PA5,I2C SCK] I2C?

我最近添加了用于$pins报告的 SPI 特定名称,但尚未更新 SPI 和 I2C 时钟引脚命名相同的所有代码。 您可以将这些更改为 - 但请注意,它不会更改函数,只会更改报告输出。Output_SCKOutput_SPICLK ``

谢谢!已更换W5500模块以解决问题。STM32F411 ESP3D不可用?//#define WEBUI_ENABLE 3// 启用 ESP3D-WEBUI 插件以及网络和 SD 卡插件。 // 注意:仅与 F412 和 F429 MCU 完全兼容。

F412 Compilation error Sorry! I don't quite understand the program ../Src/main.c: In function 'SystemClock_Config': ../Src/main.c:334:28: error: 'RCC_OscInitStruct' undeclared (first use in this function) 334 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { | ^~~~~ ../Src/main.c:334:28: note: each undeclared identifier is reported only once for each function it appears in ../Src/main.c:363:49: error: 'FLASH_LATENCY' undeclared (first use in this function); did you mean 'FLASH_LATENCY_1'? 363 | if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY) != HAL_OK) { | ^~~~~ | FLASH_LATENCY_1 make: [Src/subdir.mk:85: Src/main.o] Error 1 make: Waiting for unfinished jobs....

terjeio commented 5 months ago

For F412 comment out this and this line. Note that the clock parameters may have to be changed to match the crystal frequency of your board.

STM32F411 unavailable ESP3D?

Not necessarily, may fail or at least the full range of grblHAL settings cannot be changed from the UI due to lack of RAM.

auxp commented 5 months ago

Sorry! I asked a bit too many questions

make: No rule to make target 'D:\Projects\STM\GRBL Driver STM32F401\STM32F412VGTX_FLASH.ld', needed by 'firmware.elf'. Stop. make: Waiting for unfinished jobs....