Merge branch 'devel' of github.com:madcowswe/ODrive into sam_python_fixes

This commit is contained in:
Samuel Sadok
2018-03-17 22:23:57 -07:00
5 changed files with 19 additions and 7 deletions
+1 -1
View File
@@ -145,7 +145,7 @@ SECTIONS
. = ALIGN(4);
_eccmram = .; /* create a global symbol at ccmram end */
} >CCMRAM AT> FLASH
} >CCMRAM /*AT> FLASH*/
/* Uninitialized data section */
+8
View File
@@ -108,6 +108,14 @@ int main(void)
jump_to_builtin_bootloader();
}
/* The bootloader might fail to properly clean up after itself,
so if we're not sure that the system is in a clean state we
just reset it again */
if(*((unsigned long *)0x2001C000) != 42) {
*((unsigned long *)0x2001C000) = 42;
NVIC_SystemReset();
}
// This procedure of building a USB serial number should be identical
// to the way the STM's built-in USB bootloader does it. This means
// that the device will have the same serial number in normal and DFU mode.
+1
View File
@@ -4,6 +4,7 @@ Please add a note of your changes below this heading if you make a Pull Request.
### Added
* **Storing of configuration parameters to Non Volatile Memory**
* **USB Bootloader**
* `make erase_config` to erase the configuration with an STLink (the configuration can also be erased from within explore_odrive.py, using `my_odrive.erase_configuration()`)
### Changed
* The build is now configured using the `tup.config` file instead of editing source files. Make sure you set your board version correctly. See [here](README.md#configuring-the-build) for details.
+5 -1
View File
@@ -24,8 +24,12 @@ bmp: all
--ex 'attach 1' \
--ex 'load' $(FIRMWARE)
# Erase all configuration from the ODrive
erase_config:
openocd -f interface/stlink-v2.cfg -f target/stm32f4x.cfg -c init -c reset\ halt -c flash\ erase_address\ 0x80C0000\ 0x40000 -c reset\ run -c exit
clean:
-rm -fR .dep $(BUILD_DIR)
.PHONY: all flash gdb dfu bmp clean
.PHONY: all flash gdb dfu bmp clean erase_config
+4 -5
View File
@@ -37,7 +37,7 @@ class DfuDevice:
self.intf.set_altsetting()
def control_msg(self, requestType, request, value, buffer, timeout=None):
return self.dev.ctrl_transfer(requestType, request, value, self.intf.bInterfaceNumber, buffer, timeout=1500)
return self.dev.ctrl_transfer(requestType, request, value, self.intf.bInterfaceNumber, buffer, timeout=timeout)
def detach(self, timeout):
return self.control_msg(DFU_REQUEST_SEND, DFU_DETACH, timeout, None)
@@ -83,12 +83,11 @@ class DfuDevice:
status = self.get_status()
while (status[1] in states):
timeout = status[2]
if not timeout is None:
timeout = max(timeout, status[2])
claimed_timeout = status[2]
actual_timeout = int(max(timeout or 0, claimed_timeout))
#print("timeout = %f, claimed = %f" % (timeout, status[2]))
#time.sleep(timeout)
status = self.get_status(timeout=timeout)
status = self.get_status(timeout=actual_timeout)
return status