FLEXBUS_Init trouble?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FLEXBUS_Init trouble?

Jump to solution
898 Views
biafra
Senior Contributor I

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

1 Solution
591 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Francesco,

Yes, you are right. FLEXBUS_Init() can only be used one time. Otherwise it will clear the work before.In fact, the MCUXpresso SDK V2.2.0 software Flexbus driver doesn't provide full features of the Flexbus module.
Customer can add related secondary wait states setting function in application code.
Sorry for that may bring any inconvenience to you.

Regards

Jing

View solution in original post

3 Replies
592 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Francesco,

Yes, you are right. FLEXBUS_Init() can only be used one time. Otherwise it will clear the work before.In fact, the MCUXpresso SDK V2.2.0 software Flexbus driver doesn't provide full features of the Flexbus module.
Customer can add related secondary wait states setting function in application code.
Sorry for that may bring any inconvenience to you.

Regards

Jing

591 Views
biafra
Senior Contributor I

Hi Jing,

Have the Flexbus driver been updated?

Many thanks,

Biafra

591 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Biafra,

No, it hasn't. You can see the driver version at the top of each .h file. It looks like

#define FSL_FLEXBUS_DRIVER_VERSION (MAKE_VERSION(2, 0, 1)) /*!< Version 2.0.1. */

Regards,

Jing