Skip to content

Hard fault from line 443 in CO_driver_STM32.c #83

@GITChr

Description

@GITChr

I am using the library to communicate with two motor drivers using TPDOs and SDOs that are sent using CIA309 ASCII codes.
I ported the code to STM32L476RG and I am using a FIFO in the 309 library with length 1000. In general, the communication works fine.

Recently, I was having some physical interface communication issues with the drivers, probably caused by a incorrectly wired CAN Gnd connection. I got some CAN Bus Communication errors in the motor drivers. But I am not sure if this is the reason for the following problem:

Repeatedly (possibly when the motor driver is still in error state- I am not able to test it right now), I am getting a hard fault when executing line 443 in CO_driver_STM32.c

err = ((CAN_HandleTypeDef*)((CANopenNodeSTM32*)CANmodule->CANptr)->CANHandle)->Instance->ESR
      & (CAN_ESR_BOFF | CAN_ESR_EPVF | CAN_ESR_EWGF);

Is it possible that some pointer calculations are wrong there? When debugging, the debugger could not access this memory area.
Could it be related to errors on the CAN Bus or missing replies to SDOs? Are there any hard-coded memory addresses that need to be adapted to the STM32 model used?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions