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.

LAUNCHXL-CC1352P: LaunchPad -Cc1352P1 with mounted BoosterPack Accelerometer interaction with Edge Impulse

Part Number: LAUNCHXL-CC1352P
Other Parts Discussed in Thread: CC1352P, BOOSTXL-ULPSENSE

Tool/software:

HI,

I am trying to train a model based on gathered accelerometer data on Edge Impulse (https://studio.edgeimpulse.com/)

My HW consists of a TI LaunchPad of type CC1352P1 on which I have a mounted BoosterPack accelerometer providing x,y,z axes information.

The LaunchPad is connected via a USB cable to a PC running Windows 10.


1st, to check things work regardless of Edge Impulse interface, I have loaded the TI_Accelrometer.scp example on the Sensor Controller Studio, and observed the accelerometer indeed provided measurements of the x,y,z axes and detected tilt while the EVB board with the mounted accelerometer has changed positions.

For the next step i wanted to start capturing the accelerometer data via Edge Impulse.
I have followed the instructions as specified in: TI CC1352P Launchpad | Edge Impulse Documentation
As far as i understood, there was no additional HW or wiring needed in order for the EVB and Accelerometer to communicate. (we do not need the audio feature, just the accelerometer)

I have installed the edge-impulse-cli applications and followed the instruction as described in:
Installation | Edge Impulse Documentation

 

I have also downloaded the LaunchPad firmware from: https://cdn.edgeimpulse.com/firmware/ti-launchxl.zip and successfully flashed it using flash_windows.bat.

 
Next step, on Edge Impulse web interface, I have opened a new Accelerometer project to gather the data.

On PC command dialog, I ran the following: edge-impulse-daemon

I filled the login credentials for my Edge account, selected the correct XDS110 port and Baudrate and confirmed connection, as seen below:

 

 

On Edge Impulse, device could be seen as being connected:

 

 

 

On “Data Acquisition” the device was recognized as well and was set as seen below:

 

 

Now, I have pressed "Start Sampling" and that brought the issue seen below that suggests the Accelerometer is not communicating with the LaunchPad:

 [ WS ] Incoming sampling request {

  path: '/api/training/data',

  label: 'Idle',

  length: 10000,

  interval: 10,

  hmacKey: '834448f67fbd763714437d658549aca2',

  sensor: 'Accelerometer'

}

[SER] Configured upload settings

[SER] Sampling started

[SER] Sampling failed ERR: Failed to get data, is your accelerometer connected?

[WS ] Failed to sample data ERR: Failed to get data, is your accelerometer connected?

 

 

If you may, please a few questions,

As far as we understood, the firmware we have flashed to the EVB should have defined and initialized the SPI interface between the LaunchPad and the accelerometer.

Considering things worked well using the Sensor Controller, TI's HW is working fine, so could we be certain the flashed firmware is the latest and configures the interface fine?

(I would like at this point to refrain from cloning the git repository: edgeimpulse/firmware-ti-launchxl: Edge Impulse firmware for TI LAUNCHXL-CC1352P1 development board and build the project for my IAR environment)

 

could the root cause be different then the firmware? i.e. board configuration, Edge Impulse interface, etc?

 

Thank you very much,
Best regards,

Eran

  • HI Eran,

    Is there any way you could have a company proxy that is currently blocking the WebSocket from communication with the EdgeImpulse GUI? Do you have the possibility of testing outside your company's network?

    Regards,

    Arthur

  • Hi Arthur,

    There is no proxy blocking the communication with Edge Impulse, for example, I can upload csv files with accelerometer data onto it for training a model.
    I am not sure about testing this outside the company's network but i can ask.

    I thought the problem may be with a missing of initialization of the accelerometer interface. I have tried running some initialization via a python script, with the values taken from the sensor controller project, before running the edge-impulse-daemon again, but it did not change the problem.

    For reference, the script accelerometer_init.py has the following content:

    import serial
    import time

    # Configuration constants (from your Sensor Controller code)
    AUXIO_SPI_CSN_ACCEL = 0 # Placeholder; adjust based on your setup
    ACCEL_SPI_WRITE = 0x0A # Write command for ADXL362
    ACCEL_REG_SOFT_RESET = 0x1F
    ACCEL_SR_KEY = 0x52
    ACCEL_REG_INTMAP1 = 0x2A
    ACCEL_IM_DATA_READY = 0x01
    ACCEL_REG_POWER_CTL = 0x2D
    ACCEL_PC_LOW_NOISE_0 = 0x00 # Adjust as needed
    ACCEL_PC_MEASURE_ON = 0x02

    # Serial port settings (adjust COM port and baud rate)
    SERIAL_PORT = "COM38" # Replace with your CC1352P’s COM port
    BAUD_RATE = 115200 # Common baud rate; adjust if needed

    def spi_write_reg(serial_conn, addr, value):
    """Simulate SPI write over UART."""
    # Assuming the firmware expects a simple byte sequence: [WRITE, ADDR, VALUE]
    cmd = bytes([ACCEL_SPI_WRITE, addr, value])
    serial_conn.write(cmd)
    time.sleep(0.01) # Small delay to mimic SPI timing

    def initialize_accelerometer():
    """Perform ADXL362 initialization."""
    try:
    # Open serial connection
    with serial.Serial(SERIAL_PORT, BAUD_RATE, timeout=1) as ser:
    print(f"Connected to {SERIAL_PORT}")

    # Soft reset
    print("Performing soft reset...")
    spi_write_reg(ser, ACCEL_REG_SOFT_RESET, ACCEL_SR_KEY)
    time.sleep(0.1) # 100 ms delay (50 ms + 50 ms)

    # Configure interrupt mapping
    print("Configuring interrupt mapping...")
    spi_write_reg(ser, ACCEL_REG_INTMAP1, ACCEL_IM_DATA_READY)

    # Enable measurement mode
    print("Enabling measurement mode...")
    spi_write_reg(ser, ACCEL_REG_POWER_CTL, ACCEL_PC_LOW_NOISE_0 | ACCEL_PC_MEASURE_ON)

    print("Initialization complete.")

    except serial.SerialException as e:
    print(f"Serial error: {e}")
    except Exception as e:
    print(f"Error: {e}")

    if __name__ == "__main__":
    initialize_accelerometer()


    The script returned no error with communication or settings:


  • Hey Arthur,

    Not sure it matters much, just want to clarify and mention that Eran is using the BOOSTXL-ULPSENSE and not the BOOSTXL-SENSORS as mentioned in the Edge Impulse tutorial.

    BR,

    Nathan 

  • Hi Nathan,

    Thanks for bringing this up, it actually matters a lot. 

    The accelerometer on the ULP sense is connected by SPI https://www.ti.com/lit/ug/swau112a/swau112a.pdf

    whereas the one on the BOOSTXL-SENSORS is connected by I2C. https://www.ti.com/lit/ug/slau666b/slau666b.pdf

    It will thus not work without firmware modifications.

    Regards,

    Arthur

  • Thank you Arthur and Nathan,

    Nathan, What would you suggest for the next step then? 
    can you supply a different firmware to be flashed on the BOOSTXL-ULPSENSE? 
    Is it preferable to replace the BOOSTXL-ULPSENSE with the  BOOSTXL-SENSORS?

    Regards,
    Eran

  • Hi Eran,

    For evaluation purposes, I would recommend you to use the Edge Impulse setup. That is, use the BOOSTXL-SENSORS boosterpack.

    Regards,

    Arthur

  • Thank you Arthur. 
    I will take this discussion then offline with Nathan, see if there is an available BOOSTXL-SENSORS Boosterpack for the evaluation.
    I will update this thread upon progress with the communication with Edge Impulse and capturing accelerometer data.

    Regards,
    Eran