2022-03-23 06:28 AM
What am I trying to do?
I'm trying to send CAN messages on a 500 kbit/s bus with a STMF769I-DISCO. At the same time I'm trying to have a screen running LVGL (v8.0.0) on which is dependent on having the HCLK higher than 200 MHz. Lower clock speeds causes "tearing issues " on the screen(see picture). When the HCLK is too high for some reason I can only read ERROR FRAMES on the CAN bus with a KVASER USB (CAN monitoring device). When the HCLK is lower than around 140 MHz I'm able to send CAN messages.
What have I tried?
Other
It's the first time I work with MCUs and the porting of LVGL has been done by another person so I don't really know how it works in detail.
Question
Does anybody have tips on what I can do or read? The best would be that I can keep HCLK above 200MHz and get CAN working at the same time.
I'm happy to provide additional information.
Solved! Go to Solution.
2022-03-23 09:54 AM
Thanks!
I've already done all of the above. Not really in that order though.
I've solved the problem now.
The clock I was using for the system clock was the internal high speed clock, HSI. The problem seems to be that the internal high speed clock becomes unprecise at higher frequencies which I think causes the CAN message to have the wrong format / corrupted.
SOLUTION: I changed the system clock source to the external crystal clock (HSE) and with a bit of fiddeling with settings to get desired settings, it is now working correctly.
2022-03-23 09:33 AM
Don't do everything at the same time. Get and MCU with a blinky working reliably at desired frequencies. Then the CAN. Then the display.
Wrong core voltage levels and FLASH latency, missing or wrong memory barriers and cache management and just overall broken code are the most probable reasons.
2022-03-23 09:54 AM
Thanks!
I've already done all of the above. Not really in that order though.
I've solved the problem now.
The clock I was using for the system clock was the internal high speed clock, HSI. The problem seems to be that the internal high speed clock becomes unprecise at higher frequencies which I think causes the CAN message to have the wrong format / corrupted.
SOLUTION: I changed the system clock source to the external crystal clock (HSE) and with a bit of fiddeling with settings to get desired settings, it is now working correctly.