This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/BQ40Z50-R1: Linux/BQ40Z50-R1

Part Number: BQ40Z50-R1
Other Parts Discussed in Thread: BQSTUDIO

Tool/software: Linux

Can you communicate with BQ40z50-R! using Linux?

Here is issue my customer is having:

For example, the follows are what our application sent to inquiry firmware version:

 

<7>i2c i2c-1: master_xfer[0] W, addr=0x16, len=3

<7>omap_i2c omap_i2c.1: msg->buf[0]=0x44

<7>omap_i2c omap_i2c.1: msg->buf[1]=0x2

<7>omap_i2c omap_i2c.1: msg->buf[2]=0x0

 

But it says can’t write 0x02 command to reg 0x44:

<6>i2c write word fail: can't write 0x02 to reg 0x44

<6>Failed to send firmware version subcommand:-121

Let me know if you have a solution how to communicate with Linux?

  • Hi,
    The main issue seems to be that since 0x44 is a block write, it needs to have a buffer length for the block write that seems to be missing.
    The message should be as follows:
    <7>i2c i2c-1: master_xfer[0] W, addr=0x16, len=4
    <7>omap_i2c omap_i2c.1: msg->buf[0]=0x44
    <7>omap_i2c omap_i2c.1: msg->buf[1]=0x02
    <7>omap_i2c omap_i2c.1: msg->buf[2]=0x02
    <7>omap_i2c omap_i2c.1: msg->buf[3]=0x00

    Here is a beagle capture of this transaction. (Please note that since bqStudio uses PEC, there is an extra byte, without PEC the above example would be correct):

    Regards,

    Swami

  • Thanks for the information.

    I have tried with the followings as you suggested, I still get I2c Status register No ack error.

    <7>i2c i2c-1: master_xfer[0] W, addr=0x16, len=4
    <7>omap_i2c omap_i2c.1: dev->speed=100,msg->buf[0]=0x44
    <7>omap_i2c omap_i2c.1: dev->speed=100,msg->buf[1]=0x2
    <7>omap_i2c omap_i2c.1: dev->speed=100,msg->buf[2]=0x2
    <7>omap_i2c omap_i2c.1: dev->speed=100,msg->buf[3]=0x0
    <7>omap_i2c omap_i2c.1: addr: 0x0016, len: 4, flags: 0x0, stop: 1
    <7>omap_i2c omap_i2c.1: IRQ (ISR = 0x4000)
    <7>omap_i2c omap_i2c.1: IRQ (ISR = 0x1002)
    <7>omap_i2c omap_i2c.1: IRQ (ISR = 0x0004)
    <6>Failed to send firmware version subcommand:-121
  • Hi,
    I am not very familiar with Linux, but the best approach to resolve this issue would be to look at the transactions from bqStudio for this command and duplicate it in your Linux environment.
    There is also a Linux driver example that might be helpful. It is located at github.com/.../bq40z50
    Regards,
    Swami