Re: SPI problem

2022-03-08 Thread Roberto Bucher
Thanks again Petro! Your hint was perfect and now the SPI perct works on the nucleo-144 board! Best regards Roberto On 3/8/22 22:31, Petro Karashchenko wrote: Hello Roberto, I've created https://github.com/apache/incubator-nuttx/pull/5697 to fix the problem. Best regards, Petro пн, 7 бер

Re: SPI problem

2022-03-08 Thread Petro Karashchenko
Hello Roberto, I've created https://github.com/apache/incubator-nuttx/pull/5697 to fix the problem. Best regards, Petro пн, 7 бер. 2022 р. о 16:54 Roberto Bucher пише: > Sorry! Forgot my previous error! > > devtype was 23 and not 0x23!!! My fault > > Best regards > > Roberto > > On 3/7/22 16:4

Re: SPI problem

2022-03-07 Thread Roberto Bucher
Sorry! Forgot my previous error! devtype was 23 and not 0x23!!! My fault Best regards Roberto On 3/7/22 16:48, Roberto Bucher wrote: Thanks Petro! This solve one part of the problem: I don't receive any crash now. There is another thinks tht is not clear to me: the macro SPIDEV_ID(spitool-

Re: SPI problem

2022-03-07 Thread Roberto Bucher
Thanks Petro! This solve one part of the problem: I don't receive any crash now. There is another thinks tht is not clear to me: the macro SPIDEV_ID(spitool->devtype, spitool->csn) is defined as #define SPIDEV_ID(type,index) uint32_t)(type)  & 0x) << 16) | \   

Re: SPI problem

2022-03-07 Thread Petro Karashchenko
Hello Roberto, I think that the problem is in the line's: "stm32_gpiowrite(g_spigpio[devid], !selected);". Those should be "stm32_gpiowrite(g_spigpio[SPIDEVID_INDEX(devid)], !selected);". Please try to see if that helps. Best regards, Petro пн, 7 бер. 2022 р. о 12:46 Roberto Bucher пише: > I

Re: SPI problem

2022-03-07 Thread Roberto Bucher
I reached to move a little forward by analyzing the SPI on the nucleo-144 STM32F7 board, and I found out that the problem is now in the calling of SPI_SELECT in the nuttx/drivers/spi/spi_transfer.c and the spi_transfer function. This are the values in the seq structure before launching the SPI

Re: SPI problem

2022-03-06 Thread Roberto Bucher
Thanks Petro I've modified the nucleo-144/src/stm32_spi.c file by simply adding: struct spi_dev_s *g_spiX; and by adding spi_register(g_spiX, X); in the where X is the spi device number (in my example spi2) in the shell the /dev/spi2 is available. Best regards Roberto On 3/6/22 12:49, Pe

Re: SPI problem

2022-03-06 Thread Tim Hardisty
>From my own struggles to get a board (custom board as it happens, but like >others that were there) I found: Board support was often incomplete. Look at other boards to see where and how SPI is initialised and registered. You may find something basic is missing. Stack size. Random errors occu

Re: SPI problem

2022-03-06 Thread Petro Karashchenko
Hello Roberto, I'm asking this because I examined nucleo-144 board source code and currently I do not see a "spi_register" call in board init files. So I assume that you have some modified code and it is very hard to make any conclusions while not seeing the code. Best regards, Petro нд, 6 бер.

Re: SPI problem

2022-03-06 Thread Petro Karashchenko
Hello Roberto, It would be good if you can dump assembly that is generated. What I see is that "int spi_register(FAR struct spi_dev_s *spi, int bus)", so I'm assuming that R0 should be "spi" and R1 should be "bus", but in your dump "R0: 0001 R1: 2004e840" those seems to be inverted (0001 s