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.

BQ27320: DEVICE_NAME mac subcommand description missing in TRM

Part Number: BQ27320

Hello,

I am writing a driver for a BQ27320, using the Technical Reference Manual (SLUUBE6A, March 2018) and can not find description of the DEVICE_NAME subcommand in section 2.1.x.
How many bytes should it return? Is the subcommand number, 0x004A, correct?

With my implementation of `read_mac_command()` I can successfully read DEVICE_TYPE (0x0001) while DEVICE_NAME (0x004A) returns garbage data, response length is 11 bytes (MACDataLen register at 0x61).

  • Hello Jure,

    Device name is stored as ASCII characters in Data memory.

  • Thank you for your response.
    It was a bug on my side (was reading into uint8_t instead of char array, and did not add the null-terminator before printing it out).

    In case somebody else is struggling with understanding MACDataLen, here is explanation:
    MACDataLen (11 bytes) = device name string (7 bytes, without null terminator, just ascii letters) +  mac subcommand (2 byte) + checksum (1 byte) + length byte itself (1 byte).