2020-09-10 10:05 PM
Hello
I dont know what is the problem that when I compile my code with Keil, the USB works nicely,
but when I use cubeide compiler, the usb doesnt work. Both codes are generated by cubemx
when the code compiled by cubeide, the usb is recognised, but communication is denied.
I use USB in CDC mode. When the code compiled by keil everythings works.
2020-09-11 03:25 AM
Hi @Vahid Ajallooeian ,
Could you please provide some more details about the issue you are facing:
-Amel
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.
2020-09-11 10:26 AM
STM32cube and STM32ide both are latest version.
STM32cubeMX V6.0.0. (Don't know if it was with earlier versions.)
STM32cube IDE V1.4.2 (Although the matter was with 1.3.0 till now)
I used different graphic libraries with other peripherals running at the same time. (Stemwin with some bugs, Touchgfx somehow good and LVGL really the best of them till now.) I say the code is okay with keil compiler NO MATTER which graphical library is used (with different optimization levels). But USB doesn't work in CDC mode if CUBEIDE compiler is used. Dont know what is the problem.
Since CUBEIDE is eclipse based, it is preffered.
I use STM32f429IGT6 custom board. (The IC Designers of ST is perfect, unfortunately the board desiger was such an idiot)
The IOC file is attached. Don't now if it is possible to regenerate the problem.
2020-09-11 01:21 PM
Not looking to wade into this too deeply, but Keil vs GCC, I would focus on code in startup.s and how the stack/heap work.
The USB code uses the heap.
For other latent code issues, turn off optimization and see if functionality changes.
2020-09-11 08:35 PM
2020-09-11 08:50 PM
Some easier way to see the matter. You can check it with discovery boards also. I checked with STM32f407vgt DISCOVERY - STM32CUBEIDE - FW-F4 V1.25.0.
2020-09-11 09:14 PM
I'm a Keil guy, I can't commit resources to chase down issues with IAR, GNU/GCC or CubeMX.
I'd suggest you output diagnostic information related to RCC and other peripheral settings. Clocks, peripherals and pins.
Start with the PLL, and the 48 MHz clock source going to the USB peripheral.
Unpack the clock settings, keep digging until you can isolate the difference between the working and non-working.
2020-09-11 09:45 PM
There are two matters.
First and foremost the codes are identical, even no ; is different.
Second in all cases, the usb is detected in device manager. But in different serial port utilities like puty or serial port monitor or other softwares the port is not able to open if the UC code is compiled with compiler other than KEIL. the clocks seems OK. I think its the compilation time matter.
2020-09-14 12:35 AM
@Amel NASRI Any solution?:crying_face:
2020-12-28 10:56 AM