2008-09-18 07:35 PM
CAN
2011-05-17 03:38 AM
Hello all,
Has anyone got the ST sample code for the STM32F10X-12K-EVAL board working. By which I mean remapping the alt function to PD0, PD1, correcting the baud rate calculations, and with CAN_Mode=CAN_Mode_Normal, and actually receiving data on the bus? If you have then I would greatly appreciate seeing the working code. Regards Steve2011-05-17 03:38 AM
see this...
http://www.st.com/mcu/forums-cat-6876-23.html2011-05-17 03:38 AM
Thanks for your reply. Yes I've read that with interest, I'm doing all these things, Baud rate correction, remap pins, can clock, port D clock.
I notice that when the TX pin is set up as AF_PP it outputs a 0, which seems to silence the can bus, CAN H goes and remains high, which does not look right to me. I'm only trying to receive data, so I cna configure the pin as input pullup, then the CAN signals continue, but I get no RX. I'm puzzeled. Steve2011-05-17 03:38 AM
I look again...
One problem solved, I was not enabling alt function clock, now that I do, I do not kill the bus signal when I have TX as AF_PP. But I still do not receive Steve2011-05-17 03:38 AM
Yahoo, I can now TX and RX.
Problems were all in the ST sample code. 1)Baud rate calculations 2)Flash latency not set up correctly 3)AF clocks not enabled Soon le weekend2011-05-17 03:38 AM
Hello,
Suprisingly I'm having same problem... Is this flash latency set up relevant and if so how it's done? I just keep wondering how ST releases this kind of example code.. :-[ -Jussi2011-05-17 03:38 AM
Hi,
I have the same problem. Can you send me your configuration code. Thanks.2012-12-19 05:53 AM
working code of mine:
[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32%20CAN%20Filter&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx¤tviews=4]https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32%20CAN%20Filter&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx¤tviews=4Just change CAN_InitStructure.CAN_Mode value to CAN_Mode_Normal to communicateexternally. Correct Baud rate setting is very important for CAN..small mistake in calculating itmight result in communication error.