Re: How can I use I2C?

2021-05-02 Thread Alan Carvalho de Assis
You are mostly right, you only need /dev/i2cX if you want to run the i2ctool. But some drivers could create its /dev/xyz even when the device is not present, because some those drivers don't have a kind of probe() function to get a confirmation from the driver. When the extern I2C or SPI device

Re: How can I use I2C?

2021-05-02 Thread yuta
Hi Alan, Thank you for the information! --- My understanding for now is below. (For nucleo-F767 board) - An initialization file is lying in nuttx/boards/arm/stm32f7/nucleo-144/src/stm32_appinitialize.c. (Contents in this file is executed when launching NuttX.) - Initialization code for

Re: How can I use I2C?

2021-05-01 Thread Alan Carvalho de Assis
Hi Yuta, stm32_mpu9250initialize("/dev/mpu0"); This function receive the name of the device file it will creste. The /dev/i2cX is created by the funcion i2c_register(). BR, Alan On Saturday, May 1, 2021, yuta wrote: > Gregory, > > Thank you for your answer. > I think I'm asking very easy

Re: How can I use I2C?

2021-05-01 Thread yuta
Gregory, Thank you for your answer. I think I'm asking very easy question since I'm very new to NuttX. I'm not still sure how I can enable an I2C device. I understood that there are lower-half driver and upper-half driver and they should be associated each other with initialization code.

Re: How can I use I2C?

2021-05-01 Thread yuta
Abdelatif, Thank you for your advice. I enabled I2C tool in menuconfig. Then I added some lines to initialize I2C in stm32_appinitialize.c refering to the link you shared. https://github.com/apache/incubator-nuttx/blob/master/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_bringup.c#L89-L111

Re: How can I use I2C?

2021-04-30 Thread Gregory Nutt
On 4/30/2021 6:34 AM, yuta wrote: Hi all, I'm trying to use I2C. I configured below in menuconfig. - System Type > STM32 Peripheral Support > [*] I2C1 - Device Drivers > [*] I2C Driver Support then compilation was done successfully. But no I2C device( like /dev/i2c1 ) showed up when I tried ls

Re: How can I use I2C?

2021-04-30 Thread yuta
Hi Alan, Thank you for the link. I watched it! Sorry I forgot to say that I've configured ` I2C Character driver support ` as well. However,  /dev/i2c1 (or something like this) did not show up. I'm going to try to register i2c driver. Yuta Ide On 2021/04/30 21:47, Alan Carvalho de Assis

Re: How can I use I2C?

2021-04-30 Thread Abdelatif Guettouche
If you want to use the I2C tool, you'll also have to register the i2c driver from your board logic. See: https://github.com/apache/incubator-nuttx/blob/master/boards/arm/stm32f0l0g0/nucleo-g070rb/src/stm32_bringup.c#L89-L111

Re: How can I use I2C?

2021-04-30 Thread Alan Carvalho de Assis
Hi Yuta, Yes, you forgot to select the I2C Character driver support. Please try to follow this tutorial: https://www.youtube.com/watch?v=RzrDa4Sm1rU BR, Alan On 4/30/21, yuta wrote: > Hi all, > I'm trying to use I2C. > I configured below in menuconfig. > - System Type > STM32 Peripheral

How can I use I2C?

2021-04-30 Thread yuta
Hi all, I'm trying to use I2C. I configured below in menuconfig. - System Type > STM32 Peripheral Support > [*] I2C1 - Device Drivers > [*] I2C Driver Support then compilation was done successfully. But no I2C device( like /dev/i2c1 ) showed up when I tried ls /dev Do I forget something to do?