2023-01-24 04:15 AM
When I try to transmit can CAN data it doesn't work inside the time-delay condition... but it works properly without that condition...
Does anyone knows what's the issue?
Regards
Solved! Go to Solution.
2023-01-24 06:30 AM
Do you initialize the tick5 value at loop entry?
Is this in a callback?
Does the tick count advance here?
2023-01-24 06:30 AM
Do you initialize the tick5 value at loop entry?
Is this in a callback?
Does the tick count advance here?
2023-01-24 06:51 PM
@Community member
>>Do you initialize the tick5 value at loop entry?
I have initialized it as a global variable
>>Is this in a callback?
No, its in the main while loop
>>Does the tick count advance here?
I'm new to stm32, don't know what your question is....
I just want to send data using CAN BUS at every 200-300ms. But when I try to transmit it in if(HAL_Getick() - tick5 > 200) it doesn't work....
2023-01-25 06:36 AM
Is HAL_GetTick() incrementing as each millisecond passes within the loop?
If you send a character to a UART as well, can you see that occur periodically?
Does HAL_CAN_AddTxMessage() return success or failure codes? Should you need to use more than one mailbox?
I understand the goal, just not sure if it's not attempting to send at all, or if the approach here is wrong, or has unexpected modes of failure that you're not addressing or handling.
2023-01-25 06:40 AM
>>but it works properly without that condition
show us
2023-01-26 09:18 PM
>>Is HAL_GetTick() incrementing as each millisecond passes within the loop?
yes, its incrementing
>>If you send a character to a UART as well, can you see that occur periodically?
I can't do this, it's a customize development board with no USB-UART TTL and no other free gpio pins, I will check the schematic again
>>Does HAL_CAN_AddTxMessage() return success or failure codes?
it return success code, but when I checked on oscilloscope, there is no signal...
2023-01-26 09:21 PM
2023-01-26 11:46 PM
Could you let me know, how to transmit data using CAN Protocol after a time period. I just want to transmit data after a time period...
2023-01-27 12:57 AM
You can wait a time period, say 200ms, simply with HAL_Delay(200) in the while loop after sending each message.
hth
KnarfB
2023-01-27 08:31 PM
without HAL_Delay() ???