Main Content

Unexpected Behavior with Multiple Stacks Targeting the Same Hardware Resource

R2026b

Issue

When multiple blocks in a model refer to different stacks that target the same hardware resource, the configuration may be overridden at build or runtime. This issue can occur with any block type that uses RASC stacks, including:

  • PWM Output blocks targeting the same GPT channel

  • Timer blocks targeting the same GPT or AGT instance

  • Port Output Enable (POEG) blocks targeting the same POEG group

  • SPI blocks targeting the same SPI module

  • ADC blocks targeting the same ADC unit

As a result, the block outputs can show inconsistent or incorrect behavior because one stack configuration overrides another.

Solution

Ensure that all blocks in the model that target the same hardware resource refer to the same stack instance.

  • Avoid configuring multiple stacks that target the same hardware peripheral instance.

  • Use a single, consistent stack for all blocks that access the same hardware resource.

  • Review the RASC project to confirm that stacks are not duplicated for the same peripheral.

After aligning all blocks to use the correct stack instances, rebuild and redeploy the model to apply the corrected configuration.