Skip to content

Instantly share code, notes, and snippets.

@Bas-moz
Last active November 21, 2023 19:08
Show Gist options
  • Save Bas-moz/8d2f8f8d43a2109e178b5c4904551cc0 to your computer and use it in GitHub Desktop.
Save Bas-moz/8d2f8f8d43a2109e178b5c4904551cc0 to your computer and use it in GitHub Desktop.
WIP patch with working DShot support for Beaglebone Blue
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/Makefile b/Tools/Linux_HAL_Essentials/pru/aiopru/Makefile
index 8f56fa6faf..9d13842bed 100644
--- a/Tools/Linux_HAL_Essentials/pru/aiopru/Makefile
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/Makefile
@@ -2,6 +2,9 @@ RcAioPRU: RcAioPRU.p
pasm -V3 -c RcAioPRU.p RcAioPRU_BBBMINI -DBBBMINI
pasm -V3 -c RcAioPRU.p RcAioPRU_BBBLUE -DBBBLUE
pasm -V3 -c RcAioPRU.p RcAioPRU_POCKET -DPOCKET
+ pasm -V3 -c RcAioPRUDShot.p RcAioPRUDShot_BBBMINI -DBBBMINI -CPRUcodeDShot
+ pasm -V3 -c RcAioPRUDShot.p RcAioPRUDShot_BBBLUE -DBBBLUE -CPRUcodeDShot
+ pasm -V3 -c RcAioPRUDShot.p RcAioPRUDShot_POCKET -DPOCKET -CPRUcodeDShot
test: RcAioPRUTest.c
gcc -g -o RcAioPRUTest RcAioPRUTest.c
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU.p b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU.p
index 650bb9203a..2bda22d567 100644
--- a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU.p
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU.p
@@ -372,6 +372,15 @@ rcin_ecap_end:
sbco register.temp, RAM, CH_11_T_TIME_RAM_OFFSET, 4
sbco register.temp, RAM, CH_12_T_TIME_RAM_OFFSET, 4
+ // Stop counter - This is important as the IEP timer appears
+ // to sometimes go into an undefined state if we change other
+ // parts of the control register while it's counting. Needing
+ // a hard reset to resume functioning.
+ lbco register.temp, IEP, IEP_TMR_GLB_CFG, 4
+ mov register.temp1, 0xFFFFFFFE
+ and register.temp, register.temp, register.temp1
+ sbco register.temp, IEP, IEP_TMR_GLB_CFG, 4
+
// Initialize counter (1 step = 5ns)
mov register.temp, 1 << IEP_DEFAULT_INC
sbco register.temp, IEP, IEP_TMR_GLB_CFG, 4
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBLUE_bin.h b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBLUE_bin.h
index 919bd84572..6f2c3570b4 100644
--- a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBLUE_bin.h
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBLUE_bin.h
@@ -57,6 +57,11 @@ const unsigned int PRUcode[] = {
0x81503899,
0x81583899,
0x81603899,
+ 0x91003a99,
+ 0x24ffffda,
+ 0x24fffe9a,
+ 0x10faf9f9,
+ 0x81003a99,
0x240010f9,
0x81003a99,
0x24ffffd9,
@@ -82,7 +87,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc900e408,
0x1f08fefe,
- 0x21005300,
+ 0x21005800,
0x9104389a,
0x91083899,
0x04faf9f9,
@@ -99,7 +104,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc901e408,
0x1f0afefe,
- 0x21006400,
+ 0x21006900,
0x910c389a,
0x91103899,
0x04faf9f9,
@@ -116,7 +121,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc902e408,
0x1f09fefe,
- 0x21007500,
+ 0x21007a00,
0x9114389a,
0x91183899,
0x04faf9f9,
@@ -133,7 +138,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc903e408,
0x1f0bfefe,
- 0x21008600,
+ 0x21008b00,
0x911c389a,
0x91203899,
0x04faf9f9,
@@ -150,7 +155,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc904e408,
0x1f06fefe,
- 0x21009700,
+ 0x21009c00,
0x9124389a,
0x91283899,
0x04faf9f9,
@@ -167,7 +172,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc905e408,
0x1f07fefe,
- 0x2100a800,
+ 0x2100ad00,
0x912c389a,
0x91303899,
0x04faf9f9,
@@ -184,7 +189,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc906e408,
0x1f04fefe,
- 0x2100b900,
+ 0x2100be00,
0x9134389a,
0x91383899,
0x04faf9f9,
@@ -201,7 +206,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc907e408,
0x1f05fefe,
- 0x2100ca00,
+ 0x2100cf00,
0x913c389a,
0x91403899,
0x04faf9f9,
@@ -219,5 +224,5 @@ const unsigned int PRUcode[] = {
0x48f5f603,
0x241004f4,
0x240000f5,
- 0x21004000 };
+ 0x21004500 };
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBMINI_bin.h b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBMINI_bin.h
index 4fe925148d..56fb5cf5f1 100644
--- a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBMINI_bin.h
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBMINI_bin.h
@@ -57,6 +57,11 @@ const unsigned int PRUcode[] = {
0x81503899,
0x81583899,
0x81603899,
+ 0x91003a99,
+ 0x24ffffda,
+ 0x24fffe9a,
+ 0x10faf9f9,
+ 0x81003a99,
0x240010f9,
0x81003a99,
0x24ffffd9,
@@ -82,7 +87,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc900e408,
0x1f0afefe,
- 0x21005300,
+ 0x21005800,
0x9104389a,
0x91083899,
0x04faf9f9,
@@ -99,7 +104,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc901e408,
0x1f08fefe,
- 0x21006400,
+ 0x21006900,
0x910c389a,
0x91103899,
0x04faf9f9,
@@ -116,7 +121,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc902e408,
0x1f0bfefe,
- 0x21007500,
+ 0x21007a00,
0x9114389a,
0x91183899,
0x04faf9f9,
@@ -133,7 +138,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc903e408,
0x1f09fefe,
- 0x21008600,
+ 0x21008b00,
0x911c389a,
0x91203899,
0x04faf9f9,
@@ -150,7 +155,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc904e408,
0x1f07fefe,
- 0x21009700,
+ 0x21009c00,
0x9124389a,
0x91283899,
0x04faf9f9,
@@ -167,7 +172,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc905e408,
0x1f06fefe,
- 0x2100a800,
+ 0x2100ad00,
0x912c389a,
0x91303899,
0x04faf9f9,
@@ -184,7 +189,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc906e408,
0x1f05fefe,
- 0x2100b900,
+ 0x2100be00,
0x9134389a,
0x91383899,
0x04faf9f9,
@@ -201,7 +206,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc907e408,
0x1f04fefe,
- 0x2100ca00,
+ 0x2100cf00,
0x913c389a,
0x91403899,
0x04faf9f9,
@@ -218,7 +223,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc908e408,
0x1f03fefe,
- 0x2100db00,
+ 0x2100e000,
0x9144389a,
0x91483899,
0x04faf9f9,
@@ -235,7 +240,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc909e408,
0x1f02fefe,
- 0x2100ec00,
+ 0x2100f100,
0x914c389a,
0x91503899,
0x04faf9f9,
@@ -252,7 +257,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc90ae408,
0x1f01fefe,
- 0x2100fd00,
+ 0x21010200,
0x9154389a,
0x91583899,
0x04faf9f9,
@@ -269,7 +274,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc90be408,
0x1f00fefe,
- 0x21010e00,
+ 0x21011300,
0x915c389a,
0x91603899,
0x04faf9f9,
@@ -287,5 +292,5 @@ const unsigned int PRUcode[] = {
0x48f5f603,
0x241004f4,
0x240000f5,
- 0x21004000 };
+ 0x21004500 };
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_POCKET_bin.h b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_POCKET_bin.h
index 101f8af7eb..61032a2021 100644
--- a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_POCKET_bin.h
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_POCKET_bin.h
@@ -57,6 +57,11 @@ const unsigned int PRUcode[] = {
0x81503899,
0x81583899,
0x81603899,
+ 0x91003a99,
+ 0x24ffffda,
+ 0x24fffe9a,
+ 0x10faf9f9,
+ 0x81003a99,
0x240010f9,
0x81003a99,
0x24ffffd9,
@@ -82,7 +87,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc900e408,
0x1f07fefe,
- 0x21005300,
+ 0x21005800,
0x9104389a,
0x91083899,
0x04faf9f9,
@@ -99,7 +104,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc901e408,
0x1f04fefe,
- 0x21006400,
+ 0x21006900,
0x910c389a,
0x91103899,
0x04faf9f9,
@@ -116,7 +121,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc902e408,
0x1f01fefe,
- 0x21007500,
+ 0x21007a00,
0x9114389a,
0x91183899,
0x04faf9f9,
@@ -133,7 +138,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc903e408,
0x1f05fefe,
- 0x21008600,
+ 0x21008b00,
0x911c389a,
0x91203899,
0x04faf9f9,
@@ -150,7 +155,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc904e408,
0x1f02fefe,
- 0x21009700,
+ 0x21009c00,
0x9124389a,
0x91283899,
0x04faf9f9,
@@ -167,7 +172,7 @@ const unsigned int PRUcode[] = {
0x5100f909,
0xc905e408,
0x1f06fefe,
- 0x2100a800,
+ 0x2100ad00,
0x912c389a,
0x91303899,
0x04faf9f9,
@@ -185,5 +190,5 @@ const unsigned int PRUcode[] = {
0x48f5f603,
0x241004f4,
0x240000f5,
- 0x21004000 };
+ 0x21004500 };
diff --git a/libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp b/libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp
index c141f40d62..adcd51a74a 100644
--- a/libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp
+++ b/libraries/AP_HAL_Linux/RCOutput_AioPRU.cpp
@@ -19,32 +19,94 @@
#include <unistd.h>
#include <AP_HAL/AP_HAL.h>
+#include <GCS_MAVLink/GCS.h>
#if CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_BLUE
#include "../../Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBLUE_bin.h"
+#include "../../Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_BBBLUE_bin.h"
#elif CONFIG_HAL_BOARD_SUBTYPE == HAL_BOARD_SUBTYPE_LINUX_POCKET
#include "../../Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_POCKET_bin.h"
+#include "../../Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_POCKET_bin.h"
#else
#include "../../Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRU_BBBMINI_bin.h"
+#include "../../Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_BBBMINI_bin.h"
#endif
+
+#define RCOUT_SEND_TEXT(format, args...) fprintf(myLog, format, ##args)
+
using namespace Linux;
+FILE* myLog;
+
+using namespace AP_HAL;
+
+extern const AP_HAL::HAL& hal;
+
+static bool is_dshot_mode(enum RCOutput::output_mode mode)
+{
+ switch (mode) {
+ case RCOutput::MODE_PWM_DSHOT150:
+ case RCOutput::MODE_PWM_DSHOT300:
+ case RCOutput::MODE_PWM_DSHOT600:
+ case RCOutput::MODE_PWM_DSHOT1200:
+ return true;
+ default:
+ return false;
+ }
+}
+
+/*
+ create a DSHOT 16 bit packet. Based on prepareDshotPacket from betaflight
+ This code should be shared with the ChibiOS version.
+ */
+uint16_t create_dshot_packet(const uint16_t value, bool telem_request)
+{
+ uint16_t packet = (value << 1);
+
+ if (telem_request) {
+ // We don't actually support doing anything with these.
+ packet |= 1;
+ }
+
+ // compute checksum
+ uint16_t csum = 0;
+ uint16_t csum_data = packet;
+ for (uint8_t i = 0; i < 3; i++) {
+ csum ^= csum_data;
+ csum_data >>= 4;
+ }
+ csum &= 0xf;
+ // append checksum
+ packet = (packet << 4) | csum;
+
+ return packet;
+}
+
+// XXX - Simple but ugly bit inversion. This could be handled in the PRU.
+uint16_t reverse_uint16t(uint16_t aValue) {
+ uint32_t temp = 0;
+ for (int i = 0; i < 16; i++) {
+ temp |= (aValue & (1 << i)) << (31 - i * 2);
+ }
+ return temp >> 16;
+}
+
+
static void catch_sigbus(int sig)
{
AP_HAL::panic("RCOutputAioPRU.cpp:SIGBUS error generated\n");
}
+
void RCOutput_AioPRU::init()
{
uint32_t mem_fd;
- uint32_t *iram;
- uint32_t *ctrl;
signal(SIGBUS,catch_sigbus);
mem_fd = open("/dev/mem", O_RDWR|O_SYNC|O_CLOEXEC);
- pwm = (struct pwm*) mmap(0, 0x1000, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, RCOUT_PRUSS_RAM_BASE);
+ pru_data = (struct pru_data*) mmap(0, 0x1000, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, RCOUT_PRUSS_RAM_BASE);
iram = (uint32_t*)mmap(0, 0x2000, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, RCOUT_PRUSS_IRAM_BASE);
ctrl = (uint32_t*)mmap(0, 0x1000, PROT_READ|PROT_WRITE, MAP_SHARED, mem_fd, RCOUT_PRUSS_CTRL_BASE);
@@ -53,35 +115,38 @@ void RCOutput_AioPRU::init()
// Reset PRU
*ctrl = 0;
- // Load firmware
- memcpy(iram, PRUcode, sizeof(PRUcode));
-
- // Start PRU
- *ctrl |= 2;
+ myLog = fopen((const char*)"/home/debian/silly.log", (const char*)"a+");
+ RCOUT_SEND_TEXT("Testing log\n");
- // all outputs default to 50Hz, the top level vehicle code
- // overrides this when necessary
- set_freq(0xFFFFFFFF, 50);
+ hal.scheduler->register_timer_process(FUNCTOR_BIND(this, &RCOutput_AioPRU::timer_tick, void));
}
void RCOutput_AioPRU::set_freq(uint32_t chmask, uint16_t freq_hz)
{
+ if (is_dshot_mode(_mode)) {
+ return;
+ }
+
uint8_t i;
uint32_t tick = TICK_PER_S / freq_hz;
for(i = 0; i < PWM_CHAN_COUNT; i++) {
if(chmask & (1U << i)) {
- pwm->channel[i].time_t = tick;
+ pru_data->pwm_channel[i].time_t = tick;
}
}
}
uint16_t RCOutput_AioPRU::get_freq(uint8_t ch)
{
+ if (is_dshot_mode(_mode)) {
+ return 50;
+ }
+
uint16_t ret = 0;
if(ch < PWM_CHAN_COUNT) {
- ret = TICK_PER_S / pwm->channel[ch].time_t;
+ ret = TICK_PER_S / pru_data->pwm_channel[ch].time_t;
}
return ret;
@@ -90,51 +155,45 @@ uint16_t RCOutput_AioPRU::get_freq(uint8_t ch)
void RCOutput_AioPRU::enable_ch(uint8_t ch)
{
if(ch < PWM_CHAN_COUNT) {
- pwm->channelenable |= 1U << ch;
+ pru_data->channelenable |= 1U << ch;
}
}
void RCOutput_AioPRU::disable_ch(uint8_t ch)
{
if(ch < PWM_CHAN_COUNT) {
- pwm->channelenable &= !(1U << ch);
+ pru_data->channelenable &= !(1U << ch);
}
}
void RCOutput_AioPRU::write(uint8_t ch, uint16_t period_us)
{
- if(ch < PWM_CHAN_COUNT) {
- if (corked) {
- pending_mask |= (1U << ch);
- pending[ch] = period_us;
- } else {
- pwm->channel[ch].time_high = TICK_PER_US * period_us;
- }
+ pending_mask |= (1U << ch);
+ period[ch] = period_us;
+
+ if (!corked) {
+ push_internal();
}
}
uint16_t RCOutput_AioPRU::read(uint8_t ch)
{
uint16_t ret = 0;
-
- if(ch < PWM_CHAN_COUNT) {
- ret = (pwm->channel[ch].time_high / TICK_PER_US);
+ if (ch < PWM_CHAN_COUNT) {
+ ret = period[ch];
}
+
return ret;
}
void RCOutput_AioPRU::read(uint16_t* period_us, uint8_t len)
{
- uint8_t i;
-
if(len > PWM_CHAN_COUNT) {
len = PWM_CHAN_COUNT;
}
- for(i = 0; i < len; i++) {
- period_us[i] = pwm->channel[i].time_high / TICK_PER_US;
- }
+ memcpy(period_us, period, sizeof(uint16_t) * len);
}
void RCOutput_AioPRU::cork(void)
@@ -148,10 +207,74 @@ void RCOutput_AioPRU::push(void)
return;
}
corked = false;
- for (uint8_t i=0; i<PWM_CHAN_COUNT; i++) {
- if (pending_mask & (1U<<i)) {
- write(i, pending[i]);
+
+ push_internal();
+}
+
+void RCOutput_AioPRU::set_output_mode(uint16_t mask, enum output_mode mode)
+{
+ RCOUT_SEND_TEXT("Mode set: %d.\n", mode);
+
+ if (!is_dshot_mode(mode)) {
+ // Load firmware
+ memcpy(iram, PRUcode, sizeof(PRUcode));
+
+ // Start PRU
+ *ctrl |= 2;
+
+ // all outputs default to 50Hz, the top level vehicle code
+ // overrides this when necessary
+ set_freq(0xFFFFFFFF, 50);
+ } else {
+ // Load firmware
+ memcpy(iram, PRUcodeDShot, sizeof(PRUcodeDShot));
+
+ // Start PRU
+ *ctrl |= 2;
+ }
+
+ _mode = mode;
+}
+
+int timerCount = 0;
+
+void RCOutput_AioPRU::timer_tick()
+{
+ if (!is_dshot_mode(_mode)) {
+ return;
+ }
+
+ pru_data->failsafe = 0xffffffff;
+}
+
+void RCOutput_AioPRU::push_internal()
+{
+ if (!is_dshot_mode(_mode)) {
+ for (uint8_t i = 0; i < PWM_CHAN_COUNT; i++) {
+ if (pending_mask & (1U << i)) {
+ pru_data->pwm_channel[i].time_high = TICK_PER_US * period[i];
+ }
+ }
+ } else {
+ for (uint8_t i = 0; i < 4; i++) {
+ if (pending_mask & (1U << i)) {
+ uint16_t pwm = period[i];
+
+ // The min/max duration are hardcoded. Sadly this doesn't allow
+ // us to use the higher precision of dshot.
+ pwm = constrain_int16(pwm, 1000, 2000);
+
+ uint16_t value = 2 * (pwm - 1000);
+
+ if (value != 0) {
+ // dshot values are from 48 to 2047. Zero means off.
+ value += 47;
+ }
+
+ pru_data->dshot_channel[i].frame = reverse_uint16t(create_dshot_packet(value, false));
+ pru_data->dshot_channel[i].bitpos = 0;
+ }
}
}
pending_mask = 0;
-}
+}
\ No newline at end of file
diff --git a/libraries/AP_HAL_Linux/RCOutput_AioPRU.h b/libraries/AP_HAL_Linux/RCOutput_AioPRU.h
index 745f6db868..de7bf0c6b5 100644
--- a/libraries/AP_HAL_Linux/RCOutput_AioPRU.h
+++ b/libraries/AP_HAL_Linux/RCOutput_AioPRU.h
@@ -20,6 +20,7 @@
#define RCOUT_PRUSS_CTRL_BASE 0x4a324000
#define RCOUT_PRUSS_IRAM_BASE 0x4a338000
#endif
+#define DSHOT_CHAN_COUNT 6
#define PWM_CHAN_COUNT 12
namespace Linux {
@@ -35,23 +36,44 @@ class RCOutput_AioPRU : public AP_HAL::RCOutput {
void read(uint16_t* period_us, uint8_t len) override;
void cork(void) override;
void push(void) override;
+ void set_output_mode(uint16_t mask, enum output_mode mode) override;
+ void timer_tick(void) override;
private:
static const uint32_t TICK_PER_US = 200;
static const uint32_t TICK_PER_S = 200000000;
+ void push_internal();
- struct pwm {
+ struct pru_data {
volatile uint32_t channelenable;
- struct {
- volatile uint32_t time_high;
- volatile uint32_t time_t;
- } channel[PWM_CHAN_COUNT];
+ union {
+ struct {
+ volatile uint32_t time_high;
+ volatile uint32_t time_t;
+ } pwm_channel[PWM_CHAN_COUNT];
+ struct {
+ struct {
+ volatile uint32_t bitpos; // Position of bit currently read
+ volatile uint32_t frame; // Frame, only lower 16 bits used
+ } dshot_channel[DSHOT_CHAN_COUNT];
+ uint32_t failsafe; // Has to be kept set to prevent channels from
+ // being disabled.
+ };
+ };
};
- volatile struct pwm *pwm;
- uint16_t pending[PWM_CHAN_COUNT];
+ struct dshot {
+ volatile uint32_t channelenable;
+
+ };
+
+ volatile struct pru_data *pru_data;
+ uint32_t* iram;
+ uint32_t* ctrl;
+ uint16_t period[PWM_CHAN_COUNT];
uint32_t pending_mask;
bool corked;
+ enum output_mode _mode;
};
}
diff --git a/modules/ChibiOS b/modules/ChibiOS
--- a/modules/ChibiOS
+++ b/modules/ChibiOS
@@ -1 +1 @@
-Subproject commit d4fce84ef74b051f488a05dcee38f2bec52a4e15
+Subproject commit d4fce84ef74b051f488a05dcee38f2bec52a4e15-dirty
diff --git a/modules/gbenchmark b/modules/gbenchmark
--- a/modules/gbenchmark
+++ b/modules/gbenchmark
@@ -1 +1 @@
-Subproject commit 006d23ccca1375a973b7fae0cc351cedb41b812a
+Subproject commit 006d23ccca1375a973b7fae0cc351cedb41b812a-dirty
diff --git a/modules/gtest b/modules/gtest
--- a/modules/gtest
+++ b/modules/gtest
@@ -1 +1 @@
-Subproject commit a353f71325e00fe6060e7f7b17b0dc2fe8d6731d
+Subproject commit a353f71325e00fe6060e7f7b17b0dc2fe8d6731d-dirty
diff --git a/modules/libcanard b/modules/libcanard
--- a/modules/libcanard
+++ b/modules/libcanard
@@ -1 +1 @@
-Subproject commit 99163fc2369e5e5f75f8473f0b950b3418830d3f
+Subproject commit 99163fc2369e5e5f75f8473f0b950b3418830d3f-dirty
diff --git a/modules/mavlink b/modules/mavlink
--- a/modules/mavlink
+++ b/modules/mavlink
@@ -1 +1 @@
-Subproject commit d2cc7dbff67f8c318a40e1ef57a99488b4737fab
+Subproject commit d2cc7dbff67f8c318a40e1ef57a99488b4737fab-dirty
diff --git a/modules/uavcan b/modules/uavcan
--- a/modules/uavcan
+++ b/modules/uavcan
@@ -1 +1 @@
-Subproject commit 3ef4b88d96466bbcf886f74d0ae169a4c8c1bdb0
+Subproject commit 3ef4b88d96466bbcf886f74d0ae169a4c8c1bdb0-dirty
diff --git a/modules/waf b/modules/waf
--- a/modules/waf
+++ b/modules/waf
@@ -1 +1 @@
-Subproject commit 67b3eac550520cd8a7cd1dce0f77820e91fb8ad0
+Subproject commit 67b3eac550520cd8a7cd1dce0f77820e91fb8ad0-dirty
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot.p b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot.p
new file mode 100644
index 0000000000..95fa7925fe
--- /dev/null
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot.p
@@ -0,0 +1,441 @@
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+
+// RC AllInOnePRU
+//
+// 1 channel RCInput with 5ns accuracy
+// 6 channel RCOutput currently supporting 1 kHz update
+
+// Timer
+#define TICK_PER_US 200
+#define TICK_PER_MS 200000
+
+// PWM
+
+// 150 kHz
+#define DSHOT_PERIOD 1333
+
+#define DSHOT_LOW_BIT_PULSE 500
+#define DSHOT_HIGH_BIT_PULSE 1000
+
+// How often do we poll for a new frame, for
+// now set at 1000 Hz.
+#define DSHOT_POLL_PERIOD (250 * TICK_PER_US)
+
+// Period within which the failsafe bit has to
+// be set.
+#define FAILSAFE_PERIOD (1000 * TICK_PER_MS)
+
+// Ringbuffer size
+#define RCIN_RINGBUFFERSIZE 300
+
+// PRU Constants Table
+#define ECAP C3
+#define RAM C24
+#define IEP C26
+
+// IEP
+#define IEP_TMR_GLB_CFG 0x0
+#define IEP_TMR_GLB_STS 0x4
+#define IEP_TMR_CNT 0xc
+
+#define IEP_CNT_ENABLE 0x0
+#define IEP_DEFAULT_INC 0x4
+
+// ECAP
+#define ECAP_TSCTR 0x0
+#define ECAP_CTRPHS 0x4
+#define ECAP_CAP1 0x8
+#define ECAP_CAP2 0xc
+#define ECAP_CAP3 0x10
+#define ECAP_CAP4 0x14
+#define ECAP_ECCTL1 0x28
+#define ECAP_ECCTL2 0x2a
+#define ECAP_ECEINT 0x2c
+#define ECAP_ECFLG 0x2e
+#define ECAP_ECCLR 0x30
+#define ECAP_ECFRC 0x32
+#define ECAP_REVID 0x5c
+
+// ECCTL1
+#define ECAP_CAP1POL 0
+#define ECAP_CTRRST1 1
+#define ECAP_CAP2POL 2
+#define ECAP_CTRRST2 3
+#define ECAP_CAP3POL 4
+#define ECAP_CTRRST3 5
+#define ECAP_CAP4POL 6
+#define ECAP_CTRRST4 7
+#define ECAP_CAPLDEN 8
+#define ECAP_PRESCALE 9
+#define ECAP_FREE_SOFT 14
+
+// ECCTL2
+#define ECAP_CONT_ONESHT 0
+#define ECAP_STOP_WRAP 1
+#define ECAP_RE_ARM 3
+#define ECAP_TSCTRSTOP 4
+#define ECAP_SYNCI_EN 5
+#define ECAP_SYNCO_SEL 6
+#define ECAP_SWSYNC 8
+#define ECAP_CAP_APWM 9
+#define ECAP_APWMPOL 10
+
+// ECEINT, ECFLG
+#define ECAP_INT 0
+#define ECAP_CEVT1 1
+#define ECAP_CEVT2 2
+#define ECAP_CEVT3 3
+#define ECAP_CEVT4 4
+#define ECAP_CNTOVF 5
+#define ECAP_PRDEQ 6
+#define ECAP_CMPEQ 7
+
+// RAM
+#define CH_ENABLE_RAM_OFFSET (0 * 4)
+#define CH_1_CURRENT_BIT_POSITION_RAM_OFFSET (1 * 4)
+#define CH_1_FRAME_RAM_OFFSET (2 * 4)
+#define CH_2_CURRENT_BIT_POSITION_RAM_OFFSET (3 * 4)
+#define CH_2_FRAME_RAM_OFFSET (4 * 4)
+#define CH_3_CURRENT_BIT_POSITION_RAM_OFFSET (5 * 4)
+#define CH_3_FRAME_RAM_OFFSET (6 * 4)
+#define CH_4_CURRENT_BIT_POSITION_RAM_OFFSET (7 * 4)
+#define CH_4_FRAME_RAM_OFFSET (8 * 4)
+#define CH_5_CURRENT_BIT_POSITION_RAM_OFFSET (9 * 4)
+#define CH_5_FRAME_RAM_OFFSET (10 * 4)
+#define CH_6_CURRENT_BIT_POSITION_RAM_OFFSET (11 * 4)
+#define CH_6_FRAME_RAM_OFFSET (12 * 4)
+#define FAILSAFE_RAM_OFFSET (13 * 4)
+
+#define MAX_CYCLE_TIME_OFFSET (25 * 4)
+
+#define RCIN_RING_HEAD_OFFSET 0x1000
+#define RCIN_RING_TAIL_OFFSET 0x1002
+#define RCIN_RINGBUFFER_RAM_OFFSET 0x1004
+
+// RCOut pins
+#ifdef BBBMINI
+#define RC_CH_1_PIN r30.t10
+#define RC_CH_2_PIN r30.t8
+#define RC_CH_3_PIN r30.t11
+#define RC_CH_4_PIN r30.t9
+#define RC_CH_5_PIN r30.t7
+#define RC_CH_6_PIN r30.t6
+#define RC_CH_7_PIN r30.t5
+#define RC_CH_8_PIN r30.t4
+#define RC_CH_9_PIN r30.t3
+#define RC_CH_10_PIN r30.t2
+#define RC_CH_11_PIN r30.t1
+#define RC_CH_12_PIN r30.t0
+#endif
+
+#ifdef BBBLUE
+#define RC_CH_1_PIN r30.t8
+#define RC_CH_2_PIN r30.t10
+#define RC_CH_3_PIN r30.t9
+#define RC_CH_4_PIN r30.t11
+#define RC_CH_5_PIN r30.t6
+#define RC_CH_6_PIN r30.t7
+#define RC_CH_7_PIN r30.t4
+#define RC_CH_8_PIN r30.t5
+#endif
+
+#ifdef POCKET
+#define RC_CH_1_PIN r30.t7
+#define RC_CH_2_PIN r30.t4
+#define RC_CH_3_PIN r30.t1
+#define RC_CH_4_PIN r30.t5
+#define RC_CH_5_PIN r30.t2
+#define RC_CH_6_PIN r30.t6
+#endif
+
+// RCOut enable bits
+#define RC_CH_1_ENABLE register.ch_enable.t0
+#define RC_CH_2_ENABLE register.ch_enable.t1
+#define RC_CH_3_ENABLE register.ch_enable.t2
+#define RC_CH_4_ENABLE register.ch_enable.t3
+#define RC_CH_5_ENABLE register.ch_enable.t4
+#define RC_CH_6_ENABLE register.ch_enable.t5
+#define RC_CH_7_ENABLE register.ch_enable.t6
+#define RC_CH_8_ENABLE register.ch_enable.t7
+#define RC_CH_9_ENABLE register.ch_enable.t8
+#define RC_CH_10_ENABLE register.ch_enable.t9
+#define RC_CH_11_ENABLE register.ch_enable.t10
+#define RC_CH_12_ENABLE register.ch_enable.t11
+
+// Register struct
+.struct RegisterStruct
+ .u32 ch_enable
+ .u32 ch_1_next_time
+ .u32 ch_2_next_time
+ .u32 ch_3_next_time
+ .u32 ch_4_next_time
+ .u32 ch_5_next_time
+ .u32 ch_6_next_time
+ .u32 ch_7_next_time
+ .u32 ch_8_next_time
+ .u32 ch_9_next_time
+ .u32 ch_10_next_time
+ .u32 ch_11_next_time
+ .u32 ch_12_next_time
+ .u32 next_failsafe
+ .u32 time
+ .u32 time_max
+ .u32 time_cycle
+ .u32 rcin_ram_pointer
+ .u32 rcin_ram_pointer_index
+ .u32 rcin_ram_pointer_index_max
+ .u32 rcin_ram_pointer_head
+ .u32 rcin_ram_pointer_tail
+ .u32 temp
+ .u32 temp1
+ .u32 test
+ .ends
+ .assign RegisterStruct, R4, *, register
+
+.macro RCOUT_DSHOT
+.mparam RC_CH_X_PIN, CH_X_NEXT_TIME, CH_X_ENABLE, CH_X_CURRENT_BIT_POSITION_RAM_OFFSET, CH_X_FRAME_RAM_OFFSET
+dshot:
+ qbbc dshotend, CH_X_ENABLE
+
+ // Handle arithmetic and counter overflow, check if there is something to do
+ sub register.temp, CH_X_NEXT_TIME, register.time
+ mov register.temp1, 0xF0000000
+ qbgt dshotend, register.temp, register.temp1
+
+ mov register.temp1, DSHOT_POLL_PERIOD
+ add CH_X_NEXT_TIME, register.time, register.temp1
+
+ // Offset larger than FRAME? No new FRAME.
+ mov register.temp1, 0x0000000F
+
+ lbco register.temp, RAM, CH_X_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+
+ // End and wait until new frame.
+ qbgt dshotendforceupdate, register.temp1, register.temp
+
+ lbco register.temp1, RAM, CH_X_FRAME_RAM_OFFSET, 4
+
+ // Set pin or clear pin?
+ qbbs dshotclear, RC_CH_X_PIN
+
+ // Set pin
+ set RC_CH_X_PIN
+
+ qbbs dshothigh, register.temp1, register.temp
+ mov register.temp, DSHOT_LOW_BIT_PULSE
+ add CH_X_NEXT_TIME, register.time, register.temp
+
+ jmp dshotend
+ dshothigh:
+
+ mov register.temp, DSHOT_HIGH_BIT_PULSE
+ add CH_X_NEXT_TIME, register.time, register.temp
+ jmp dshotend
+
+ dshotclear:
+
+ // Clear pin
+ clr RC_CH_X_PIN
+
+ qbbs dshotoffhigh, register.temp1, register.temp
+
+ mov register.temp1, (DSHOT_PERIOD - DSHOT_LOW_BIT_PULSE)
+ add CH_X_NEXT_TIME, register.time, register.temp1
+ add register.temp, register.temp, 1
+ sbco register.temp, RAM, CH_X_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+ jmp dshotend
+ dshotoffhigh:
+ mov register.temp1, (DSHOT_PERIOD - DSHOT_HIGH_BIT_PULSE)
+ add CH_X_NEXT_TIME, register.time, register.temp1
+ add register.temp, register.temp, 1
+ sbco register.temp, RAM, CH_X_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+ jmp dshotend
+dshotendforceupdate:
+ // We force an update the next polling cycle.
+ ldi register.temp, 0
+ sbco register.temp, RAM, CH_X_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+dshotend:
+.endm
+
+.macro RCIN_ECAP_INIT
+ // Initialize ECAP
+ mov register.temp, (1 << ECAP_CTRRST1) | (1 << ECAP_CAP1POL) | (1 << ECAP_CTRRST2) | (1 << ECAP_CAPLDEN)
+ sbco register.temp, ECAP, ECAP_ECCTL1, 4
+ mov register.temp, (1 << ECAP_STOP_WRAP) | (1 << ECAP_TSCTRSTOP) | (2 << ECAP_SYNCO_SEL)
+ sbco register.temp, ECAP, ECAP_ECCTL2, 4
+.endm
+
+.macro RCIN_ECAP
+ // New value?
+ lbco register.temp, ECAP, ECAP_ECFLG, 4
+ qbbc rcin_ecap_end, register.temp.t2
+
+ // Copy S0 and S1 duration to temp and temp1
+ lbco register.temp, ECAP, ECAP_CAP1, 8
+
+ // Copy S0 and S1 duration to RAM
+ sbbo register.temp, register.rcin_ram_pointer, 0, 8
+
+ // Clear event flags
+ mov register.temp, (1 << ECAP_CEVT1) | (1 << ECAP_CEVT2)
+ sbco register.temp, ECAP, ECAP_ECCLR, 4
+
+ // Set new tail value
+ RCIN_WRITE_TAIL register.rcin_ram_pointer_index
+
+ // Update pointer
+ add register.rcin_ram_pointer_index, register.rcin_ram_pointer_index, 1
+ add register.rcin_ram_pointer, register.rcin_ram_pointer, 8
+
+ // Check end of ringbuffer
+ qblt rcin_ecap_end, register.rcin_ram_pointer_index_max, register.rcin_ram_pointer_index
+ mov register.rcin_ram_pointer, RCIN_RINGBUFFER_RAM_OFFSET
+ mov register.rcin_ram_pointer_index, 0
+rcin_ecap_end:
+.endm
+
+.macro RCIN_WRITE_HEAD
+.mparam RCIN_HEAD
+ sbbo RCIN_HEAD, register.rcin_ram_pointer_head, 0, 2
+.endm
+
+.macro RCIN_WRITE_TAIL
+.mparam RCIN_TAIL
+ sbbo RCIN_TAIL, register.rcin_ram_pointer_tail, 0, 2
+.endm
+
+.macro MAX_CYCLE_TIME
+ lbco register.temp1, IEP, IEP_TMR_CNT, 4
+ sub register.temp, register.temp1, register.time_cycle
+ mov register.time_cycle, register.temp1
+ max register.time_max, register.time_max, register.temp
+ sbco register.time_max, RAM, MAX_CYCLE_TIME_OFFSET, 4
+.endm
+
+.macro INIT
+ // Reset PWM pins
+ mov r30, 0x0
+
+ // Clear register
+ zero &register, SIZE(register)
+
+ // Initialize max cycle time
+ mov register.temp, 0
+ sbco register.temp, RAM, MAX_CYCLE_TIME_OFFSET, 4
+
+ // Initialize ringbuffer
+ mov register.rcin_ram_pointer, RCIN_RINGBUFFER_RAM_OFFSET
+ mov register.rcin_ram_pointer_index_max, RCIN_RINGBUFFERSIZE
+ mov register.rcin_ram_pointer_head, RCIN_RING_HEAD_OFFSET
+ mov register.rcin_ram_pointer_tail, RCIN_RING_TAIL_OFFSET
+ mov register.temp, 0
+ RCIN_WRITE_HEAD register.temp
+ RCIN_WRITE_TAIL register.temp
+
+ // Load balancing
+ mov register.ch_1_next_time, 1000
+ mov register.ch_2_next_time, 2000
+ mov register.ch_3_next_time, 3000
+ mov register.ch_4_next_time, 4000
+ mov register.ch_5_next_time, 5000
+ mov register.ch_6_next_time, 6000
+ mov register.ch_7_next_time, 7000
+ mov register.ch_8_next_time, 8000
+ mov register.ch_9_next_time, 9000
+ mov register.ch_10_next_time, 10000
+ mov register.ch_11_next_time, 11000
+ mov register.ch_12_next_time, 12000
+
+ // Disable all channels
+ mov register.ch_enable, 0x0
+ sbco register.ch_enable, RAM, CH_ENABLE_RAM_OFFSET, 4
+
+ // Initialize empty frames.
+ mov register.temp, 0
+ sbco register.temp, RAM, CH_1_FRAME_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_2_FRAME_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_3_FRAME_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_4_FRAME_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_5_FRAME_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_6_FRAME_RAM_OFFSET, 4
+
+ // Initialize frame offsets (to empty frames)
+ mov register.temp, 0x10
+ sbco register.temp, RAM, CH_1_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_2_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_3_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_4_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_5_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+ sbco register.temp, RAM, CH_6_CURRENT_BIT_POSITION_RAM_OFFSET, 4
+
+ // Stop counter - This is important as the IEP timer appears
+ // to sometimes go into an undefined state if we change other
+ // parts of the control register while it's counting. Needing
+ // a hard reset to resume functioning.
+ lbco register.temp, IEP, IEP_TMR_GLB_CFG, 4
+ mov register.temp1, 0xFFFFFFFE
+ and register.temp, register.temp, register.temp1
+ sbco register.temp, IEP, IEP_TMR_GLB_CFG, 4
+
+ // Initialize counter (1 step = 5ns)
+ mov register.temp, 0x110
+ sbco register.temp, IEP, IEP_TMR_GLB_CFG, 4
+
+ // Reset counter
+ mov register.temp, 0xffffffff
+ sbco register.temp, IEP, IEP_TMR_CNT, 4
+
+ // Start counter
+ lbco register.temp, IEP, IEP_TMR_GLB_CFG, 4
+ or register.temp, register.temp, 1 << IEP_CNT_ENABLE
+ sbco register.temp, IEP, IEP_TMR_GLB_CFG, 4
+.endm
+
+// Without this motors would keep spinning if ardupilot disappeared.
+.macro FAILSAFE_HANDLING
+ sub register.temp, register.next_failsafe, register.time
+ mov register.temp1, 0xF0000000
+ qbgt failsafeend, register.temp, register.temp1
+ mov register.temp, FAILSAFE_PERIOD
+ add register.next_failsafe, register.time, register.temp
+ lbco register.temp, RAM, FAILSAFE_RAM_OFFSET, 4
+ qbbs failsafe_succesful, register.temp.t0
+ sbco register.temp, RAM, CH_ENABLE_RAM_OFFSET, 4
+failsafe_succesful:
+ ldi register.temp, 0
+ sbco register.temp, RAM, FAILSAFE_RAM_OFFSET, 4
+failsafeend:
+.endm
+
+.origin 0
+init:
+ INIT
+ RCIN_ECAP_INIT
+mainloop:
+ FAILSAFE_HANDLING
+
+ lbco register.ch_enable, RAM, CH_ENABLE_RAM_OFFSET, 4
+ lbco register.time, IEP, IEP_TMR_CNT, 4
+
+ RCOUT_DSHOT RC_CH_1_PIN, register.ch_1_next_time, RC_CH_1_ENABLE, CH_1_CURRENT_BIT_POSITION_RAM_OFFSET, CH_1_FRAME_RAM_OFFSET
+ RCOUT_DSHOT RC_CH_2_PIN, register.ch_2_next_time, RC_CH_2_ENABLE, CH_2_CURRENT_BIT_POSITION_RAM_OFFSET, CH_2_FRAME_RAM_OFFSET
+ RCOUT_DSHOT RC_CH_3_PIN, register.ch_3_next_time, RC_CH_3_ENABLE, CH_3_CURRENT_BIT_POSITION_RAM_OFFSET, CH_3_FRAME_RAM_OFFSET
+ RCOUT_DSHOT RC_CH_4_PIN, register.ch_4_next_time, RC_CH_4_ENABLE, CH_4_CURRENT_BIT_POSITION_RAM_OFFSET, CH_4_FRAME_RAM_OFFSET
+ RCOUT_DSHOT RC_CH_5_PIN, register.ch_5_next_time, RC_CH_5_ENABLE, CH_5_CURRENT_BIT_POSITION_RAM_OFFSET, CH_5_FRAME_RAM_OFFSET
+ RCOUT_DSHOT RC_CH_6_PIN, register.ch_6_next_time, RC_CH_6_ENABLE, CH_6_CURRENT_BIT_POSITION_RAM_OFFSET, CH_6_FRAME_RAM_OFFSET
+
+ RCIN_ECAP
+#ifdef DEBUG
+ MAX_CYCLE_TIME
+#endif
+jmp mainloop
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_BBBLUE_bin.h b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_BBBLUE_bin.h
new file mode 100644
index 0000000000..8f0d392189
--- /dev/null
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_BBBLUE_bin.h
@@ -0,0 +1,295 @@
+
+
+/* This file contains the PRU instructions in a C array which are to */
+/* be downloaded from the host CPU to the PRU instruction memory. */
+/* This file is generated by the PRU assembler. */
+
+const unsigned int PRUcodeDShot[] = {
+ 0x240000fe,
+ 0x2effb184,
+ 0x240000fa,
+ 0x8164389a,
+ 0x241004f5,
+ 0x24012cf7,
+ 0x241000f8,
+ 0x241002f9,
+ 0x240000fa,
+ 0xe100189a,
+ 0xe100199a,
+ 0x2403e8e5,
+ 0x2407d0e6,
+ 0x240bb8e7,
+ 0x240fa0e8,
+ 0x241388e9,
+ 0x241770ea,
+ 0x241b58eb,
+ 0x241f40ec,
+ 0x242328ed,
+ 0x242710ee,
+ 0x242af8ef,
+ 0x242ee0f0,
+ 0x240000e4,
+ 0x81003884,
+ 0x240000fa,
+ 0x8108389a,
+ 0x8110389a,
+ 0x8118389a,
+ 0x8120389a,
+ 0x8128389a,
+ 0x8130389a,
+ 0x240010fa,
+ 0x8104389a,
+ 0x810c389a,
+ 0x8114389a,
+ 0x811c389a,
+ 0x8124389a,
+ 0x812c389a,
+ 0x91003a9a,
+ 0x24ffffdb,
+ 0x24fffe9b,
+ 0x10fbfafa,
+ 0x81003a9a,
+ 0x240110fa,
+ 0x81003a9a,
+ 0x24ffffda,
+ 0x24ffff9a,
+ 0x810c3a9a,
+ 0x91003a9a,
+ 0x1301fafa,
+ 0x81003a9a,
+ 0x24010bfa,
+ 0x8128239a,
+ 0x240092fa,
+ 0x812a239a,
+ 0x04f2f1fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa09,
+ 0x240bebda,
+ 0x24c2009a,
+ 0x00faf2f1,
+ 0x9134389a,
+ 0xd100fa02,
+ 0x8100389a,
+ 0x240000fa,
+ 0x8134389a,
+ 0x91003884,
+ 0x910c3a92,
+ 0xc900e422,
+ 0x04f2e5fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e5,
+ 0x24000ffb,
+ 0x9104389a,
+ 0x60fafb17,
+ 0x9108389b,
+ 0xd108fe09,
+ 0x1f08fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e5,
+ 0x21006800,
+ 0x2403e8fa,
+ 0x00faf2e5,
+ 0x21006800,
+ 0x1d08fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e5,
+ 0x0101fafa,
+ 0x8104389a,
+ 0x21006800,
+ 0x24014dfb,
+ 0x00fbf2e5,
+ 0x0101fafa,
+ 0x8104389a,
+ 0x21006800,
+ 0x240000fa,
+ 0x8104389a,
+ 0xc901e422,
+ 0x04f2e6fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e6,
+ 0x24000ffb,
+ 0x910c389a,
+ 0x60fafb17,
+ 0x9110389b,
+ 0xd10afe09,
+ 0x1f0afefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e6,
+ 0x21008a00,
+ 0x2403e8fa,
+ 0x00faf2e6,
+ 0x21008a00,
+ 0x1d0afefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e6,
+ 0x0101fafa,
+ 0x810c389a,
+ 0x21008a00,
+ 0x24014dfb,
+ 0x00fbf2e6,
+ 0x0101fafa,
+ 0x810c389a,
+ 0x21008a00,
+ 0x240000fa,
+ 0x810c389a,
+ 0xc902e422,
+ 0x04f2e7fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e7,
+ 0x24000ffb,
+ 0x9114389a,
+ 0x60fafb17,
+ 0x9118389b,
+ 0xd109fe09,
+ 0x1f09fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e7,
+ 0x2100ac00,
+ 0x2403e8fa,
+ 0x00faf2e7,
+ 0x2100ac00,
+ 0x1d09fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e7,
+ 0x0101fafa,
+ 0x8114389a,
+ 0x2100ac00,
+ 0x24014dfb,
+ 0x00fbf2e7,
+ 0x0101fafa,
+ 0x8114389a,
+ 0x2100ac00,
+ 0x240000fa,
+ 0x8114389a,
+ 0xc903e422,
+ 0x04f2e8fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e8,
+ 0x24000ffb,
+ 0x911c389a,
+ 0x60fafb17,
+ 0x9120389b,
+ 0xd10bfe09,
+ 0x1f0bfefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e8,
+ 0x2100ce00,
+ 0x2403e8fa,
+ 0x00faf2e8,
+ 0x2100ce00,
+ 0x1d0bfefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e8,
+ 0x0101fafa,
+ 0x811c389a,
+ 0x2100ce00,
+ 0x24014dfb,
+ 0x00fbf2e8,
+ 0x0101fafa,
+ 0x811c389a,
+ 0x2100ce00,
+ 0x240000fa,
+ 0x811c389a,
+ 0xc904e422,
+ 0x04f2e9fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e9,
+ 0x24000ffb,
+ 0x9124389a,
+ 0x60fafb17,
+ 0x9128389b,
+ 0xd106fe09,
+ 0x1f06fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e9,
+ 0x2100f000,
+ 0x2403e8fa,
+ 0x00faf2e9,
+ 0x2100f000,
+ 0x1d06fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e9,
+ 0x0101fafa,
+ 0x8124389a,
+ 0x2100f000,
+ 0x24014dfb,
+ 0x00fbf2e9,
+ 0x0101fafa,
+ 0x8124389a,
+ 0x2100f000,
+ 0x240000fa,
+ 0x8124389a,
+ 0xc905e422,
+ 0x04f2eafa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2ea,
+ 0x24000ffb,
+ 0x912c389a,
+ 0x60fafb17,
+ 0x9130389b,
+ 0xd107fe09,
+ 0x1f07fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2ea,
+ 0x21011200,
+ 0x2403e8fa,
+ 0x00faf2ea,
+ 0x21011200,
+ 0x1d07fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2ea,
+ 0x0101fafa,
+ 0x812c389a,
+ 0x21011200,
+ 0x24014dfb,
+ 0x00fbf2ea,
+ 0x0101fafa,
+ 0x812c389a,
+ 0x21011200,
+ 0x240000fa,
+ 0x812c389a,
+ 0x912e239a,
+ 0xc902fa0b,
+ 0x9108639a,
+ 0xe100759a,
+ 0x240006fa,
+ 0x8130239a,
+ 0xe1001996,
+ 0x0101f6f6,
+ 0x0108f5f5,
+ 0x48f6f703,
+ 0x241004f5,
+ 0x240000f6,
+ 0x21003800 };
+
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_BBBMINI_bin.h b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_BBBMINI_bin.h
new file mode 100644
index 0000000000..afe7516f50
--- /dev/null
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_BBBMINI_bin.h
@@ -0,0 +1,295 @@
+
+
+/* This file contains the PRU instructions in a C array which are to */
+/* be downloaded from the host CPU to the PRU instruction memory. */
+/* This file is generated by the PRU assembler. */
+
+const unsigned int PRUcodeDShot[] = {
+ 0x240000fe,
+ 0x2effb184,
+ 0x240000fa,
+ 0x8164389a,
+ 0x241004f5,
+ 0x24012cf7,
+ 0x241000f8,
+ 0x241002f9,
+ 0x240000fa,
+ 0xe100189a,
+ 0xe100199a,
+ 0x2403e8e5,
+ 0x2407d0e6,
+ 0x240bb8e7,
+ 0x240fa0e8,
+ 0x241388e9,
+ 0x241770ea,
+ 0x241b58eb,
+ 0x241f40ec,
+ 0x242328ed,
+ 0x242710ee,
+ 0x242af8ef,
+ 0x242ee0f0,
+ 0x240000e4,
+ 0x81003884,
+ 0x240000fa,
+ 0x8108389a,
+ 0x8110389a,
+ 0x8118389a,
+ 0x8120389a,
+ 0x8128389a,
+ 0x8130389a,
+ 0x240010fa,
+ 0x8104389a,
+ 0x810c389a,
+ 0x8114389a,
+ 0x811c389a,
+ 0x8124389a,
+ 0x812c389a,
+ 0x91003a9a,
+ 0x24ffffdb,
+ 0x24fffe9b,
+ 0x10fbfafa,
+ 0x81003a9a,
+ 0x240110fa,
+ 0x81003a9a,
+ 0x24ffffda,
+ 0x24ffff9a,
+ 0x810c3a9a,
+ 0x91003a9a,
+ 0x1301fafa,
+ 0x81003a9a,
+ 0x24010bfa,
+ 0x8128239a,
+ 0x240092fa,
+ 0x812a239a,
+ 0x04f2f1fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa09,
+ 0x240bebda,
+ 0x24c2009a,
+ 0x00faf2f1,
+ 0x9134389a,
+ 0xd100fa02,
+ 0x8100389a,
+ 0x240000fa,
+ 0x8134389a,
+ 0x91003884,
+ 0x910c3a92,
+ 0xc900e422,
+ 0x04f2e5fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e5,
+ 0x24000ffb,
+ 0x9104389a,
+ 0x60fafb17,
+ 0x9108389b,
+ 0xd10afe09,
+ 0x1f0afefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e5,
+ 0x21006800,
+ 0x2403e8fa,
+ 0x00faf2e5,
+ 0x21006800,
+ 0x1d0afefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e5,
+ 0x0101fafa,
+ 0x8104389a,
+ 0x21006800,
+ 0x24014dfb,
+ 0x00fbf2e5,
+ 0x0101fafa,
+ 0x8104389a,
+ 0x21006800,
+ 0x240000fa,
+ 0x8104389a,
+ 0xc901e422,
+ 0x04f2e6fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e6,
+ 0x24000ffb,
+ 0x910c389a,
+ 0x60fafb17,
+ 0x9110389b,
+ 0xd108fe09,
+ 0x1f08fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e6,
+ 0x21008a00,
+ 0x2403e8fa,
+ 0x00faf2e6,
+ 0x21008a00,
+ 0x1d08fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e6,
+ 0x0101fafa,
+ 0x810c389a,
+ 0x21008a00,
+ 0x24014dfb,
+ 0x00fbf2e6,
+ 0x0101fafa,
+ 0x810c389a,
+ 0x21008a00,
+ 0x240000fa,
+ 0x810c389a,
+ 0xc902e422,
+ 0x04f2e7fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e7,
+ 0x24000ffb,
+ 0x9114389a,
+ 0x60fafb17,
+ 0x9118389b,
+ 0xd10bfe09,
+ 0x1f0bfefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e7,
+ 0x2100ac00,
+ 0x2403e8fa,
+ 0x00faf2e7,
+ 0x2100ac00,
+ 0x1d0bfefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e7,
+ 0x0101fafa,
+ 0x8114389a,
+ 0x2100ac00,
+ 0x24014dfb,
+ 0x00fbf2e7,
+ 0x0101fafa,
+ 0x8114389a,
+ 0x2100ac00,
+ 0x240000fa,
+ 0x8114389a,
+ 0xc903e422,
+ 0x04f2e8fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e8,
+ 0x24000ffb,
+ 0x911c389a,
+ 0x60fafb17,
+ 0x9120389b,
+ 0xd109fe09,
+ 0x1f09fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e8,
+ 0x2100ce00,
+ 0x2403e8fa,
+ 0x00faf2e8,
+ 0x2100ce00,
+ 0x1d09fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e8,
+ 0x0101fafa,
+ 0x811c389a,
+ 0x2100ce00,
+ 0x24014dfb,
+ 0x00fbf2e8,
+ 0x0101fafa,
+ 0x811c389a,
+ 0x2100ce00,
+ 0x240000fa,
+ 0x811c389a,
+ 0xc904e422,
+ 0x04f2e9fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e9,
+ 0x24000ffb,
+ 0x9124389a,
+ 0x60fafb17,
+ 0x9128389b,
+ 0xd107fe09,
+ 0x1f07fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e9,
+ 0x2100f000,
+ 0x2403e8fa,
+ 0x00faf2e9,
+ 0x2100f000,
+ 0x1d07fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e9,
+ 0x0101fafa,
+ 0x8124389a,
+ 0x2100f000,
+ 0x24014dfb,
+ 0x00fbf2e9,
+ 0x0101fafa,
+ 0x8124389a,
+ 0x2100f000,
+ 0x240000fa,
+ 0x8124389a,
+ 0xc905e422,
+ 0x04f2eafa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2ea,
+ 0x24000ffb,
+ 0x912c389a,
+ 0x60fafb17,
+ 0x9130389b,
+ 0xd106fe09,
+ 0x1f06fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2ea,
+ 0x21011200,
+ 0x2403e8fa,
+ 0x00faf2ea,
+ 0x21011200,
+ 0x1d06fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2ea,
+ 0x0101fafa,
+ 0x812c389a,
+ 0x21011200,
+ 0x24014dfb,
+ 0x00fbf2ea,
+ 0x0101fafa,
+ 0x812c389a,
+ 0x21011200,
+ 0x240000fa,
+ 0x812c389a,
+ 0x912e239a,
+ 0xc902fa0b,
+ 0x9108639a,
+ 0xe100759a,
+ 0x240006fa,
+ 0x8130239a,
+ 0xe1001996,
+ 0x0101f6f6,
+ 0x0108f5f5,
+ 0x48f6f703,
+ 0x241004f5,
+ 0x240000f6,
+ 0x21003800 };
+
diff --git a/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_POCKET_bin.h b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_POCKET_bin.h
new file mode 100644
index 0000000000..abd2915fd1
--- /dev/null
+++ b/Tools/Linux_HAL_Essentials/pru/aiopru/RcAioPRUDShot_POCKET_bin.h
@@ -0,0 +1,295 @@
+
+
+/* This file contains the PRU instructions in a C array which are to */
+/* be downloaded from the host CPU to the PRU instruction memory. */
+/* This file is generated by the PRU assembler. */
+
+const unsigned int PRUcodeDShot[] = {
+ 0x240000fe,
+ 0x2effb184,
+ 0x240000fa,
+ 0x8164389a,
+ 0x241004f5,
+ 0x24012cf7,
+ 0x241000f8,
+ 0x241002f9,
+ 0x240000fa,
+ 0xe100189a,
+ 0xe100199a,
+ 0x2403e8e5,
+ 0x2407d0e6,
+ 0x240bb8e7,
+ 0x240fa0e8,
+ 0x241388e9,
+ 0x241770ea,
+ 0x241b58eb,
+ 0x241f40ec,
+ 0x242328ed,
+ 0x242710ee,
+ 0x242af8ef,
+ 0x242ee0f0,
+ 0x240000e4,
+ 0x81003884,
+ 0x240000fa,
+ 0x8108389a,
+ 0x8110389a,
+ 0x8118389a,
+ 0x8120389a,
+ 0x8128389a,
+ 0x8130389a,
+ 0x240010fa,
+ 0x8104389a,
+ 0x810c389a,
+ 0x8114389a,
+ 0x811c389a,
+ 0x8124389a,
+ 0x812c389a,
+ 0x91003a9a,
+ 0x24ffffdb,
+ 0x24fffe9b,
+ 0x10fbfafa,
+ 0x81003a9a,
+ 0x240110fa,
+ 0x81003a9a,
+ 0x24ffffda,
+ 0x24ffff9a,
+ 0x810c3a9a,
+ 0x91003a9a,
+ 0x1301fafa,
+ 0x81003a9a,
+ 0x24010bfa,
+ 0x8128239a,
+ 0x240092fa,
+ 0x812a239a,
+ 0x04f2f1fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa09,
+ 0x240bebda,
+ 0x24c2009a,
+ 0x00faf2f1,
+ 0x9134389a,
+ 0xd100fa02,
+ 0x8100389a,
+ 0x240000fa,
+ 0x8134389a,
+ 0x91003884,
+ 0x910c3a92,
+ 0xc900e422,
+ 0x04f2e5fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e5,
+ 0x24000ffb,
+ 0x9104389a,
+ 0x60fafb17,
+ 0x9108389b,
+ 0xd107fe09,
+ 0x1f07fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e5,
+ 0x21006800,
+ 0x2403e8fa,
+ 0x00faf2e5,
+ 0x21006800,
+ 0x1d07fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e5,
+ 0x0101fafa,
+ 0x8104389a,
+ 0x21006800,
+ 0x24014dfb,
+ 0x00fbf2e5,
+ 0x0101fafa,
+ 0x8104389a,
+ 0x21006800,
+ 0x240000fa,
+ 0x8104389a,
+ 0xc901e422,
+ 0x04f2e6fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e6,
+ 0x24000ffb,
+ 0x910c389a,
+ 0x60fafb17,
+ 0x9110389b,
+ 0xd104fe09,
+ 0x1f04fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e6,
+ 0x21008a00,
+ 0x2403e8fa,
+ 0x00faf2e6,
+ 0x21008a00,
+ 0x1d04fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e6,
+ 0x0101fafa,
+ 0x810c389a,
+ 0x21008a00,
+ 0x24014dfb,
+ 0x00fbf2e6,
+ 0x0101fafa,
+ 0x810c389a,
+ 0x21008a00,
+ 0x240000fa,
+ 0x810c389a,
+ 0xc902e422,
+ 0x04f2e7fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e7,
+ 0x24000ffb,
+ 0x9114389a,
+ 0x60fafb17,
+ 0x9118389b,
+ 0xd101fe09,
+ 0x1f01fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e7,
+ 0x2100ac00,
+ 0x2403e8fa,
+ 0x00faf2e7,
+ 0x2100ac00,
+ 0x1d01fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e7,
+ 0x0101fafa,
+ 0x8114389a,
+ 0x2100ac00,
+ 0x24014dfb,
+ 0x00fbf2e7,
+ 0x0101fafa,
+ 0x8114389a,
+ 0x2100ac00,
+ 0x240000fa,
+ 0x8114389a,
+ 0xc903e422,
+ 0x04f2e8fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e8,
+ 0x24000ffb,
+ 0x911c389a,
+ 0x60fafb17,
+ 0x9120389b,
+ 0xd105fe09,
+ 0x1f05fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e8,
+ 0x2100ce00,
+ 0x2403e8fa,
+ 0x00faf2e8,
+ 0x2100ce00,
+ 0x1d05fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e8,
+ 0x0101fafa,
+ 0x811c389a,
+ 0x2100ce00,
+ 0x24014dfb,
+ 0x00fbf2e8,
+ 0x0101fafa,
+ 0x811c389a,
+ 0x2100ce00,
+ 0x240000fa,
+ 0x811c389a,
+ 0xc904e422,
+ 0x04f2e9fa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2e9,
+ 0x24000ffb,
+ 0x9124389a,
+ 0x60fafb17,
+ 0x9128389b,
+ 0xd102fe09,
+ 0x1f02fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2e9,
+ 0x2100f000,
+ 0x2403e8fa,
+ 0x00faf2e9,
+ 0x2100f000,
+ 0x1d02fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2e9,
+ 0x0101fafa,
+ 0x8124389a,
+ 0x2100f000,
+ 0x24014dfb,
+ 0x00fbf2e9,
+ 0x0101fafa,
+ 0x8124389a,
+ 0x2100f000,
+ 0x240000fa,
+ 0x8124389a,
+ 0xc905e422,
+ 0x04f2eafa,
+ 0x24f000db,
+ 0x2400009b,
+ 0x60fbfa1e,
+ 0x24c350fb,
+ 0x00fbf2ea,
+ 0x24000ffb,
+ 0x912c389a,
+ 0x60fafb17,
+ 0x9130389b,
+ 0xd106fe09,
+ 0x1f06fefe,
+ 0xd0fafb04,
+ 0x2401f4fa,
+ 0x00faf2ea,
+ 0x21011200,
+ 0x2403e8fa,
+ 0x00faf2ea,
+ 0x21011200,
+ 0x1d06fefe,
+ 0xd0fafb06,
+ 0x240341fb,
+ 0x00fbf2ea,
+ 0x0101fafa,
+ 0x812c389a,
+ 0x21011200,
+ 0x24014dfb,
+ 0x00fbf2ea,
+ 0x0101fafa,
+ 0x812c389a,
+ 0x21011200,
+ 0x240000fa,
+ 0x812c389a,
+ 0x912e239a,
+ 0xc902fa0b,
+ 0x9108639a,
+ 0xe100759a,
+ 0x240006fa,
+ 0x8130239a,
+ 0xe1001996,
+ 0x0101f6f6,
+ 0x0108f5f5,
+ 0x48f6f703,
+ 0x241004f5,
+ 0x240000f6,
+ 0x21003800 };
+
@micfogas
Copy link

I know this is a couple years old, but any chance you could update this to the current master branch of ardupilot? there's been some changes, such as corked/uncorked no longer used, slight variations in the addresses for the PRUs. The old values displayed in red are off by 0x0000300 (eg, your patch shows the value to be replaced as 0x21005300 but the current code's value is 0x21005600), but the lines above and below are unchanged. So i don't know whether to replace the current code with your modified value of 0x21005800 or adjust it with +0x00000300 to make the new value 0x21006a00. I know the BBBlue is a bit old now, but it's what I chose to work with, as the Pixhawk boards are pricey. But I didn't realize that PWM is the only officially supported method for ESC telemetry with PX4/Ardupilot. Any help you can offer would be greatly appreciated!

@Bas-moz
Copy link
Author

Bas-moz commented Aug 18, 2023

I know this is a couple years old, but any chance you could update this to the current master branch of ardupilot? there's been some changes, such as corked/uncorked no longer used, slight variations in the addresses for the PRUs. The old values displayed in red are off by 0x0000300 (eg, your patch shows the value to be replaced as 0x21005300 but the current code's value is 0x21005600), but the lines above and below are unchanged. So i don't know whether to replace the current code with your modified value of 0x21005800 or adjust it with +0x00000300 to make the new value 0x21006a00. I know the BBBlue is a bit old now, but it's what I chose to work with, as the Pixhawk boards are pricey. But I didn't realize that PWM is the only officially supported method for ESC telemetry with PX4/Ardupilot. Any help you can offer would be greatly appreciated!

Sorry for missing this, and this answer probably came too late, but I only saw this now and I'm afraid I no longer have a functioning BBBlue :-(.

Fwiw those compiled header files should be generated by a compiler, so you may just be able to recompile the underlying files and get working output.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment