Use of FlexNVM to store code

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

Use of FlexNVM to store code

跳至解决方案
1,924 次查看
pandurang
Contributor I

Hi All,

My doubt is whether we can use FlexNVM (from address 0x1000 0000 to 0x1003 FFFF) to store code which has size more than 256KByte or not.

As per reference manual, use can configure FlexNVM  as either "basic data flash" or "EEPROM" or "combination of both".

But I have seen in one of example of BLE, the code size is of 494 KByte. P-Flash size is beyound 0x40000 !

pastedImage_1.png

This example has KW36Z set as MCU and not KW35. KW35 can have P-Flash of 512 KBytes.

pastedImage_2.png

pastedImage_3.png

Thanks and Regards,

Pandurang

标记 (3)
0 项奖励
回复
1 解答
1,758 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Pandurang,

 

It's possible to use the whole 512kB for program memory if your application requires it, however, it's still recommended that you leave some available space for the PROD_DATA memory partition, as it's used by some components of the BLE stack used by the KW36.

 

Please let me know if you need any more information.

 

Best regards,

Sebastian

在原帖中查看解决方案

6 回复数
1,758 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Pandurang, I hope you're doing well!

 

It's possible to use FlexNVM to fit more than 256k of program data.

The BLE stack examples provided in the KW36Z's SDK already do this. They use Flex_nvm as additional program flash to be able to fit the BLE stack. This allows the PROGRAM_FLASH memory region to be of 494kB, leaving 16k bytes of NVM from address 0x7b800, and, 2kB available for PROD_DATA  from address 0x7f800.

 

Please let me know if you need any more information.

 

Best regards,

Sebastian 

0 项奖励
回复
1,758 次查看
pandurang
Contributor I

Hello Sebastian,

Thanks for your reply.

Yes, as we can see in the example, you mentioned, code is stored in FlexNVM by extending P-Flash area upto FlexNVM address range. So, code can execute from FlexNVM address range also. In other words, we can have 512 KB memory to store and execute any code from 512 KB memory.

Along with Code, to store data in FlexNVM address range, we have to make another partition of required size, right? As it is done in example code (store PROD_DATA in separate partition).

Thanks again for clearing my doubts.

Regards,

Pandurang

0 项奖励
回复
1,758 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Pandurang,

 

It's recommended to leave partitions for both NVM_region and PROD_DATA in your MCU's memory configuration, as these may be used for different purposes, depending on the needs of your application.

The configuration used in the SDK examples is a good starting point, but in the end, depending on your application's requirements, the memory configuration may need to be modified.

 

Please let me know if you need any other information.

 

Best regards,

Sebastian

0 项奖励
回复
1,758 次查看
pandurang
Contributor I

Hello Sebastian,

Thanks for your reply.

If our application does not require to store any data, we can use full 512 KB memory to store code, right?

0 项奖励
回复
1,759 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Pandurang,

 

It's possible to use the whole 512kB for program memory if your application requires it, however, it's still recommended that you leave some available space for the PROD_DATA memory partition, as it's used by some components of the BLE stack used by the KW36.

 

Please let me know if you need any more information.

 

Best regards,

Sebastian

1,758 次查看
pandurang
Contributor I

Thanks Sebastian,

It is now clear. Thanks for your support.

Regards,

Pandurang

0 项奖励
回复