Replies: 4 comments 2 replies
-
Beta Was this translation helpful? Give feedback.
-
Not sure where to start here. There is no EEPROM involved, the Zephyr port of CANopenNode uses the settings subsystem for storing what CANopenNode refers to as "EEPROM" storage location. If your board does not support using the settings subsystem (e.g. if it has no storage partition in flash) you can disable this by setting |
Beta Was this translation helpful? Give feedback.
-
No clue as to what actually happened, but the project just started working on its own even though nothing is apparently different from any of the failures. Despite building the project with the -p "pristine" flag every time, one day it never worked and the next day it suddenly did after numerous recompiles. Just mentioning this for the sake of completeness. The lingering problem now is finding an object dictionary editor tool that is compatible with the version of the CANopenNode stack used by Zephyr. |
Beta Was this translation helpful? Give feedback.
-
Alright so the build log spits this out:
Given that the flash storage seems to be exactly what I'm having trouble with, in my context this would be more of a fatal error than a warning. After some guesswork adding CONFIG_FLASH_MAP=y to the local prj.conf resolved that warning and the "can't write to EEPROM" error goes away when the code is running. This leaves this last warning:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Using a setup with the Kvaser Leaf3, Nucleo-G01BRE board, and a CANopennode project compiled using the CubeMX IDE, successful CAN communications take place with both reading and writing the object dictionary on the STM32. So, it is known that the wiring for the CAN bus and test scripts running on the Windows PC end are correct. Now it is desired to switch over to Zephyr so that eventually MCUboot can be used to receive new image updates over CAN.
Following the directions from this site:
https://docs.zephyrproject.org/latest/samples/modules/canopennode/README.html
An overlay and config file are created for the STM32G0B1RE, with the fdcan1 set up to match the pin settings from the Cube project:
But there is an issue compiling the samples/modules/canopennode Zephyr project. The handful of chips that the example has been tested on all apparently have on-chip EEPROMs, but the STM32G0B1RE doesn't seem to. In the example's
main.c
there is this section of code:So obviously since there is no EEPROM on the chip, the output terminal just spams "failed to write to EEPROM" over and over. Some of the other example chips have
CONFIG_MPU_ALLOW_FLASH_WRITE=y
in their config overlays, so if this is added to the STM32G0B1RE overlay along with this in the DTS file:It might be expected that the writes will now be successful after updating
CANOPEN_STORAGE_EEPROM
toCANOPEN_STORAGE_ROM
, however, they still fail. What is the correct way then to get the Zephyr CANopen stack to use the flashstorage_partition
area to store the object dictionary?It is possible to remove this error by doing the above and changing the storage type to
CANOPEN_STORAGE_RAM
, but then a new error pops up, now the terminal just spams<err> canopen_driver: failed to send CAN frame (err -114)
and the Python scripts running on the PC end fail to connect to the node. What might be causing this issue?As a side note, the exact same problems appear to be happening as expressed in this thread...
https://lists.zephyrproject.org/g/users/topic/103148791#msg3307
...the counter example works but the CANopen one does not. Presumably the reason is that the counter example is using a base-level CAN driver rather than CANopen.
Beta Was this translation helpful? Give feedback.
All reactions