Hi everyone,
I’m working on a project using the NUCLEO-F767ZI board and I’m trying to integrate the CANopenNode library. I’ve created a custom_targets.json
file for the NUCLEO-F767ZI and configured the necessary includes in my mbed_app.json
file. However, I’m encountering several build errors that I can’t seem to resolve.
Here’s the content of my custom_targets.json
:
{
"NUCLEO_F767ZI": {
"inherits": ["Target"],
"core": "Cortex-M7F",
"extra_labels": ["ST", "STM32", "STM32F7", "STM32F767"],
"OUTPUT_EXT": "bin",
"is_disk_virtual": true,
"supported_toolchains": ["GCC_ARM", "ARM"],
"device_name": "STM32F767ZITx",
"detect_code": ["1234"]
}
}
And here’s my mbed_app.json
configuration:
{
"target_overrides": {
"*": {
"target.features_add": ["CAN"],
"target.macros_add": ["CANOPENNODE"],
"target.extra_labels_add": ["CANopenNode"]
}
}
}
I have included the CANopenNode library and set up the includes for the CANopenNode headers. Despite this, I’m receiving numerous errors, primarily related to missing definitions and implicit declarations, such as:
unknown type name 'CO_SDO_t'
implicit declaration of function 'CO_OD_find' is invalid in C99 [-Wimplicit-function-declaration]
no member named 'ODExtensions' in 'struct (anonymous at /src/canopennode/301/CO_PDO.h:179:9)'
...
Here is a portion of the error log:
/src/canopennode/301/CO_PDO.c:236:15: warning: implicit declaration of function 'CO_OD_find' is invalid in C99 [-Wimplicit-function-declaration]
entryNo = CO_OD_find(SDO, index);
^
/src/canopennode/301/CO_PDO.c:242:12: warning: implicit declaration of function 'CO_OD_getAttribute' is invalid in C99 [-Wimplicit-function-declaration]
attr = CO_OD_getAttribute(SDO, entryNo, subIndex);
^
/src/canopennode/301/CO_PDO.c:244:26: error: use of undeclared identifier 'CO_ODA_RPDO_MAPABLE'
if(R_T==0 && !((attr&CO_ODA_RPDO_MAPABLE) && (attr&CO_ODA_WRITEABLE))) return CO_SDO_AB_NO_MAP; /* Object cannot be mapped to the PDO. */
^
/src/canopennode/301/CO_PDO.c:246:26: error: use of undeclared identifier 'CO_ODA_TPDO_MAPABLE'
if(R_T!=0 && !((attr&CO_ODA_TPDO_MAPABLE) && (attr&CO_ODA_READABLE))) return CO_SDO_AB_NO_MAP; /* Object cannot be mapped to the PDO. */
^
...
fatal error: too many errors emitted, stopping now [-ferror-limit=]
6 warnings and 20 errors generated.
I’ve double-checked the paths and ensured that all required header files are included. The errors persist, indicating issues with undefined types and functions. I’ve also verified that the CANopenNode library is correctly added to my project directory.
Any guidance on resolving these issues would be greatly appreciated. Is there something specific I might be missing in the configuration or setup for the NUCLEO-F767ZI?
Thank you in advance for your help!