USB and compiler problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Labels:
-
STM32CubeMX
-
USB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-11 3:25 AM
Hi @Vahid Ajallooeian​ ,
Could you please provide some more details about the issue you are facing:
- which STM32CubeMX and STM32CubeIDE versions are you using? Generally it is recommended to be aligned with latest available ones.
- which STM32 device or board you selected?
- it would be helpful to share the .ioc file to easily reproduce the issue.
-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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-11 1: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.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-11 8:35 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-11 8: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-11 9: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 informat​ion 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.​
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-11 9: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-09-14 12:35 AM
@Amel NASRI​ Any solution?:crying_face:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2020-12-28 10:56 AM
