Skip to main content
dheerajdake9
Associate III
December 15, 2016
Question

Best Free IDE for programming STM32F769I-DISCO with cubeMX generated firmware?

  • December 15, 2016
  • 7 replies
  • 3354 views
Posted on December 15, 2016 at 08:28

Hello everyone,

I have the STM32F769I-DISCO board with LCD on it. The CubeMX has options to generate firmware for the following toolchains:

1. EWARM

[requires a paid license]

2. MDK

[works without license but the IDE is lagging on my computer], P.S- I have a gaming machine with beastly performance.

3. Truestudio

[free, the best IDE so far for me. I am able to write code and launch through this IDE]

4. SW4STM32

[This is the worst toolchain. Inspite of being supported by the STM community, it has several bugs. I was unable to compile the firmware generated by cubeMX. It throws lots of errors.]

For some reasons, the printf is not working in Truestudio. That's why I am looking at the most preferred environment for programming this board.

Sorry to say this, but the firmware examples are very bad. Please include examples which will ease our development.

Thanks

Dheeraj

Note: this post was migrated and contained many threaded conversations, some content may be missing.
    This topic has been closed for replies.

    7 replies

    Technical Moderator
    December 16, 2016
    Posted on December 16, 2016 at 17:39

    Dear

    Dake.Dheeraj

    ‌,

    Thanks for sharing your feedback. I will report your comments internally for further investigation.

    Thank you for the contribution

    Best Regards

    -Imen-

    In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
    ST Renegade
    Associate
    December 16, 2016
    Posted on December 16, 2016 at 21:27

    Hi Imen,

    would it be possible to add a makefile generation into the CubeMX? I don't have experiences, but in Eclipse based environments it's possible to create a new project based on makefile, so the makefile won't be just for linux geeks, but maybe for everyone who uses Eclipse... However as I said, don't have experiences by importing a project into Eclipse based on makefile, so don't know about pros & cons.

    Thx and have a nice day,

    Renegade

    Andrei Chichak
    Lead
    December 16, 2016
    Posted on December 16, 2016 at 21:34

    You seem to want to write off the IDEs for a lot of reasons that are not valid and I'm not sure you are asking for help in picking an IDE or fixing your code.

    For the printf stuff, read this: 

    http://embedded.fm/blog/2016/12/13/discovery-uarts-part-3-the-final-step

     

    It's strange that SW4STM32 is worst and Truestudio is best since both use GCC. You might want to look at: 

    http://embedded.fm/blog/2016/10/18/discovery-code-part-3

     

    As for the examples being bad, the tools being bad, and everything being slow, the tools for Atmel are great.

    dheerajdake9
    Associate III
    December 16, 2016
    Posted on December 16, 2016 at 23:03

    Hi Andrei,

    I need help in choosing a reliable IDE which is free. I will check the UART tutorial and get back to you. I said SW4STM32 as worst, as it reported errors when I imported the project into the workspace and compiled it. Truestudio has an 'Open Project' option after I generate firmware using cubeMX, the SW4STM32 doesn't have it. I had to manually import it into the workspace.  Are you saying that the tools are bad for ST platform compared to ATMEL's?

    I also need help in choosing debugging environment. 

    Thanks for your time 

    Sirma Siang
    ST Employee
    January 10, 2017
    Posted on January 10, 2017 at 09:42

    Hello dake.dheeraj,

    First I would like to thank you for your feedback.

    I have tried to reproduce your symptom, and I did the following:

       Cube 4.18 + STM32Cube_FW_F7_V1.5.1 firmware

       I have created a new STM32F769I-DICO project, and generate it for SW4STM32 Toolchain/IDE.

       Then I open my eclipse (Neon), and import it, only once at the first time, by doing the following:

       File->Import : Projects from Folder or Archive

       Select the directory in which Cube has generated the code

       ->Finish

       Select the project, Project->Build Project

    Everything built fine.

    Just to be sure; have you installed the openSTM32 necessary eclipse plugins, has it is describe here ?

    http://www.openstm32.org/Installing+System+Workbench+for+STM32+from+Eclipse?structure=Documentation

    When you said that you faced some build errors, could you please share the error log ?

    Thanks in advance for your feedback.

    KR

    Sirma
    dheerajdake9
    Associate III
    January 15, 2017
    Posted on January 15, 2017 at 03:06

    Hello Sima,

    Thanks for replying. I have updated my STMCubeMX to Version 4.18.0. I have deleted my previous STM32F7 firmware repository as I wanted to start fresh. I setup a STM32F7x9 project and selected the right MCU. In project settings, I entered name, selected SW4STM32 tool chain and clicked on. Since the firmware repository was missing, I went into Help->Install new libraries which opened the library manager there I selected Firmware Package for Family STM32F7 1.5.1 and clicked Install now. I got this error.

    0690X000006062qQAA.png

    The first thing I noticed is even though I selected 1.5.1, it downloaded 1.5.0(dependency maybe). It failed. I also tried to install 1.5.0 first prior to 1.5.1, it failed too. I manually visited this link

    http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef7.html

     

    and download the latest FW 1.6.0. Surprisingly the latest version shown in cubeMX software is not the same as that listed on site. Anyways, I downloaded it and unzipped it to the repository folder on my PC. In the project settings, I selected that FW package path and clicked generate code. So far so good. 

    I am using windows 10. I have eclipse Kepler installed. When I click Import, I don't get Projects from folder or archive, I have something like this:

    0690X00000605qIQAQ.png

    I selected C/C++ and imported it as MakeFile project and selected Ac6 STM32 MCU GCC toolchain(this showed up after I installed the eclipse plugins). I get the following errors in my eclipse console. When I click build it says,

    No rule to make target all. I didn't find any makefile in the repository. How will the project build? 

    0690X000006060lQAA.png

    Thank you

    Dheeraj

    Sirma Siang
    ST Employee
    January 16, 2017
    Posted on January 16, 2017 at 12:18

    Hello Dheeraj,

    Great thanks for your inputs :)

    About the firmware dependency, you are absolutely right. The version 1.5.1 is an update of the 1.5.0. So to be able to install it, the system needs the 1.5.0 to be installed first.

    About the firmware instalation issue, it looks that something goes wrong during the download... I report this internaly.

    About the import project, here is what I get:

    0690X000006063jQAA.png

    I searched under Eclipse project and found the following news:

       

    http://www.eclipse.org/eclipse/news/4.6/M7/

    It looks the menu I am using is new from version Neon.

    I tried using ''Existing Project into Workspace'' , and it works well.

    Could you try that way too ?

    To check more deeply why the build failed, could you please share the complete Console log ?

    Great thanks in advance.

    Kind Regards

    Sirma

    dheerajdake9
    Associate III
    January 19, 2017
    Posted on January 19, 2017 at 05:50

    Thanks for the reply. I did import as ''Existing Project into workspace'' and the build succeeded without any errors. Awesome! But I have another problem now which I didn't have it before. When I press debug, I am getting these error messages:

    0690X000006064SQAQ.png0690X0000060656QAA.png

    The first message, ''the system tried to join a drive to a directory on a joined drive'', is because when I plug in my STM32F769-disco board, it shows as a 2 MB removable storage on my computer. It has 2 files in it, DETAILS.txt and mbed.htm. It didn't show up as a removable storage media before. Strange. The first error is due to this. I am not sure about the second error. I didn't change any clock settings in cubeMX. 

    After I press the debug button, the COM LED stays green all the time instead of flashing red and green. I had no luck running a blinky sketch on this. I appreciate your help and I'll try to reply fast from now onwards. Any ideas on these errors?

    Thank you

    Dheeraj 

    Sirma Siang
    ST Employee
    January 20, 2017
    Posted on January 20, 2017 at 11:46

    Hello Dheeraj,

    When the board connect to USB, it registers with several profile. One of them is USB Mass Storage. This is normal for the demo boards.

    About your error message, it looks openOCD failed to connect to the board -> libusb failure

    First could you be sure to have installed the two following windows drivers :

       

    http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link007.html

       

    http://www.st.com/content/st_com/en/products/embedded-software/development-tool-software/stsw-link009.html

    They are needed for respectively firmware upgrade and support board communication over USB.

    Then could you check the openOCD Eclipse version ?

    Mine is 1.12 as in the attache picture.

    0690X00000605SlQAI.png

    Let me know before moving deeper :)

    KR

    Sirma

    dheerajdake9
    Associate III
    January 21, 2017
    Posted on January 21, 2017 at 04:43

    Hello, 

    I have installed the software from the links you mentioned. Installation was successful. My OpenOCD version is same as yours 1.12.0.201611241417. I tried Debug after the update but I was getting the same errors again. 

    0690X000006066iQAA.png

    Thank you

    Dheeraj

    Sirma Siang
    ST Employee
    January 27, 2017
    Posted on January 27, 2017 at 16:54

    Hello Dheeraj,

    Your USB error shows openocd failure.

    Could you check under your device manager if the debug dongle is well enumerated as an universal serial bus ?

    Like in that picture

    0690X00000605ZbQAI.png

    Then by expanding STMicroelectronics STLink dongle, could you check if you have same as mine:

    0690X00000606AVQAY.png

    The next thing you can do is to upgrade your eclipse drivers to 1.13.

    Kind regards

    Sirma

    gvigelet
    Associate III
    January 20, 2017
    Posted on January 20, 2017 at 14:15

    Hi 

    Dheeraj,

    I have very little experience with EWARM and MDK may produce the best binaries but the ide lacks and is pretty dated.  I have used MDK on many projects and over the last couple years have been using Truestudio which is by far my favorite due to the fact many of my other tools are within an eclipse environment and is very familiar as well as supporting many pluggable features.  I myself have had a bunch of issues with the 

    SW4STM32 community ide, but that was when it was still new a couple years back so hopefully by now it has matured a little.  

    As for the printf not working, hopefully you figured it out by now but if not, I can help you out a little.  Printf works fine with all toolchains, but all tool chains need to be implement the redirection.  A syscalls.c file must be included and the _write function must be implemented to direct the output of printf to where you want it to go.  The following should help and if you do not want the output on the ITM port write to your configured UART with HAL_UART_Transmit function rather than 

    ITM_SendChar.

    http://blog.atollic.com/cortex-m-debugging-printf-redirection-to-a-debugger-console-using-swv/itm-part-1

     

    I have used the following code for years in many different environments from my main.c

    #ifdef __GNUC__

    /* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf

          set to 'Yes') calls __io_putchar() */

       #define PUTCHAR_PROTOTYPE int __io_putchar(int ch)

    #else

       #define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

    #endif /* __GNUC__ */

    /**

    * @desc printf I/O implementation

    * @param string $msg - the message to be displayed

    * @return none

    */

    PUTCHAR_PROTOTYPE

    {

       /* replace hUart with your uart handle */

       HAL_UART_Transmit(&hUart, (uint8_t *)&ch, 1, 0x0f);

       return ch;

    }
    dheerajdake9
    Associate III
    January 21, 2017
    Posted on January 21, 2017 at 04:45

    Hello,

    The code you pasted for printf() worked in Keil IDE. This is how I got the printf to work previously. It doesn't work in Truestudio. Truestudio is my favourite too. But now I am getting the errors I mentioned in Truestudio too. I wonder why my board is being detected as a USB storage device. The COM port shows up fine though. 

    gvigelet
    Associate III
    January 21, 2017
    Posted on January 21, 2017 at 07:10

    I apologize I did not test it in Truestudio, but I have used it with the GCC chain, you will need to add the tiny_printf.c to your project and then change the prototype for gcc/atollic in main

    https://www.dropbox.com/s/vxuqkiydeyvegrq/Screenshot%202017-01-21%2001.01.48.png?dl=0

     

    ♯ include 'stdio.h'

    ♯ ifdef __GNUC__

       /* With GCC/ATOLLIC, tiny printf (project explorer new other->Library functions->Tiny printf implementation */

        ♯ define PUTCHAR_PROTOTYPE int _write(int fd, char *str, int len)

    ♯ else

        ♯ define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)

    ♯ endif /* __GNUC__ */

    /**

    * @desc printf I/O implementation

    * @param string $msg - the message to be displayed

    * @return none

    */

    PUTCHAR_PROTOTYPE

    {

       /* replace

    huart2

    with your uart handle */

       HAL_UART_Transmit(&huart2, (uint8_t *)str, len, 0x0f);

       return len;

    }

    - George

    AVI-crak
    Senior
    February 8, 2017
    Posted on February 08, 2017 at 12:17

    No perfect ID, is a myth.

    Those who create such a myth - it is necessary to shoot a little bit.

    Any selected ID requires knowledge.

    After receiving the bare metal programming skills - problem disappear selection ID. You will be able to program any ID.

    // Can directly write in Russian?
    AvaTar
    Senior III
    February 8, 2017
    Posted on February 08, 2017 at 12:55

    No perfect ID, is a myth.

    Those who create such a myth - it is necessary to shoot a little bit.

    Any selected ID requires knowledge.

    Quite true.

    IDE's are supposed to make things simpler for the 'un-adept'. Actually, they tend to make things much harder once you deviate from the foreseen path ...

    // Can directly write in Russian?

    Not recommended. Hardly anyone here can read cyrillic letters, let alone decipher words.

    I could.

    AVI-crak
    Senior
    February 8, 2017
    Posted on February 08, 2017 at 14:32

    Oh yes, I see it.

    Re-transfer is difficult to confuse with something else.