BlueNRG2 OTA Flash verify failure
Hello
I'm trying to implement the OTA feature in my project. We use the BlueNRG-2 Chip.
I'm followed the BLE_Chat example and the explanaition in the The BlueNRG-LP (over-the-air) firmware upgrade document to inlcude all the ota related code parts.
When I now try to load a new firmware to the device through the Android application ST BLE Mesh, I see, that on the BLE device some Gatt Attribute modified events are triggered. But right after that, the error Flash verify failure occurs from the OTA_Write_Data function.
I did not adjust the BlueNRG2.Id file, do I have to change something in that file? Or can someone give me a hint, what otherwise I could/should adjust?
Many thanks.
Tobias
I just append a part of the BlueNRG2.Id file. The rest have also all the default values.
/*******************************************************************************
* Memory Definitions
*******************************************************************************/
/*
BlueNRG-2 memory map
+-----------------------+ 0x20005FFF
| RAM (24K) |
+-----------------------+ 0x20000000
| |
| |
+-----------------------+ 0x1007FFFF
| |
| FLASH (256K) |
+-----------------------+ 0x10040000
| |
+-----------------------| 0x100007FF
| ROM (2K) |
+-----------------------+ 0x10000000
*/
_MEMORY_RAM_BEGIN_ = 0x20000000;
_MEMORY_RAM_SIZE_ = 0x6000; /* 24KB */
_MEMORY_RAM_END_ = 0x20005FFF;
_MEMORY_FLASH_BEGIN_ = 0x10040000;
_MEMORY_FLASH_SIZE_ = 0x40000; /* 256KB */
_MEMORY_FLASH_END_ = 0x1007FFFF;
_MEMORY_ROM_BEGIN_ = 0x10000000;
_MEMORY_ROM_SIZE_ = 0x800; /* 2KB */
_MEMORY_ROM_END_ = 0x100007FF;
/* Reserved for BTLE stack non volatile memory */
FLASH_NVM_DATASIZE = (4*1024);
/* This configuration is intended for application not supporting OTA firmware upgrade */
/*
BlueNRG-2 standard application memory map
+-----------------------+ 0x20005FFF
| RAM (24K) |
+-----------------------+ 0x20000000
| |
| |
+-----------------------+ 0x10068000
| |
| NVM(4K) |
+-----------------------+ 0x1007F000
| |
| User app (252K) |
+-----------------------+ 0x10040000
| |
+-----------------------| 0x100007FF
| ROM (2K) |
+-----------------------+ 0x10000000
*/
MEMORY_FLASH_APP_OFFSET = DEFINED(MEMORY_FLASH_APP_OFFSET) ? (MEMORY_FLASH_APP_OFFSET) : (0) ;
MEMORY_FLASH_APP_SIZE = DEFINED(MEMORY_FLASH_APP_SIZE) ? (MEMORY_FLASH_APP_SIZE) : ( _MEMORY_FLASH_SIZE_ - FLASH_NVM_DATASIZE - MEMORY_FLASH_APP_OFFSET);
MEMORY_RAM_APP_OFFSET = DEFINED(MEMORY_RAM_APP_OFFSET) ? (MEMORY_RAM_APP_OFFSET) : (0x2CC) ;
RESET_MANAGER_SIZE = DEFINED(RESET_MANAGER_SIZE) ? RESET_MANAGER_SIZE : 0x800 ;
/*
*****************************
* ST_OTA_HIGHER_APPLICATION *
*****************************
*/
/* This configuration is intended for application supporting OTA firmware upgrade with 2-app scheme (app in the upper part of memory map) */
/*
BlueNRG-2 OTA firmware upgrade support for higher application memory map
+-----------------------+ 0x20005FFF
| RAM (24K-4) |
+-----------------------+ 0x20000004
| |
| |
+-----------------------+ 0x10080000
| |
| NVM(4K) |
+-----------------------+ 0x1007E800
| |
| Higher app (124K) |
+-----------------------+ 0x1005F800
| |
| Lower app (124K) |
+-----------------------| 0x10040800
| Reset Manager (2K) |
+-----------------------+ 0x10040000
| |
+-----------------------| 0x100007FF
| ROM (2K) |
+-----------------------+ 0x10000000
*/
MEMORY_FLASH_APP_SIZE = DEFINED(ST_OTA_HIGHER_APPLICATION) ? (((_MEMORY_FLASH_SIZE_ - RESET_MANAGER_SIZE - FLASH_NVM_DATASIZE) / 2) / 2048) * 2048 : MEMORY_FLASH_APP_SIZE ;
MEMORY_FLASH_APP_OFFSET = DEFINED(ST_OTA_HIGHER_APPLICATION) ? (RESET_MANAGER_SIZE + MEMORY_FLASH_APP_SIZE) : MEMORY_FLASH_APP_OFFSET ;
/*
*****************************
* ST_OTA_LOWER_APPLICATION *
*****************************
*/
/* This configuration is intended for application supporting OTA firmware upgrade with 2-app scheme (app in the lower part of memory map) */
/*
BlueNRG-2 OTA firmware upgrade support for lower application memory map
+-----------------------+ 0x20005FFF
| RAM (24K-4) |
+-----------------------+ 0x20000004
| |
| |
+-----------------------+ 0x10080000
| |
| NVM(4K) |
+-----------------------+ 0x1007E800
| |
| Higher app (124K) |
+-----------------------+ 0x10053800
| |
| Lower app (124K) |
+-----------------------| 0x10040800
| Reset Manager (2K) |
+-----------------------+ 0x10040000
| |
+-----------------------| 0x100007FF
| ROM (2K) |
+-----------------------+ 0x10000000
*/
MEMORY_FLASH_APP_SIZE = DEFINED(ST_OTA_LOWER_APPLICATION) ? (((_MEMORY_FLASH_SIZE_ - RESET_MANAGER_SIZE - FLASH_NVM_DATASIZE) / 2) / 2048) * 2048 : MEMORY_FLASH_APP_SIZE ;
MEMORY_FLASH_APP_OFFSET = DEFINED(ST_OTA_LOWER_APPLICATION) ? (RESET_MANAGER_SIZE) : MEMORY_FLASH_APP_OFFSET ;
/*
******************************************
* ST_USE_OTA_SERVICE_MANAGER_APPLICATION *
******************************************
*/
/* This configuration is intended for application supporting OTA firmware upgrade with independent OTA firmware upgrade service manager
(app in the upper part of memory map) */
/*
BlueNRG-2 OTA firmware upgrade support for service manager application memory map
+-----------------------+ 0x20005FFF
| RAM (24K-4) |
+-----------------------+ 0x20000004
| |
| |
+-----------------------+ 0x10080000
| |
| NVM(4K) |
+-----------------------+ 0x1007F000
| |
| User app (182K) |
+-----------------------+ 0x10051800
| OTA Service |
| Manager (70K) |
+-----------------------+ 0x10040000
| |
+-----------------------| 0x100007FF
| ROM (2K) |
+-----------------------+ 0x10000000
*/
SERVICE_MANAGER_SIZE = 0x11800;
MEMORY_FLASH_APP_SIZE = DEFINED(ST_USE_OTA_SERVICE_MANAGER_APPLICATION) ? (_MEMORY_FLASH_SIZE_ - SERVICE_MANAGER_SIZE - FLASH_NVM_DATASIZE) : MEMORY_FLASH_APP_SIZE ;
MEMORY_FLASH_APP_OFFSET = DEFINED(ST_USE_OTA_SERVICE_MANAGER_APPLICATION) ? (SERVICE_MANAGER_SIZE) : MEMORY_FLASH_APP_OFFSET ;
/* Entry Point */
ENTRY(RESET_HANDLER)
/* Generate a link error if heap and stack don't fit into RAM */
_Min_Heap_Size = 0x0; /* required amount of heap */
_Min_Stack_Size = 0xC00; /* required amount of stack */
/* Specify the memory areas */