cancel
Showing results for 
Search instead for 
Did you mean: 

help in can transmission

mpooyesh
Associate II
Posted on April 13, 2016 at 18:02

hi all

i get for transmission data with using can protocol with stm32f429, i studied ''can primer'' article from keil.com also reading user manual of ''stm32f429'' .

i configured can parametrs an all of things we can configure in ''Cubemx'' and generating code for use in keil V5 . ok . thats write,

good , now how i can sending data ??!! in HAL driver we have few of functions about transmit and receive but all of them no more parameters in their argumans about whats your data for transmit . for example HAL_CAN_Transmit(CAN_HandleTypeDef *hcan, uint32_t Timeout);

how i can send my data into TX mailbox's??

#canbus #stm32 #hal #can #cubemx
7 REPLIES 7
Nesrine M_O
Lead II
Posted on April 14, 2016 at 11:30

Hi media.pooyesh ,

I recommend you to have a look to the CAN example under the STM32F4 cube firmware package it may be helpful: 

STM32Cube_FW_F4_V1.11.0\Projects\STM324x9I_EVAL\Examples\CAN

-Syrine –

mpooyesh
Associate II
Posted on April 16, 2016 at 15:36

tnx alot my friend . i test it and share result .

mpooyesh
Associate II
Posted on April 23, 2016 at 09:53

hello again dear friend

its not work . i tried it and successfully compiled with keil but not working . can init and filter config is to seem corrected because returned HAL_OK but ''can transmit'' and ''receive'' can't returned HAL_OK :|

mpooyesh
Associate II
Posted on April 23, 2016 at 12:50

i founded that two functions we called what returned their status.

HAL_TIMEOUT 🙂

ok,good. so what can i do for this ?? !

re.wolff9
Senior
Posted on April 23, 2016 at 14:18

Do you have any (working) can devices on your bus? If you transmit on CANbus, any reciever that gets the message should send ''ACK!''. If not, you'll get a timeout, maybe after a few reatransmissions.... 

mpooyesh
Associate II
Posted on April 23, 2016 at 16:00

NO . i used loopback mode operation but its solved . i modified buadrate to 500Kbps and

accidentally i changed it from 500 to 250kbps and problem is solved . but why? its suport up to 1Mbps and with 500Kbps ''HAL_CAN_INIT'' function is correctly initialized and returned ''HAL_OK'' but in transmit and receive function we have ''HAL_TIMEOUT'' status ,,, :| :| :|

Posted on April 24, 2016 at 04:21

Suggest you present your code and hardware in a more complete and comprehensive manner, getting marginal insight from postings so far.

If the HAL isn't workable, look at several working SPL examples posted here on the forum.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..