无法写入movesense设备上的EEPROM

时间:2019-04-18 09:52:20

标签: movesense

我想将一些值写入EEPROM。 我正在写有关movesense device documentation的文章。 似乎从未触发过onPutResult,并且asyncPut之后设备冻结了。

这是我的App.cpp:

#include "MoveWakeUpApp.h"
#include "movesense.h"

MOVESENSE_APPLICATION_STACKSIZE(1024)

MOVESENSE_PROVIDERS_BEGIN(1)

MOVESENSE_PROVIDER_DEF(MoveWakeUpApp)

MOVESENSE_PROVIDERS_END(1)

MOVESENSE_FEATURES_BEGIN()
// Explicitly enable or disable Movesense framework core modules.
// List of modules and their default state is found in documentation
OPTIONAL_CORE_MODULE(DataLogger, false)
OPTIONAL_CORE_MODULE(Logbook, false)
OPTIONAL_CORE_MODULE(LedService, true)
OPTIONAL_CORE_MODULE(IndicationService, true)
OPTIONAL_CORE_MODULE(BleService, true)
OPTIONAL_CORE_MODULE(EepromService, true)
OPTIONAL_CORE_MODULE(BypassService, false)
OPTIONAL_CORE_MODULE(SystemMemoryService, false)
OPTIONAL_CORE_MODULE(DebugService, true)
OPTIONAL_CORE_MODULE(BleStandardHRS, false)
OPTIONAL_CORE_MODULE(BleNordicUART, false)
OPTIONAL_CORE_MODULE(CustomGattService, false)

// NOTE: It is inadvisable to enable both Logbook/DataLogger and 
EepromService without
// explicit definition of Logbook memory are (see LOGBOOK_MEMORY_AREA 
macro in movesense.h and eeprom_logbook_app).
// Default setting is for Logbook to use the whole EEPROM memory area.

// NOTE: If building a simulator build, these macros are obligatory!
DEBUGSERVICE_BUFFER_SIZE(6, 120); // 6 lines, 120 characters total
DEBUG_EEPROM_MEMORY_AREA(true, 0, 1024);
//LOGBOOK_MEMORY_AREA(0, 384 * 1024);

APPINFO_NAME("MoveWakeUp");
APPINFO_VERSION("1.0.0");
APPINFO_COMPANY("Movesense");

// NOTE: SERIAL_COMMUNICATION macro has been DEPRECATED
BLE_COMMUNICATION(true)
MOVESENSE_FEATURES_END()

有什么我想念的吗?

非常感谢!

1 个答案:

答案 0 :(得分:1)

将其与我的文件App.CPP文件进行比较,我发现我已启用SystemMemoryService。以及我与EEPROM一起使用的其他服务。

OPTIONAL_CORE_MODULE(**DataLogger, true**)
OPTIONAL_CORE_MODULE(**Logbook, true**)
OPTIONAL_CORE_MODULE(LedService, true)
OPTIONAL_CORE_MODULE(IndicationService, true)
OPTIONAL_CORE_MODULE(BleService, true)
OPTIONAL_CORE_MODULE(**EepromService, true**)
OPTIONAL_CORE_MODULE(BypassService, false)
OPTIONAL_CORE_MODULE(**SystemMemoryService, true**)
OPTIONAL_CORE_MODULE(DebugService, true)
//DEBUGSERVICE_BUFFER_SIZE(6,120); // 6 lines, 120 chars total
OPTIONAL_CORE_MODULE(BleStandardHRS, false)
OPTIONAL_CORE_MODULE(BleNordicUART, false)
OPTIONAL_CORE_MODULE(CustomGattService,false)

// NOTE: It is inadvisable to enable both Logbook/DataLogger and EepromService without
// explicit definition of Logbook memory are (see LOGBOOK_MEMORY_AREA macro in movesense.h and eeprom_logbook_app).
// Default setting is for Logbook to use the whole EEPROM memory area.
#define TIME_LENGTH 64
#define RESERVED  64
#define TOTAL_MEMMORY_SIZE (2097152 + 1048576) //read from the eeprom 
static const uint32_t offset = TIME_LENGTH + RESERVED;
static const uint32_t size = TOTAL_MEMMORY_SIZE - offset; // using all available space exept for space needed for persistant data
LOGBOOK_MEMORY_AREA(offset, size);

启用SystemMemoryService是否可以解决您的问题?

如您所见,我也在使用数据记录器/日志,并在EEPROM中留出一些空间用于其他存储,因此不能100%地确定每种服务都需要什么。