Questions tagged [libopencm3]

This tag is for questions about using libopencm3 library. This includes coding using libopencm3 library and library code itself.

libopencm3 is a library written in C. It provides framework for abstracting hardware interfaces of various ARM Cortex-M3 controllers. So it's in some way a HAL (Hardware Abstraction Layer) for creating more unified firmwares code that can be easily ported to another Cortex-M3 controllers. This library also simplifies programming, providing high-level API to hardware.

libopencm3 replaces CMSIS and STM32 Standard Peripheral Library.

Links:

[1] Official site

[2] Git repository

[3] Examples

[4] Documentation

[5] Wiki page

40 questions
1
vote
1 answer

Confusing statement in the C function declaration

I am going through a code implementation of USB drivers on an STM32 MCU. My C language understanding is a bit limited and I have come across this function definition that is not clear to me. static enum usbd_request_return_codes…
1
vote
3 answers

Optimization flag is not taken into account when compiling with arm-none-eabi-gcc

I want to compile a program with arm-none-eabi-gcc 9.2.1 using the libopencm3 project and run it on ARM Cortex-M4 processors. My program is composed of two files: main.c #include "../common/stm32wrapper.h" #include "test.h" #include…
Raoul722
  • 1,222
  • 13
  • 30
1
vote
2 answers

STM32F103 | libopencm3 | GPIO toggle using interrupt issue

So, I am trying to toggle a LED based on an interrupt from a button. Ideally the when the button is pressed the LED should toggle i.e. switch on if its off and vice versa. But when I execute this code it toggles and returns to its original state.…
mattyyy
  • 13
  • 7
1
vote
0 answers

vscode intellisense cmake-tools with external library

I'm trying to configure a template project for my STM32 blue pill board with CMake and cmake-tools for Visual Studio Code. It builds just fine, but the Intellisense feature of cmake-tools seems not to work with an external library (libopencm3 in…
R.S.
  • 276
  • 1
  • 8
1
vote
1 answer

STM32 FreeRTOS with LibOpenCM3

I have a STM32 BluePill Board (STM32F103C8 with 8Mhz Quarz) and tried to upload a small blink program made with LibOpenCM3 and FreeRTOS. But for some reason FreeRTOS hangs in vTaskStartScheduler() the sys_tick_handler also doesn't do anything. I…
feldim2425
  • 364
  • 3
  • 14
1
vote
0 answers

How to set specs file for gcc in Docker container

I'm trying to build TREZOR firmware, it uses docker. Dockerfile contents: RUN apt-get update RUN apt-get install -y build-essential git python python-ecdsa gcc-arm-none-eabi When gcc compiles libopencm3 in Docker, I've got the error: error: 'for'…
Peter
  • 11
  • 2
1
vote
1 answer

LibOpenCM3 vector table is all blocking-handler

The answer to this question here Libopencm3 interrupt table on STM32F4 explains the whole mechanism nicely but what I get is whole vector table filled with blocking handlers. I know that because I see it in debugger (apart from the whole thing not…
spacer
  • 1,347
  • 1
  • 9
  • 20
1
vote
0 answers

How to install third party library in IDE based on eclipse

I have downloaded "libopencm3" library for STM32 and IDE SW4STM32 based on eclipse. I want to add "c:\lib\libopencm3" to libraries which are used in many projects like . My IDE during compilation and edition of code doesn't recognize …
18C
  • 2,014
  • 10
  • 16
1
vote
1 answer

PX4 software download error

I have windows 7 32-bit OS. I have downloaded Eclipse, Java, minGW, GIT Bash but am unable to download the firmware. In the steps for toolchain installation, it says to go to px4 toolchain->px4 software download and 3 directories firmware,…
0
votes
1 answer

libopencm3 STM32G0: GPIO inputs don't work

My code does not set the GPIOs as inputs on my Nucleo-G071RB. The MODER register ist completly set (0xffffffff) and the GPIOs work as outputs. What did I wrong? Code: #include void setupGpio(void); void setupGpio(void)…
Dinera
  • 85
  • 2
  • 11
0
votes
1 answer

Issue relaying messages between multiple USART connections on the STM32F1 Blue pill

I have a setup with a STM32F103C8T8 and two modules (SARA & ESP82) on USART connections. we are currently using the libopencm3 and FreeRTOS libraries. The goal I want the STM to send AT commands to the SARA module, receive the response and relay…
MBJensen
  • 23
  • 5
0
votes
0 answers

Delay using general purpose timer - faster than expected

I've written a delay function using one of the basic timers on my nucleo-g070 board (not systick). The default clock is 16MHz (if I query the APB1 frequency I get 16000000). However, the LED blinks way too fast (almost too fast to see), so…
0
votes
0 answers

AC6 eclipse - problem with running an example blinker using libopencm3

I'm having a problem with testing example of code for STM32F103 from libopencm3. I included a libopencm3 in directory with inc files, and added inc directory to "Path and Symbols". I get an error like no file or directory, even though i have file…
Sink
  • 91
  • 1
  • 2
  • 9
0
votes
1 answer

How to build project with local library on platformio?

Problem: Cannot understand why the project is not building with local library. I am getting following error on my terminal while building the project: Linking .pio/build/genericSTM32F103C8/firmware.elf .pio/build/genericSTM32F103C8/src/main.o: In…
mattyyy
  • 13
  • 7
0
votes
1 answer

memset initialization of struct freeze

Some library I use in an embedded (STM32F103) project initializes it's structs with memset() which for some reason causes the program to stop responding/hang. To test this I used: typedef struct { uint8_t b; uint8_t c; }…
Avalan
  • 159
  • 1
  • 10