I am building off of the FlexCAN Traffic example in the MBDT to create a model that receives multiple CAN messages. I am using a method very similar to what Razvan just happened to post here.
However, I am also trying to use the Simulink Vehicle Network Toolbox to unpack the data in the CAN messages into usable signals using a .dbc file.
In some scenarios I am getting a build error indicating that stack and heap are overlapping. Some scenarios:
- Single CAN message RX with multiple signals being unpacked - builds ok
- Two CAN message RX with a single signal being unpacked from each message - builds ok
- Two CAN message RX with one signal being unpacked from one message and multiple signals being unpacked from the other message - build fails with error
If I don't use the Vehicle Network Toolbox and manually unpack the data from the CAN message for multiple messages I don't seem to have a problem, although I haven't tried that extensively yet.
Examples of each of the above scenarios are attached, along with a build log showing the error I get in the third scenario. Can someone offer some insight as to what is causing the stack/heap issue and how to avoid it when using the vehicle network toolbox for CAN message unpacking?