2015-02-07 04:10 AM
Hello, I have been using standard libraries but when CUBE got released I switched. I cant receive any CAN messages with CUBE.
-I am using f072-Configured clocks, baud rate, filters(default)-Using interrupt-Silent loopback mode-Hcan structure is filled correctly.-I havent found any pin configuration in cube generated codeI can see TX data flow on oscilloscope with loopback mode. But It never generates the HAL_CAN_Rx_CpltCallback event when using HAL_CAN_Receive_IT. When debugging I also tried to put break point into CAN interrupt handler itself but it stops in timer interrupt handler bellow. Its interesting that program stops in different location from where breakpoint is.I couldnt understand and find on community where the problem might be. I saw that few people had similar problems. #f0 #bus #receive #can #cube2015-02-15 08:03 AM
2015-02-16 02:36 AM
Hello Marek,
Please have a look to the CAN example available in ''STM32Cube_FW_F0_V1.0.0\Projects\STM32072B_EVAL\Examples\CAN\CAN_Networking'', compare this example with your generated project & check updates you made.This way, you may understand clearly what is going wrong in your case.The package is available in http://www.st.com/web/catalog/tools/FM147/CL1794/SC961/SS1743/LN1897/PF260612.-Mayla-To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2015-02-24 02:44 PM
Hello Mayla,
Thank You for reply. Its starting to get strange. I tried to generate the code for f429 and using the same code for CAN and incredibly it works. I get RX interrupts there. But f072 code doesnt work and its the same.I have looked at example. It looks like it isnt generated with cubemx and didnt found any difference between mine.What I dont understand:-program breaks at location where isnt breakpoint-master CAN vs slave CAN cube configuration. Whats the difference and why only master option in f072.-F072 has only CEC/CAN interrupt f429 has also CAN TX, CAN RX interrupts options. Why?Marek2015-02-24 05:10 PM
Are you sure about the Filter# ?
If this is a CAN1 master, then 14 would be invalid, does it work with 0 or 1? The STM32F072 only has ONE CAN interface2015-02-25 05:29 AM
Filter 0 or 1 doesnt solve the issue.
As F429 is working there must be some difference between these two MCUs that I dont know.Marek.2015-02-25 06:22 AM
The F0 is a significantly simplified device, the CAN peripheral only supports one interface.
If you're sure it's not the software, you could review the hardware, or frankly try an SPL implementation to confirm it's not a Cube/HAL issue.2015-03-05 12:30 PM
Hello,
Its solved!There were two problems-Filter number should be as clive said. Iam using 0-There is an incompatibility in CUBE generated code with emblocks generated startup_....S file. The interrupt vector for CAN is different from the name of the interrupt CAN routine generated by cube.Took really long to find out.Using
-emblocks v2.3-Cubemx v1.0-Hal f0 v1.3Thanks for your help.Marek
2015-07-24 02:45 AM
Hello,
I had the same issue and your last answer gave me the solution :)HAL_CAN_Receive work well (good way to test filters) but HAL_CAN_Receive_IT dont (never go to HAL_CAN_RxCpltCallback function).There is different names on IT declarations code generated by CubeMX (CAN_RX1_IRQ... and CAN_RX0_IRQ...). Changing aliases in ''stm32f...xe.h'' work for my.I hope it will be fixed in a following version.Using :- Keil uVision v5.15- STM32CubeMX v1.0 (4.9.0)- HAL f3 v1.1.1Thank you!