Skip to content

NVStore call crashes when compiled with ARMCC #6706

@romkuz01

Description

@romkuz01

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?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions