OTA for REED with internal flash of KW21z?

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

OTA for REED with internal flash of KW21z?

Jump to solution
512 Views
charliehauser
Contributor I

Is it possible to slim down the REED OTA client demo software to use the internal flash of the 512kB KW21z? My understanding is that the program would have to be less than half the size of the available flash. Currently the complied program is too large to allow for an OTA update.

Thank you in advance,

Charlie

0 Kudos
1 Solution
419 Views
ovidiu_usturoi
NXP Employee
NXP Employee

Hi Charlie,

Using a REED it is difficult to use internal flash for OTA because we have the following:

1. Product data sector [2k]

2. NVM - [64k] -  (32 sectors);

3. Image area - [430k] 

4. Bootloader [16k]  

With internal flash for OTA, your image should be placed in a 215k flash, and by default, our REED_ota image has around 240k in release mode.  You can start by disabling some modules, like shell module (by disabling THREAD_USE_SHELL) to reduce the size with @20k and continue with the LED module (gLEDSupported_d -> another @3k) ...

If this device is not intended to be a commissioner you can comment the code form APP_Commissioning_Handler  (switch handler and let only to free the buffer...) -> this will reduce the library code with @3k....

The recommendation will be to look at the map file and see what files/modules could be reduced/optimized.

As an observation, to enable the internal flash, you should set the following: 

1. in config.h file: 

#define gEepromType_d           gEepromDevice_InternalFlash_c

2. in Project Options - > Linker-> Symbol  set the UseInternalStorageLink_d=1 

pastedImage_7.png

Regards,

Ovidiu

View solution in original post

1 Reply
420 Views
ovidiu_usturoi
NXP Employee
NXP Employee

Hi Charlie,

Using a REED it is difficult to use internal flash for OTA because we have the following:

1. Product data sector [2k]

2. NVM - [64k] -  (32 sectors);

3. Image area - [430k] 

4. Bootloader [16k]  

With internal flash for OTA, your image should be placed in a 215k flash, and by default, our REED_ota image has around 240k in release mode.  You can start by disabling some modules, like shell module (by disabling THREAD_USE_SHELL) to reduce the size with @20k and continue with the LED module (gLEDSupported_d -> another @3k) ...

If this device is not intended to be a commissioner you can comment the code form APP_Commissioning_Handler  (switch handler and let only to free the buffer...) -> this will reduce the library code with @3k....

The recommendation will be to look at the map file and see what files/modules could be reduced/optimized.

As an observation, to enable the internal flash, you should set the following: 

1. in config.h file: 

#define gEepromType_d           gEepromDevice_InternalFlash_c

2. in Project Options - > Linker-> Symbol  set the UseInternalStorageLink_d=1 

pastedImage_7.png

Regards,

Ovidiu