DCS BIOS with STM32

What are you developing?
Post Reply
nerwerr
Posts: 2
Joined: Wed Feb 14, 2024 2:48 pm

DCS BIOS with STM32

Post by nerwerr »

Hello

I'm new here and trying to figure out how to code in DCS BIOS using the STM32 extension for an f-16 cockpit, I'm currently using the dcs-bios-arduino-library-0.3.9.

The STM32 boards was installed using this json link:
https://github.com/stm32duino/BoardMana ... index.json

After I compile the code a sequence of error relating directly to the DCSBIOS.h appears on the arduino ide console, even when just a small part of the code is used the error report is the same. When changed for the arduino board it compile without problems. normally was used the STM32F4 board but even when other boards are used the error is the same.

The code is bellow:

Code: Select all


#define DCSBIOS_IRQ_SERIAL
#define DCSBIOS_FOR_STM32

#include "DcsBios.h"

// TEST PANEL

int FLCS_MAINT = PE_2 ; // flcs maint
int FLCS_TEST = PE_3 ; // flcs test
int PROBE_HEAT = PE_4 ; // probe heat
int PROBE_TEST= PE_5 ; // probe test
int FIRE_OVHT = PE_6 ; // overhear - fire

/* paste code snippets from the reference documentation here */

void setup() {
DcsBios::setup();
}

void loop() {
DcsBios::loop();
}
Here is the error that returns

Code: Select all

In file included from C:\Users\leosa\AppData\Local\Temp.arduinoIDE-unsaved2024113-18876-1rtbjia.9jz6\IRQSerial\IRQSerial.ino:21:
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:55:20: error: expected constructor, destructor, or type conversion before '(' token
55 | ISR(USART0_RX_vect) {
| ^
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h: In function 'void DcsBios::setup()':
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:27:14: error: 'PRR' was not declared in this scope; did you mean 'PWR'?
27 | #define PRR0 PRR
| ^~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:61:25: note: in expansion of macro 'PRR0'
61 | PRR0 &= ~(1<<PRUSART0);
| ^~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:61:38: error: 'PRUSART0' was not declared in this scope; did you mean 'USART1'?
61 | PRR0 &= ~(1<<PRUSART0);
| ^~~~~~~~
| USART1
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:62:25: error: 'UBRR0H' was not declared in this scope
62 | UBRR0H = 0;
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:63:25: error: 'UBRR0L' was not declared in this scope
63 | UBRR0L = 3; // 250000 bps
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:64:25: error: 'UCSR0A' was not declared in this scope
64 | UCSR0A = 0;
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:65:25: error: 'UCSR0C' was not declared in this scope
65 | UCSR0C = (1<<UCSZ00) | (1<<UCSZ01);
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:65:38: error: 'UCSZ00' was not declared in this scope
65 | UCSR0C = (1<<UCSZ00) | (1<<UCSZ01);
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:65:52: error: 'UCSZ01' was not declared in this scope
65 | UCSR0C = (1<<UCSZ00) | (1<<UCSZ01);
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:67:25: error: 'UCSR0B' was not declared in this scope
67 | UCSR0B = (1<<RXEN0) | (1<<TXEN0) | (1<<RXCIE0);
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:67:38: error: 'RXEN0' was not declared in this scope
67 | UCSR0B = (1<<RXEN0) | (1<<TXEN0) | (1<<RXCIE0);
| ^~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:67:51: error: 'TXEN0' was not declared in this scope
67 | UCSR0B = (1<<RXEN0) | (1<<TXEN0) | (1<<RXCIE0);
| ^~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:67:64: error: 'RXCIE0' was not declared in this scope
67 | UCSR0B = (1<<RXEN0) | (1<<TXEN0) | (1<<RXCIE0);
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h: In function 'void DcsBios::usart_tx(const char*)':
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:82:41: error: 'UCSR0A' was not declared in this scope
82 | while(!(UCSR0A & (1<<UDRE0))); // wait until TX buffer is empty
| ^~~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:82:54: error: 'UDRE0' was not declared in this scope
82 | while(!(UCSR0A & (1<<UDRE0))); // wait until TX buffer is empty
| ^~~~~
d:\Documents\Arduino\libraries\DCS-BIOS_FP-Fork\src/DcsBios.h:83:33: error: 'UDR0' was not declared in this scope
83 | UDR0 = *c++; // write byte to TX buffer
| ^~~~
Multiple libraries were found for "Servo.h"
Used: C:\Users\leosa\AppData\Local\Arduino15\packages\STMicroelectronics\hardware\stm32\2.7.1\libraries\Servo
Not used: C:\Users\leosa\AppData\Local\Arduino15\libraries\Servo
exit status 1

Compilation error: exit status 1

Someone has any clue what is happening and how to fixit?

Thanks in advance.
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: DCS BIOS with STM32

Post by fpiSTM »

My guess is it support libmaple core and not the stm32 core. https://github.com/DCS-Skunkworks/dcs-b ... d-Hardware

So a port should be done to support the stm32 core.
nerwerr
Posts: 2
Joined: Wed Feb 14, 2024 2:48 pm

Re: DCS BIOS with STM32

Post by nerwerr »

Ok thanks for the feedback i was looking today to solve this issue and instead of using the #define DCSBIOS_FOR_STM32 and the #define DCSBIOS_IRQ_SERIAL or only the #define DCSBIOS_IRQ_SERIAL I used the #define DCSBIOS_DEFAULT_SERIAL and worked with the stm32 boards F3, F4 with H5, C0 and G0 did not worked with this outputs, probably it need to change the name to work.

The main drawback that i saw is that will work slowly in the default_serial because the receive buffer can fill up if the sketch spends too much time updating them that's what it says in the documentation of the dcsbios.
Post Reply

Return to “Projects”