-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
Description
Use the following main.cpp to reproduce the crash:
#include "nvstore.h"
const uint8_t global_buffer[91] = {0}; // doesn't crash without "const"
int main()
{
NVStore &nvstore = NVStore::get_instance();
printf("Trying to reproduce NVStore crash...\n");
nvstore.set(10, sizeof(global_buffer), global_buffer);
printf("NVStore didn't crash...\n");
}
Compile and run with:
mbed compile -t ARM -m K64F --profile debug -f
The failure was detected with ARMCC version:
ARM Compiler 5.06 update 3 (build 300)
Some observations:
- Crashes only with --profile set to "debug" or "release", doesn't crash with "develop"
- Passes when "const" removed from array definition
- Passes if array is defined as uint32_t (change in data alignment?)