how to fota base on internal flash

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

how to fota base on internal flash

928 Views
changlezhang
Contributor II

For kw41 where the flash memory is 512k, how can I split the internal flash memory in two sections, one being used for current application, and the second  for storing the received image via an OTA process.

how to config bootloader and main program

Labels (2)
3 Replies

620 Views
gerardo_rodriguez
NXP Employee
NXP Employee

Hello changle zhang,

The OtaSupport module has support for internal storage of the OTA image as long as the flash is twice the size of the application. Refer to the 11.7.2 OTAP client chapter of the "<SDK>\docs\wireless\Bluetooth\BLE Application Developer's Guide.pdf" document.

Are you using IAR or MCUXpresso? On IAR, you need to define linker symbols to prepare the image to be OTA ready and with MCUXpresso, the linker file needs to be modified.

I recommend you to take a look at the USB-KW41Z BLE otap_client_att example located in <SDK>\boards\usbkw41z_kw41z\wireless_examples\bluetooth\. This demo uses the internal storage for OTA because the board doesn't have an external memory as the FRDM-KW41Z.

Let me know if you have any question.

Best regards,

Gerardo

620 Views
changlezhang
Contributor II

when i do below as BLE Application Developer's Guide.pdf, then  the project of otap_client_att cant be compiled

The setting of the EEPROM type is done in the app_preinclude.h file for the demo applications:
/* Specifies the type of EEPROM available on the target board */
#define gEepromType_d gEepromDevice_AT45DB041E_c

the compile error as below

./framework/OtaSupport/Source/OtaSupport.o: In function `OTA_StartImage':
E:\Documents\MCUXpressoIDE_10.0.2_411\workspace\frdmkw41z_wireless_examples_bluetooth_otap_client_att_freertos\Debug/../framework/OtaSupport/Source/OtaSupport.c:225: undefined reference to `INT_STORAGE_SIZE'
./framework/OtaSupport/Source/OtaSupport.o: In function `OTA_InitExternalMemory':
E:\Documents\MCUXpressoIDE_10.0.2_411\workspace\frdmkw41z_wireless_examples_bluetooth_otap_client_att_freertos\Debug/../framework/OtaSupport/Source/OtaSupport.c:469: undefined reference to `INT_STORAGE_END'
./framework/Flash/External/Source/Eeprom_InternalFlash.o: In function `EEPROM_EraseBlock':
E:\Documents\MCUXpressoIDE_10.0.2_411\workspace\frdmkw41z_wireless_examples_bluetooth_otap_client_att_freertos\Debug/../framework/Flash/External/Source/Eeprom_InternalFlash.c:147: undefined reference to `INT_STORAGE_SECTOR_SIZE'
E:\Documents\MCUXpressoIDE_10.0.2_411\workspace\frdmkw41z_wireless_examples_bluetooth_otap_client_att_freertos\Debug/../framework/Flash/External/Source/Eeprom_InternalFlash.c:147: undefined reference to `INT_STORAGE_END'
./framework/Flash/External/Source/Eeprom_InternalFlash.o: In function `EEPROM_WriteData':
E:\Documents\MCUXpressoIDE_10.0.2_411\workspace\frdmkw41z_wireless_examples_bluetooth_otap_client_att_freertos\Debug/../framework/Flash/External/Source/Eeprom_InternalFlash.c:202: undefined reference to `INT_STORAGE_END'
./framework/Flash/External/Source/Eeprom_InternalFlash.o: In function `EEPROM_ReadData':
E:\Documents\MCUXpressoIDE_10.0.2_411\workspace\frdmkw41z_wireless_examples_bluetooth_otap_client_att_freertos\Debug/../framework/Flash/External/Source/Eeprom_InternalFlash.c:229: undefined reference to `INT_STORAGE_END'
./framework/Flash/External/Source/Eeprom_InternalFlash.o: In function `EEPROM_PrepareForWrite':
E:\Documents\MCUXpressoIDE_10.0.2_411\workspace\frdmkw41z_wireless_examples_bluetooth_otap_client_att_freertos\Debug/../framework/Flash/External/Source/Eeprom_InternalFlash.c:282: undefined reference to `INT_STORAGE_SECTOR_SIZE'
collect2.exe: error: ld returned 1 exit status
PRODUCT_INFO_region: 0 GB 2047 B 0.00%
make: *** [frdmkw41z_wireless_examples_bluetooth_otap_client_att_freertos.axf] Error 1

0 Kudos

620 Views
changlezhang
Contributor II

Sorry the up compile error is made because  the gEepromType_d is defined as gEepromDevice_InternalFlash_c not gEepromDevice_AT45DB041E_c

The setting of the EEPROM type is done in the app_preinclude.h file for the demo applications:
/* Specifies the type of EEPROM available on the target board */
#define gEepromType_d gEepromDevice_InternalFlash_c