OpenNuvoton / MA35D1_Buildroot

MA35D1 Buildroot
Other
11 stars 8 forks source link

Buildroot SPI for Linux #19

Closed Barmallini closed 2 months ago

Barmallini commented 2 months ago

Unable to add spi0 and spi2 to Linux. Added status OK to dts, but no spi devices in ls /dev

Found this example: http://forum.nuvoton.com/viewtopic.php?t=11238

I need raw spi

cwweng-nuvoton commented 2 months ago

Please modify Linux Kernel configuration and device tree to generate spi0 and spi2 devices in /dev

  1. Enable Kernel config CONFIG_SPI_SPIDEV image

  2. Set spidev node of spi0 and spi2 in device tree image

  3. Rebuild and boot Linux Kernel. spidev1.1 and spidev2.1 are generated in /dev image

Barmallini commented 2 months ago

compatible = "spidev", default driver?

cwweng-nuvoton commented 2 months ago

compatible = "spidev"; is also fine. Following is another sample image It can generate /dev/spidev1.0, /dev/spidev2.0 for spi0 and spi2 respectively. image

Barmallini commented 2 months ago

Not sure about value Spidev arrived to /dev, but spi not working. Maybe CS misconfigured?

IMG_20240719_080655_749

IMG_20240719_080701_270

Barmallini commented 2 months ago

Most valuable information taked from ST wiki:

https://wiki.st.com/stm32mpu/wiki/SPI_device_tree_configuration

Barmallini commented 2 months ago

Actually, SPI start working. Issue with DMA. Better to say - it works with DMA (disabled by default in dts) and do not work without DMA (loose 1 byte in transaction and stuck in infinity loop, RXFIFO empty)