2026-05-20 8:44 AM - last edited on 2026-05-22 4:42 AM by mƎALLEm
Hello,
ich set up my project with CubeMX for a CAN-FD (1 MBit/s / 4,8 MBit/s) and a Display for communication. Now i have the problem, that the SCK Signal for the communication looks more like a sawtooth signal than a rectangle. Also the SPI-Prescaler for the baud rate does not affect this signal. i am really confused. I need to use the 48 MHz HSE for my 4,8 MBit/s data phase for CAN-FD.
I use an NUCLEO-C092RC and a LCD Display with ILI9341 (library from Mauro De Vecchi)
Thanks for the help
Solved! Go to Solution.
2026-05-21 8:45 AM
@BNE wrote:the SCK Signal for the communication looks more like a sawtooth signal than a rectangle.
What speed do you have configured for SCK GPIO pin?
Try 'Very High' (or whatever the highest is)
2026-05-20 8:47 AM - edited 2026-05-20 8:48 AM
Hello,
Sorry your question is not clear.
How to write your question to maximize your chances to find a solution
Please focus on the problem and forget about the unnecessary info.
2026-05-21 6:27 AM
ok, sorry,
Problem: Display communication does not work
I use CubeMX and CubeIDE to develop the attached project.
Symptoms: The display does not show any text, although i send some in while(1). I think it is because of the signal SCK, which looks more like a sawtooth (see attached pictures from oscilloscope). A change of the baud rate prescaler in the spi setup (generated by CubeMX in main.c) does not affect this signal.
I expected a 24 MHz rectangular signal, because PCLK is and needs to be 48 MHz with the baud rate prescaler being 2.
If you flash the code into this Nucleo-Board, you can see on D13/SCK (PA5) this signal is periodically appearing (because i send messages in while(1) loop). When the clock is active for transmitting the problem always appears.
Thank you in advance and sry for the strange message
2026-05-21 6:33 AM
Hello,
To me still not clear especially the link with "FDCAN". We need to separate the subjects here.
Subject 1: FDCAN
Subject 2: SPI/ display.
So the questions:
- Does FDCAN is working well alone?
- Does the display is working alone?
2026-05-21 7:42 AM
Hello,
FDCAN ist perfectly working as CAN-FD with 1 MBit/s nominal data rate and 4,8 MBit/s as the other data rate. I just wanted to give this info as the reason why i need to use 48MHz for PCLK.
I developed the attached code based on the FDCAN only CubeMX setup and just added SPI1 for the display. My main goal is to display how many frames were sent and received.
Only the display communication is my problem. I think it has to do with PCLK being 48 MHz, which (if i am not wrong) also uses the SPI1 peripherial.
FDCAN does work with this code i attached
I also have a separat code for my display, which uses a PCLK = 48MHz/8 = 6 MHz. i also attached it (TFT_V2).
At first i just copied all .h and .c files from my display-only project into my FDCAN-only project and configured the files in core as they were in the display code. When i tested it, it was already showing the "sawtooth" SCK signal. I thought, maybe this is because i missed something while copying from the display-only code to the FDCAN-only code. Thats why i started again with CubeMX with the ioc. from my FDCAN-only project and added everthing i need and compared it to the display-only .ioc. After generating the code, adding back in the stuff for CAN-FD (Filter setup, Header definition, adding the FiFo Callback fct for FDCAN etc.)
and t
he display setup as described in the github
and
flashed the code, it showed the same signal as my first CANFD and display project, i mentioned before.
Also:
I can not attach it today, but i also have a project with both fdcan and display working. It uses just CAN and a PCLK of (i think) 6MHz. This project is currently not on this PC i am writing this post on. I can attach it later.
Anyway: because my other WORKING project has a different PCLK and the edges of the SCK signal in this current CAN-FD+Display project with 48 MHz, i think the clock signal is the cause of no communication. I also checked NRST and CS signals for display. NRST is 1 at operation, which is ok, since NRST is active low. CS is always 0, which is also correct.
2026-05-21 7:51 AM
What if you disable FDCAN and keep that "not working" clock config and try to display any message on the LCD?
do you have the same issue?
2026-05-21 8:45 AM
@BNE wrote:the SCK Signal for the communication looks more like a sawtooth signal than a rectangle.
What speed do you have configured for SCK GPIO pin?
Try 'Very High' (or whatever the highest is)
2026-05-22 4:40 AM
I did not test it, but i found the problem was the speed for the GPIO. Thanks for the help
2026-05-22 4:42 AM
Yes, this was the problem. SCK signal looks still different, then i expected, but maybe thus is because of the setup with my oscilloscope. At least for now the communication is working
2026-05-22 4:42 AM
Thank you very much !