AnsweredAssumed Answered

FLEXBUS_Init trouble?

Question asked by biafra on Oct 30, 2017
Latest reply on Oct 31, 2017 by Jing Pan

Hi everyone,

 

I'm using a custom board based on K66FN2M0VMD18 chip with MCUXpresso 10.0.2 (build 411) and an SDK created with online tools.

It seems that there an issue on using two different chip select pins on external flexbus.

 

Based on the example provided with the SDK, i think that the initialization procedure should be:

 

//chip select 1

FLEXBUS_GetDefaultConfig(&flexbusUserConfig);

 

//do some modification on the dafault config for CS1

 

/* Initialize and configure FLEXBUS module */
FLEXBUS_Init(FB, &flexbusUserConfig); //initialize CS1

 

And then:

 

//chip select 2

FLEXBUS_GetDefaultConfig(&flexbusUserConfig);

 

//do some modification on the dafault config for CS2

 

/* Initialize and configure FLEXBUS module */
FLEXBUS_Init(FB, &flexbusUserConfig); //initialize CS2

 

At this point the configuration of CS1 is wiped out because of FLEXBUS_Init() function.

 

...

for (chip = 0; chip < FB_CSAR_COUNT; chip++)
{
   /* Reset CSMR register, all chips not valid (disabled) */
   base->CS[chip].CSMR = 0x0000U;
   /* Set default base address */
   base->CS[chip].CSAR &= (~FB_CSAR_BA_MASK);
   /* Reset FB_CSCRx register */
   base->CS[chip].CSCR = 0x0000U;
}
...

 

When the FLEXBUS_Init() function is called for the second time, it deletes the settings of CS1.

 

Which is the correct way to initialize two different chip select pins?

 

Many thanks

Biafra

Outcomes