(theoretically) got encoders working
Everything up to sending all 8 encoder values should work now (including
the packet format + header information, bootloader (fixed some bugs in
the UART code for that), etc).
diff --git a/bbb_cape/src/cape/bootloader.c b/bbb_cape/src/cape/bootloader.c
index fe2f6be..1ed6218 100644
--- a/bbb_cape/src/cape/bootloader.c
+++ b/bbb_cape/src/cape/bootloader.c
@@ -1,5 +1,7 @@
#include <stdint.h>
+#include <STM32F2XX.h>
+
#include "cape/bootloader_handoff.h"
// Sets everything up and then jumps to the main code.
@@ -14,5 +16,11 @@
}
void _start(void) {
+ SYSCFG->CMPCR = SYSCFG_CMPCR_CMP_PD; // enable IO compensation cell
+ while (!(SYSCFG->CMPCR & SYSCFG_CMPCR_READY)) {} // wait for it to be ready
+
+ // We don't have anything on the 1 port D pin, so don't bother enabling it.
+ RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN | RCC_AHB1ENR_GPIOBEN | RCC_AHB1ENR_GPIOCEN;
+
jump_to_main();
}