Skip to content

Lost enabling OD storage #99

Description

@WBakerOMS

I have been going through the library exploring it's functionality and cannot seem to understand how to enable the storage mechanisms for the OD. I'm looking for OD values to persist between power cycles on my STM32F302 using the flash storage as NVM. I'm not using the provided example but have a working implementation of CanOpenSTM32 on a custom board.

My confusion begins with, throughout the library seeing a lot of CO_CONFIG_STORAGE & CO_CONFIG_STORAGE_ENABLE value checks that stop storage related code being compiled. CO_CONFIG_STORAGE_ENABLE has the default value of 0x01 from here, and CO_CONFIG_STORAGE is defined here so it looks like it should build the storage code. So my first question is why doesn't the storage code compile? Do I need to define something in my application (main.c)?

/**
 * Configuration of @ref CO_storage
 *
 * Possible flags, can be ORed:
 * - CO_CONFIG_STORAGE_ENABLE - Enable data storage
 */
#ifdef CO_DOXYGEN
#define CO_CONFIG_STORAGE (CO_CONFIG_STORAGE_ENABLE)
#endif
#define CO_CONFIG_STORAGE_ENABLE 0x01
/** @} */ /* CO_STACK_CONFIG_STORAGE */
/* default configuration, see CO_config.h */
#ifndef CO_CONFIG_STORAGE
#define CO_CONFIG_STORAGE (CO_CONFIG_STORAGE_ENABLE)
#endif

This brings up another question I have about Doxygen. As far as I have used it, Doxygen is a documentation generating/formatting tool. So, why are it's defines (CO_DOXYGEN) controlling what's being compiled in code, especially in CO_config.h?

I recognize that this code is at the CANOpenNode level and not the CANOpenSTM32 level, so I expect the need to write some application specific storage functionality. With the LSS config storage, callback functions are required. Is it a similar situation here and I just haven't found the right function yet?

I've been trying to look at the PIC32 example code that has the storage enabled but this also looks as if it's not compiling the storage components. Mind you I've never used a PIC before so may be reading it wrong.

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions