OSDN Git Service

BSL: FTDI set_bit_mode changed
authorPawel Jewstafjew <Pawel.Jewstafjew@gmail.com>
Sat, 11 Mar 2017 21:20:28 +0000 (21:20 +0000)
committerPawel Jewstafjew <Pawel.Jewstafjew@gmail.com>
Sat, 11 Mar 2017 21:20:28 +0000 (21:20 +0000)
BSL/BSL_1.cc
BSL/BSL_IO_FTDI.h
BSL/BSL_image.cc

index 379b24d..d9e444c 100644 (file)
@@ -450,8 +450,10 @@ bool BSL::open(const uint8_t password[PASSWORD_LEN], unsigned attempts, bool cha
 
    for(unsigned i=0; i<attempts; ++i) {
       // enter bootloader
-      if (!start())
+      if (!start()) {
+        log.printf("BSL open: start error\n");
          return false;
+      }
 
       if (check_com()) {
         ok = true;
index e5754d6..f3d0b54 100644 (file)
@@ -99,7 +99,7 @@ public:
       bitbang_enabled = true;
       // ftdi.set_bit_mode(0x20, FT_BITMODE_CBUS_BITBANG); // RSTn = 0
       // ftdi.set_bit_mode(0x22, FT_BITMODE_CBUS_BITBANG); // RSTn = 1
-      return ftdi.set_bit_mode((v ? 0x22 : 0x20), FT_BITMODE_CBUS_BITBANG) == FT_OK;
+      return ftdi.set_bit_mode((v ? 0x22 : 0x20), FT_BITMODE_CBUS_BITBANG);
    }
    bool set_test(bool v) override {
       // TCK = not TEST -> RTS = TEST
index 2db8d1e..d987229 100644 (file)
@@ -79,6 +79,7 @@ bool BSL_image(Logger & log, FTDI & ftdi, bool force_erase)
 //   log.set_level(0xF); // no DEBUG
    // password = 0; // no password -> force erase
    if (!bsl.open(password)) { // password: vector table
+      log.printf("BSL open error\n");
       bsl.exit();
       return false;
    }