made it actually work on real hardware
diff --git a/bbb_cape/src/flasher/flasher.gyp b/bbb_cape/src/flasher/flasher.gyp
index dea4e5c..2d506b8 100644
--- a/bbb_cape/src/flasher/flasher.gyp
+++ b/bbb_cape/src/flasher/flasher.gyp
@@ -16,6 +16,8 @@
'dependencies': [
'<(EXTERNALS):stm32flash',
'<(AOS)/build/aos.gyp:logging',
+ '<(DEPTH)/bbb_cape/src/bbb/bbb.gyp:gpios',
+ '<(AOS)/common/common.gyp:time',
],
},
],
diff --git a/bbb_cape/src/flasher/stm32_flasher.cc b/bbb_cape/src/flasher/stm32_flasher.cc
index ddddb1b..0f081f5 100644
--- a/bbb_cape/src/flasher/stm32_flasher.cc
+++ b/bbb_cape/src/flasher/stm32_flasher.cc
@@ -8,6 +8,7 @@
#include "aos/common/logging/logging.h"
#include "aos/common/logging/logging_impl.h"
+#include "aos/common/time.h"
extern "C" {
#include "stm32flash/parsers/parser.h"
@@ -17,11 +18,26 @@
#include "stm32flash/init.h"
}
+#include "bbb/gpo.h"
+
int main(int argc, char **argv) {
::aos::logging::Init();
::aos::logging::AddImplementation(
new ::aos::logging::StreamLogImplementation(stdout));
+ {
+ ::bbb::Gpo reset(2, 5, true);
+ ::bbb::Gpo bootloader(2, 2, false);
+ static constexpr ::aos::time::Time kWaitTime =
+ ::aos::time::Time::InSeconds(0.1);
+ reset.Set(false);
+ ::aos::time::SleepFor(kWaitTime);
+ bootloader.Set(false);
+ ::aos::time::SleepFor(kWaitTime);
+ reset.Set(true);
+ ::aos::time::SleepFor(kWaitTime);
+ }
+
if (argc < 2) {
fputs("Need an argument saying which target to download.\n", stderr);
return 1;