Hi friends,I am trying Can Protocol STM32F4 to STM32F4 ,I not sure about that I am doing right it.If I use STM32F1 ,this device include just CAN master,so I mean if it is possible STM32F1 to STM32F1 because of both device include just master CAN.STM32F4 also include CAN Slave,in this case I think I can use STM32F4 to STM32F1 or STM32F4Is it possible master to master communication.Is there an anyone to managed this protocol,please share both device codes with me.Thanks.
I've tried to reply repeatedly but the ARM Forum won't permit my response, even though I'm logged in. I'll test with this response.
Right we're up and running.
I think you're misunderstanding CAN Bus. It is not a Master/Slave Protocol like RS485. The nodes on the Bus listen for a break in transmission, when the line is quiet and then initiates transmission of a Frame. You might say that for that instant the node is the master and all other nodes on the bus are listening. Any CAN device can talk to any CAN device as long as they're both using the same bit rate on the bus. So it doesn't mater if you're using an F1 and an F4 or two of each. Or for that matter a SMT32 or any other CAN Enabled uC
Thanks your information,The part of I didnt understand is in Stm32f1 there is just can master (in STM32CUBEMX) and in Stm32f4 there is also can slave,interesting
I'm not sure where you are getting that information from. I've just had a quick look for the stm32f1 at:
http://www.st.com/en/microcontrollers/stm32f1-series.html?querycriteria=productId=SS1031
There's a table there of the different members of the family and a column for the CAN functionality. It appears that the F103, F105 and F107 all contain CAN Bus interfaces.
Whereas on the page for the F4:
http://www.st.com/en/microcontrollers/stm32f4-series.html?querycriteria=productId=SS1577
Only the F412 and F413 have CAN Bus functionality. So what uC do you actually have? It might be worth looking at libopencm3. I've never used it but you might get lucky and have it might already have CAN API functions you can use for your uC
I couldnt explain well I suppose.Now I m gonna try to explain better.I opened the stm32cubemx ,I altered one of series stm32f1but I dont remember my uC all device's name anyway.I enabled Can protocol and I saw master under the CAN .Also I altered Stm32f407vg and I have two options CAN1 and CAN2 and CAN2 is slave .so I mean what does that mean and Can I communicate Stmf1 to stmf1.According to your talking I can .
Ahhh. I've now looked up the stm32cubemx and it's a code configuration tool. I'm afraid I can't help you with that I've never used any of those tools. They take all the fun out of it ;-)
If that stm32cubemx is talking about CAN Master and Slave then it means that it's wrong. Well in my humble opinion ;-) There is no such thing. Your best bet might be to grab the CAN Bus spec or look at the datasheet for your uC which should have a section to give you an overview of CAN. Read that and get an understanding of it and then try and raise a question with the stm32cubemx people.
All I'm saying is that CAN Bus is NOT a Master/Slave protocol. It's probably referred to as a multi Master, (because ANY node can initiate communications) with Collision detection.