AnsweredAssumed Answered

SEMC Demo Project i.mxRT1050

Question asked by Christian Gradl on Apr 25, 2018
Latest reply on May 10, 2018 by Christian Gradl

Hi, i 've just downloaded the semc demo project for i.mxrt1050. i think there is a very fatal mistake

 

void SEMC_GetDefaultConfig(semc_config_t *config)
{
    assert(config);

    semc_axi_queueweight_t queueWeight; /*!< AXI queue weight. */
    semc_queuea_weight_t queueaWeight;
    semc_queueb_weight_t queuebWeight;

 

    /* Get default settings. */
    config->dqsMode = kSEMC_Loopbackinternal;
    config->cmdTimeoutCycles = 0;
    config->busTimeoutCycles = 0x1F;

 

    /* Set a typical weight settings. */
    memset((void *)&queueWeight, 0, sizeof(semc_axi_queueweight_t));

 

    queueaWeight.qos = SEMC_BMCR0_TYPICAL_WQOS;
    queueaWeight.aging = SEMC_BMCR0_TYPICAL_WAGE;
    queueaWeight.slaveHitSwith = SEMC_BMCR0_TYPICAL_WSH;
    queueaWeight.slaveHitNoswitch = SEMC_BMCR0_TYPICAL_WRWS;
    queuebWeight.qos = SEMC_BMCR1_TYPICAL_WQOS;
    queuebWeight.aging = SEMC_BMCR1_TYPICAL_WAGE;
    queuebWeight.slaveHitSwith = SEMC_BMCR1_TYPICAL_WRWS;
    queuebWeight.weightPagehit = SEMC_BMCR1_TYPICAL_WPH;
    queuebWeight.bankRotation = SEMC_BMCR1_TYPICAL_WBR;

 

    config->queueWeight.queueaWeight = &queueaWeight;
    config->queueWeight.queuebWeight = &queuebWeight;
}

 

 

Both vars "queueaWeight" and "queuebWeight" are on the stack.

The function void SEMC_Init reads the pointers, etc., etc. etc.

How can this work? The content of the Stackmem is not saved....

Outcomes