GreenWaves-Technologies / gap_sdk

SDK for Greenwaves Technologies' GAP8 IoT Application Processor
https://greenwaves-technologies.com/en/gap8-the-internet-of-things-iot-application-processor/
Apache License 2.0
141 stars 78 forks source link

How to develop I2C driver on AI-deck #410

Open mfxjx000205 opened 10 months ago

mfxjx000205 commented 10 months ago

Hi,

In the past few weeks of development, I've run into a very tricky problem. Since the Crazyflie 2.1 flight control board is weak in terms of arithmetic and memory, our work hopes to make some of the expansion boards with sensors independent. Driven only by the ai-deck without going through crazyflie.

Based on the above idea, we did the following:

As this page shows, we referenced ETH-Zurich's github to make an identical piece of tof-deck. The tof-deck is a ranging expansion board consisting of two vl53l5cx sensors, and a TCA6408 I2C expander, capable of communicating with other devices via an I2C interface. Colleagues who are familiar with multiranger-deck should not need much introduction.

We used the driver code from the page above and the tof-deck was driven quite correctly on crazyflie. So, we wanted to drive the tof-deck directly, via I2C, on the AI-deck, and that's where we hit a roadblock.

a) We connect the I2C interface of the tof-deck, to the I2C interface of the AI-deck, SDA to pin R8 (SPARE_I2C_SDA), SCL to pin R9(SPARE_I2C_SCL).

b) We refer to the I2C example function in gap_sdk and want to test whether AI-deck can directly drive tof-deck. The expected way to test this is to modify the value of a register on a TCA6408.

c) The results of the test are unsatisfactory; no matter what method we use, the bus always reads 255, which is 11111111. According to the operating principle of I2C, the data bus is always high when it is not started. This should be the bus not starting.

We want to ask that regarding this need of ours, if you have any further development suggestions.

Best Wishes!

Hanjie.

gwtsivasiva commented 9 months ago

Hi,

Since this project is not maintained by us (GreenWaves Technologies), we don't have all the details. I will suggest that you ask the repo owner.

But I have quickly checked their schematics in the repo you sent, and I don't see any pull-up/pull-down on their I2C, and GAP8 doesn't have embedded pull-up, so first thing to try, I will say to confirm and check this.

Regards, Yao

On Sat, Feb 3, 2024 at 3:35 PM Hanjie Yu @.***> wrote:

Hi,

In the past few weeks of development, I've run into a very tricky problem. Since the Crazyflie 2.1 flight control board is weak in terms of arithmetic and memory, our work hopes to make some of the expansion boards with sensors independent. Driven only by the ai-deck without going through crazyflie.

Based on the above idea, we did the following:

As this page https://github.com/ETH-PBL/Matrix_ToF_Drones shows, we referenced ETH-Zurich's github to make an identical piece of tof-deck. The tof-deck is a ranging expansion board consisting of two vl53l5cx sensors, and a TCA6408 I2C expander, capable of communicating with other devices via an I2C interface. Colleagues who are familiar with multiranger-deck should not need much introduction.

We used the driver code from the page above and the tof-deck was driven quite correctly on crazyflie. So, we wanted to drive the tof-deck directly, via I2C, on the AI-deck, and that's where we hit a roadblock.

a) We connect the I2C interface of the tof-deck, to the I2C interface of the AI-deck, SDA to pin R8 (SPARE_I2C_SDA), SCL to pin R9(SPARE_I2C_SCL).

b) We refer to the I2C example function https://github.com/GreenWaves-Technologies/gap_sdk/blob/master/examples/gap8/basic/interfaces/i2c/i2c_bmp280/test_i2c_bmp280.c in gap_sdk and want to test whether AI-deck can directly drive tof-deck. The expected way to test this is to modify the value of a register on a TCA6408.

c) The results of the test are unsatisfactory; no matter what method we use, the bus always reads 255, which is 11111111. According to the operating principle of I2C, the data bus is always high when it is not started. This should be the bus not starting.

We want to ask that regarding this need of ours, if you have any further development suggestions.

Best Wishes!

Hanjie.

— Reply to this email directly, view it on GitHub https://github.com/GreenWaves-Technologies/gap_sdk/issues/410, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI6O77OOASIWCLUEZBGFZCTYRZDJNAVCNFSM6AAAAABCYCPHYSVHI2DSMVQWIX3LMV43ASLTON2WKOZSGEYTMNJRGE4TQMQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

--

Yao ZHANGGlobal Customer Success Director APAC Business Development Director Tel: 06.82.78.41.71 Mail: @.*** Skype: zhyao930 Wechat: 453115693

[image: https://greenwaves-technologies.com/] https://greenwaves-technologies.com/