June-10th-2020, 01:46 PM
Hello,
I want to use the NetHAT via a non linux embedded environment. I'm using the M4 processor of the STM32MP157C-DK2 board.
I didn't think it would be too difficult knowing that the netShield which uses the same netX52 works with stm32 nucleo boards
The netHAT has EtherCAT firmware already loaded from linux
For the SPI configuration I used the exact same code from one of the samples along with cifxToolkit taken from "STM32CubeExpansion_netX_F7_F4_V1.3.0.1" file on your website for the netShield
Projects\STM32F429ZI-Nucleo\Applications\netX\Common\Src\main.c:
With this configuration I'm receiving bytes backward, and shifted one bit and with 0xFF between each byte.
When I set CLKPhase to SPI_PHASE_1EDGE, I'm receiving the bytes, shifted one bit to left and 0xFF between each byte
Here is a picture that illustrates the problem:
![[Image: 9YfCYNH.png]](https://i.imgur.com/9YfCYNH.png)
The spi is configured to 50mhz.
I have tried all combinations of CLKPhase and CLKPolarity and none works as it should.
Does the netHat have a different configuration for SPI than the netShield ? Because the configuration from the sample you provided for the netShield doesn't seem to work on the netHat
Can I get more information about how the netHat spi is configured and how should I configure my master spi correctly ?
Thank you
I want to use the NetHAT via a non linux embedded environment. I'm using the M4 processor of the STM32MP157C-DK2 board.
I didn't think it would be too difficult knowing that the netShield which uses the same netX52 works with stm32 nucleo boards
The netHAT has EtherCAT firmware already loaded from linux
For the SPI configuration I used the exact same code from one of the samples along with cifxToolkit taken from "STM32CubeExpansion_netX_F7_F4_V1.3.0.1" file on your website for the netShield
Projects\STM32F429ZI-Nucleo\Applications\netX\Common\Src\main.c:
Code:
SpiHandle.Instance = SPIx;
SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16;
SpiHandle.Init.Direction = SPI_DIRECTION_2LINES;
SpiHandle.Init.CLKPhase = SPI_PHASE_2EDGE;
SpiHandle.Init.CLKPolarity = SPI_POLARITY_HIGH;
SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT;
SpiHandle.Init.FirstBit = SPI_FIRSTBIT_MSB;
SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE;
SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
SpiHandle.Init.CRCPolynomial = 7;
SpiHandle.Init.NSS = SPI_NSS_SOFT;
SpiHandle.Init.Mode = SPI_MODE_MASTER;
With this configuration I'm receiving bytes backward, and shifted one bit and with 0xFF between each byte.
When I set CLKPhase to SPI_PHASE_1EDGE, I'm receiving the bytes, shifted one bit to left and 0xFF between each byte
Here is a picture that illustrates the problem:
![[Image: 9YfCYNH.png]](https://i.imgur.com/9YfCYNH.png)
The spi is configured to 50mhz.
I have tried all combinations of CLKPhase and CLKPolarity and none works as it should.
Does the netHat have a different configuration for SPI than the netShield ? Because the configuration from the sample you provided for the netShield doesn't seem to work on the netHat
Can I get more information about how the netHat spi is configured and how should I configure my master spi correctly ?
Thank you