Jump to content

[DCS-BIOS] Support for STM32 board


Patriot

Recommended Posts

Hi all!

I tried to run DCS-bios on the STM32 board and with some corrections it worked. Yes, in the current form it slows down and works worse, but if fix the block for DOS BIOS_IRQ_SERIAL (or block for Slave) that it will fly!

First correction:

Add this code in top of file:

char *utoa (unsigned int __val, char *__s, int __radix)
{
   if (!__builtin_constant_p (__radix)) {
 extern char *__utoa (unsigned int, char *, int);
 return __utoa (__val, __s, __radix);
   } else if (__radix < 2 || __radix > 36) {
 *__s = 0;
 return __s;
   } else {
 extern char *__utoa_ncheck (unsigned int, char *, unsigned char);
 return __utoa_ncheck (__val, __s, __radix);
   }
}

 

And board will be work with #define DCSBIOS_DEFAULT_SERIAL, but very-very slow. Ok, we can make second fix: change default Serial on Serial2 in DcsBios.h:

#ifdef DCSBIOS_DEFAULT_SERIAL
namespace DcsBios {
	ProtocolParser parser;
	void setup() {
		Serial2.begin(250000);
	}
	void loop() {
		while (Serial2.available()) {
			parser.processChar(Serial2.read());
		}
		PollingInput::pollInputs();
		ExportStreamListener::loopAll();			
	}
}
bool sendDcsBiosMessage(const char* msg, const char* arg) {
	Serial2.write(msg); Serial2.write(' '); Serial2.write(arg); Serial2.write('
');
}
#endif

 

Already better, but still slow - this you can see on the video.

 

I do not have enough knowledge to write the correct code for working with a Serial port through registers. Ian, it will be great if you can support this board in DCS-BIOS, because stm32 all better Arduino nano. Well, or someone else, if Ian refuses..

 

Arduino nano:

16Mhz,

Flash: 32KB

RAM: 2KB

UART: 1

I2C: 1

PWM: 0-255

Analog read: 0-1024

Price: $1.8

 

Stm32:

72MHz

Flash: 64KB

RAM 20KB

UART: 3

I2C: 3

PWM: 0-4096

Analog read: 0-65535

Native USB

Price: $2

 

My cockpit A-10C

Строю кокпит A-10C

i7 7700k, 32Gb RAM, SSD NVMe, GTX 1080, Hotas Warthog, HTC Vive.

-----------------

With love from Russia

Link to comment
Share on other sites

  • 3 years later...

Necroing here, but keen to see STM32 support myself.

Currently using a MEGA2560 and even with it's extra ram (8KiB vs 2KiB) over the micro I'm still running out.

 

R7 3800X - 32Gig RAM -- All SSD -- GTX1070 -- TM Warthog, MFG Crosswinds & TiR

Link to comment
Share on other sites

  • 1 year later...
  • 6 months later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...