Simple project using libopencm3 in SES

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Simple project using libopencm3 in SES

      New

      I'm trying to build a simple blinker hello world project using libopencm3. It is a big complicated project and it's using Makefile to build. So far I tried compiling it with SEGGER compiler as CC parameter for the Makefile and creating a Library project in SES importing all the code that I need, but couldn't get it built.

      My target microcontroller is STM32F103C8T6 and the code is based on this example:

      C Source Code: main.c

      1. #include <libopencm3/stm32/rcc.h>
      2. #include <libopencm3/stm32/gpio.h>
      3. static void gpio_setup() {
      4. rcc_periph_clock_enable(RCC_GPIOC);
      5. gpio_set_mode(GPIOC, GPIO_MODE_OUTPUT_2_MHZ,
      6. GPIO_CNF_OUTPUT_PUSHPULL, GPIO12);
      7. }
      8. int main() {
      9. gpio_setup();
      10. while (1) {
      11. gpio_toggle(GPIOC, GPIO12);
      12. for (int i = 0; i < 800000; i++)
      13. __asm__("nop");
      14. }
      15. return 0;
      16. }
      Display All
      What would be the correct approach to compile this in SES using libopencm3?
    • New

      tpimh wrote:

      I tried compiling it with SEGGER compiler
      I thought Segger just uses the GCC Compiler ?


      tpimh wrote:

      It is a big complicated project
      Are you familiar with working on big complicated tools with other IDEs ?

      Have you been able to build simple projects using SES ?

      It's always best to start with simple projects to learn how to use a new tool ...


      tpimh wrote:

      couldn't get it built
      What problem(s) did you have?

      It's hard to help you solve the problems when you don't say what those problems are!