TWR-KW21D256 NvModuleInit() is failing

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

TWR-KW21D256 NvModuleInit() is failing

1,148 Views
kedarikrishna
Contributor I

Hi all,

I am working with "TWR-KW21D256" development Board and using Beekit I created the Ha_OnOffSwitch IAR Project. When I am debugging the same , in main() code initialization:

if (NvModuleInit() != gNVM_OK_c)

  {

    /* NV Module has failed initialization. Lock up node */

    TurnOnLeds();

    while(1);

  }

NvModuleInit() is failing.

WP_20150624_09_16_23_Pro.jpg

Can Somebody help me fixing these issue.

Labels (1)
Tags (1)
0 Kudos
5 Replies

709 Views
AngelC
Senior Contributor I

Hello Kedari,

I replicated the issue you described. It seems the BeeStack applications created form BeeKit seems not consider the changes in memory model of MKW21D256. We will have a closer look at this and provide you a workaround. We will come back to you shortly.

Regards,

AngelC

0 Kudos

709 Views
kedarikrishna
Contributor I

Thank you very much , really waiting for some help as this issue is blocking my end product development.

0 Kudos

709 Views
benjaminchang
Contributor V

Hi Kedari,

We are facing the same problem, and submit a more detailed one as:

KW21 256KB with FlexNVM module

We have spent days work on this issue, but still cannot make NVM function work on TWR-KW21.

Can you share your last find out?

Thanks!

Benjamin

0 Kudos

709 Views
AngelC
Senior Contributor I

Hello Kedari,

Apparently, when the BeeKit HA OnOffSwitch project is generated for TWR-KW21D256, the NVM module is enabled (default setting), but for this type of board the NVM that is used is FlexNVM (due to the fact that the part has FlexMemory). If you check the AppToPlatformConfig.h header file, you will find the macro gNvUseFlexNVM_d set to TRUE.

The NVM initialization fails because the part is not configured to use the FlexMemory. Moreover, after each mass-erase of the device the bits that configures the FlexNVM are cleared and the default setting is DEPART=0b1111, EEESIZE=0b1111. According to RM this simply means “no EEPROM”. The entire DFLASH block is used as regular data/instruction flash memory.

Anyway, to be sure you have the same value, please try using a breakpoint in NV_FlashHAL.c file at line illustrated and send us the values of EEEDataSetSize and DEPartitionCode variables.

Moreover, If you do not want to use the FlexMemory feature, you can disable the feature (set gNvUseFlexNVM = FALSE in the project options or even in  AppToPlatformConfig.h) and then modify the linker file to use DFLASH block. This is however application specific. You could generate a TWR-KW24D512 project and check its linker file to get an idea.

Regards,

AngelC

0 Kudos

709 Views
benjaminchang
Contributor V

Hi AngelIC,

We are facing the same problem, and submit a more detailed one as:

KW21 256KB with FlexNVM module

We have spent days work on this issue, but still cannot make NVM function work on TWR-KW21.

Please check and help?

Thanks!

Benjamin

0 Kudos