I'm running my first CAN test program using STM32CubeMX, STM32F103C8T6 and Eclipse.
I used default CAN settings in STM32CubeMX (also tried loopback but the results are equal).
What I see (see pic below) is two things I do not understand;
- In the picture below, you can see I exceeded the line with hcan.pTxMsg->StdId = 0x321 (left red oval), but the current value shows 536891392 (right red oval).
When I execute the next line (green): hcan.pTxMsg->ExtId = 0x01, I end up in a hard fault interrupt:
/**
@brief This function handles Hard fault interrupt. / void HardFault_Handler(void) { / USER CODE BEGIN HardFault_IRQn 0 */
/* USER CODE END HardFault_IRQn 0 / while (1) { } / USER CODE BEGIN HardFault_IRQn 1 */
/* USER CODE END HardFault_IRQn 1 */ }
Why is the value not updated and why do I get a hardware fault (the pointer hcan.pTxMsg is not NULL since it even displays the field StdId (it even can display ExtId which has value 134222077 (not shown in pic below)?