Hi! I need help with the external library from the Github, I really don’t know what can be wrong with my simple project environment. I use VSCode + PIO, my platform.ini file looks like this:
[env]
upload_protocol = stlink
lib_extra_dirs = lib/CanFestival
platform_packages =
framework-stm32cube @ https://github.com/rocknitive/framework-stm32cube.git
[env:test_module]
platform = ststm32
board = bluepill_f103c8
framework = stm32cube
monitor_speed = 115200
lib_deps =
https://github.com/AndersKaloer/Ring-Buffer.git
bblanchon/ArduinoJson@6.16.1
[env:BASE_0]
platform = ststm32
board = bluepill_f103c8
framework = stm32cube
lib_deps = bblanchon/ArduinoJson@6.16.1
I want to use this lib: GitHub - AndersKaloer/Ring-Buffer: A simple ring buffer (circular buffer) designed for embedded systems.
for my env:test_module.
When I add some lines of code from this lib to my main.cpp (fragment of which you can see below):
#include "stdio.h"
#include "stm32f1xx.h"
#include "canfestival.h"
#include "can_stm32.h"
#include "TestMaster.h"
#include "ringbuffer.h" // this is library which i want to use
ring_buffer_t uart_rx_buffer;
int main() {
system_config();
sys_tick_init();
gpio_setup();
usart2_init();
ring_buffer_init(&uart_rx_buffer); // this is very all go bad enough
while(1)
{
}
return 0;
}
I get this error when I try to build my env:test_module:
.pio/build/test_module/src/main.o: In function `main':
main.cpp:(.text.startup.main+0x22): undefined reference to `ring_buffer_init(ring_buffer_t*)'
collect2: error: ld returned 1 exit status
*** [.pio/build/test_module/firmware.elf] Error 1
What i am doing wrong?