Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#25 Add support for STM32F0

Next Release
closed-fixed
STM32F0 (1)
5
2014-08-18
2013-12-22
Ilya Nedoluzhko
No

Add support for STM32F0-Discovery

Discussion

  • I thought about this, but I postponed it, since currently I have no F0 board to test the results... If you have a spare board to lend, or promise to do the testing, I might reconsider.

     
    • status: unread --> open-accepted
    • assigned_to: Liviu Ionescu (ilg)
     
  • I believe I could spare some time on testing. What exactly I should do?

     
    Last edit: Ilya Nedoluzhko 2013-12-22
    • to write the flash and run the applications generated by the template, in Debug/Release variants, with or without semihosting trace output.

       
      • Sounds easy enough. Due to different timezones, it wouldn't be very operative sometimes - but I'll do my best.

         
  • the latest beta (1.8.1-201312282206) includes support for STM32F0.

    it is available from

    http://gnuarmeclipse.sourceforge.net/updates-test
    

    it should blink the green led (pc9) on the stm32f0discovery with 1 hz.

    I suggest to test the standalone version first. if your debugger has support for semihosting, you can also test the retargetting/semihosting versions.

    comments are welcome.

     
    Last edit: Liviu Ionescu (ilg) 2013-12-29
  • Hello Liviu,

    I was looking all over the site and have not found the package with version you mentioned.
    Eventualy I got following packages http://gnuarmeclipse.sourceforge.net/updates-test
    GNU ARM C/C++ Cross Compiler Support 1.7.1.201312282206
    GNU ARM C/C++ STM32Fx Project Templates 1.6.1.201312282206
    After installation I got template for STM32F0 in the project creation dialog.

    Standalone mode
    Compiled successfully. Binary file being flashed manually via st-flash starts to work after I press reset button on the board.

    When I try to launch debug configuration with "C/C++ GDB Hardware debugging" Eclipse shows "Error in final launch sequence / Connection is shut down", while st-util closes with message "cannot recv: -2".
    However, the firmware works when I press reset button on the board.

    I'm novice to ARM platform, and documentation doesn't cover apects of debug/run configuration creation (but covers more trivial things:). May be something is wrong with my debug configuration, I will try to figure it out. Any advices are welcome :)

    Semihosting mode
    Compiled successfully, but I can't test one due the same reasons. Manualy flashed binary doesn't seems to work at all (probably because of mode used).

    My testing environment
    openSUSE 12.3 x86_64 KDE, lastest Eclipse Kepler, Oracle Java 1.7.0_25-b15, lastest GNU ARM, lastest st-link package from texane. The board model is STM32F0DISCOVERY featuring STM32F051R8 MCU with 8/32 SRAM/FLASH.

    Please ask if you need any additional info.

    Regards, Ilya

     
    • ah, sorry, you are right, the correct url was updates-test, I edited the original post.

      Binary file being flashed manually via st-flash starts to work after I press reset button on the board.

      great, than it works!

      I have little experience with the st-link package, so it is difficult to diagnose your problem, but for semi-hosting to work you have to enable it somehow on the gdb server, or sent it a command via the gdb client via monitor commands. then the semihosting output should be visible either in the gdb server console, or via telnet to a specific port opened by the gdb server.

      trying to run an application with semihosting output enabled without the connection the gdb server usualy fails, since the protocol uses breakpoints to pass commands from the target processor to the host environment.

      so, does the template behave as expected?

       
      • ah, sorry, you are right, the correct url was updates-test, I edited the original post.

        Please note that package versions are also differes from one you mentioned.

        so, does the template behave as expected?

        It does for standalone mode. Can't say the same for semihosting one:

        I have checked my debug configuration again and noticed that default gdb was set instead of arm-none-eabi-gdb. After fixing that I got the configuration working, but the firmware itself crashes:
        "Program received signal SIGTRAP, Trace/breakpoint trap.
        0x080001dc in start ()"
        Now I'm trying to figure out if it is still wrong debug configuration or may be the template issue.

         
        • Be sure you first use the standalone version. It should allow you to step through the code.

          Only after this works and you can figure out how to enable semihosting in GDB server you can check the semihosting version.

          As I already explained, the write calls that are below the printf() you see in the code are implemented as specific breakpoint instructions (bkpt), so that might explain the traps you noticed.

           
          • Hello! Sorry for the delay, I was abstent for a week. I just have installed and configured OpenOCD and finally got the semihosting working! By now I can assure you that following works OK for the template:

            Debug
            standalone via texane/stlink and OpenOCD
            semihosting via OpenOCD
            flashing binary directly using texane/stlink

            Release
            standalone via OpenOCD (flashing program only)
            flashing binary directly using texane/stlink

            Ask if you need to perform any kind of additional test :)

             
  • The crash I mentioned relates to semihost version only. Standalone version is seems to work ok with debugging.

    Semihosting is supported with OpenOCD. I will play with it instead of st-link linux software and provide the report later.

     
  • Thank you, Ilya, it seems fine. Enjoy the F0 template and please let me know if you notice further problems.

     
    • And thank you - for doing the great job! The plugin is awesome!

       
    • status: open-accepted --> closed-fixed
     
  • F0 template available from 1.8.1-201401111229