Skip to content

[CAN] Control callback crashes when using thingset_import_data #57

@jalinei

Description

@jalinei

Hi, it's me again 😄

I'm currently troubleshooting CAN control broadcasting.
My current setup is the following : Two nodes are connected, one is broadcasting one data object with object-id 0x8001, I'm listening the bus with the Peak dongle.
The nodes have a can_control_rx_handler that go through these control messages with ids > 8000

I'm facing what I do believe is a bug :
Using thingset_import_data in control report callback leads to a general crash, without any LOG_ERR
or LOG of any kind. The MCU gets fully stuck without outputting any fatal reporting.

I'm using the sample you've done when we were working on the Vhelio e-bike.

jalinei/Core@6dccaba

I've commented out the culprit function and I've added HEXDUMP to check the frame before using thingset_import_data.
I'm posting the HEXDUMP output below, it seems valid to me.

[00:00:33.412,000] <inf> ts_can: Thingset frame:
                                 a1 19 80 01 fa 00 00 00  00                      |........ .       
[00:00:34.412,000] <inf> ts_can: received control msg with id 0x8001 from addr 0xC6
[00:00:34.412,000] <inf> ts_can: Thingset frame:
                                 a1 19 80 01 fa 3a 83 12  6f 

Here is the corresponding candump snippet, everything looks sane as well.

  can0  0E8001C6   [5]  FA 00 00 00 00
  can0  0E8001C6   [5]  FA 3A 83 12 6F

I made sure that the data item is writtable in my data_object :

THINGSET_ADD_ITEM_FLOAT(ID_CTRL, ID_CTRL_REFERENCE, "zCtrlReference",
                        &reference_value, 1, THINGSET_ANY_RW, SUBSET_CTRL);

At first I was having a different setup in which both nodes where broadcasting the same 0x8001 data objct, so I was thinking that it was some kind of race conditions to access the data-object.
I simplified the setup so only one node is broadcasting and the second is listening, and I still have the same issue. I works perfectly without calling thingset_import_data but crashes when calling it.

Any clue in what direction to look ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions