Removed references to robotis bootloader, and also redundant usb reset code that used the wdt (possibly used by the robotis bootloader)
This commit is contained in:
parent
bc340be66a
commit
4ec1b0f0cd
|
@ -263,20 +263,12 @@ static void ifaceSetupHook(unsigned hook __attribute__((unused)), void *requestv
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#if false
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
uint8 dtr = usb_cdcacm_get_dtr();
|
|
||||||
uint8 rts = usb_cdcacm_get_rts();
|
|
||||||
|
|
||||||
if (rts && !dtr) {
|
|
||||||
reset_state = DTR_NEGEDGE;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((usb_cdcacm_get_baud() == 1200) && (reset_state == DTR_NEGEDGE)) {
|
if ((usb_cdcacm_get_baud() == 1200) && (reset_state == DTR_NEGEDGE)) {
|
||||||
iwdg_init(IWDG_PRE_4, 10);
|
iwdg_init(IWDG_PRE_4, 10);
|
||||||
while (1);
|
while (1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#define RESET_DELAY 100000
|
#define RESET_DELAY 100000
|
||||||
|
@ -287,39 +279,33 @@ static void wait_reset(void) {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define STACK_TOP 0x20000800
|
#define STACK_TOP 0x20000800
|
||||||
#define EXC_RETURN 0xFFFFFFF9
|
#define EXC_RETURN 0xFFFFFFF9
|
||||||
#define DEFAULT_CPSR 0x61000000
|
#define DEFAULT_CPSR 0x61000000
|
||||||
static void rxHook(unsigned hook __attribute__((unused)), void *ignored __attribute__((unused))) {
|
static void rxHook(unsigned hook __attribute__((unused)), void *ignored __attribute__((unused))) {
|
||||||
|
static const uint8 magic[4] = {'1', 'E', 'A', 'F'};
|
||||||
/* FIXME this is mad buggy; we need a new reset sequence. E.g. NAK
|
/* FIXME this is mad buggy; we need a new reset sequence. E.g. NAK
|
||||||
* after each RX means you can't reset if any bytes are waiting. */
|
* after each RX means you can't reset if any bytes are waiting. */
|
||||||
if (reset_state == DTR_NEGEDGE) {
|
if (reset_state == DTR_NEGEDGE) {
|
||||||
reset_state = DTR_LOW;
|
|
||||||
|
|
||||||
if (usb_cdcacm_data_available() >= 4) {
|
|
||||||
// The magic reset sequence is "1EAF".
|
|
||||||
#ifdef SERIAL_USB
|
|
||||||
static const uint8 magic[4] = {'1', 'E', 'A', 'F'};
|
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
static const uint8 magic[4] = {'C', 'M', '9', 'X'};
|
|
||||||
#else
|
|
||||||
static const uint8 magic[4] = {'1', 'E', 'A', 'F'};
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
if (usb_cdcacm_data_available() >= 4)
|
||||||
|
{
|
||||||
uint8 chkBuf[4];
|
uint8 chkBuf[4];
|
||||||
|
|
||||||
// Peek at the waiting bytes, looking for reset sequence,
|
// Peek at the waiting bytes, looking for reset sequence,
|
||||||
// bailing on mismatch.
|
// bailing on mismatch.
|
||||||
usb_cdcacm_peek_ex(chkBuf, usb_cdcacm_data_available() - 4, 4);
|
usb_cdcacm_peek_ex(chkBuf, usb_cdcacm_data_available() - 4, 4);
|
||||||
for (unsigned i = 0; i < sizeof(magic); i++) {
|
for (unsigned i = 0; i < sizeof(magic); i++) {
|
||||||
if (chkBuf[i] != magic[i]) {
|
if (chkBuf[i] != magic[i])
|
||||||
|
{
|
||||||
|
reset_state = DTR_LOW;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef SERIAL_USB
|
#ifdef SERIAL_USB
|
||||||
|
// The magic reset sequence is "1EAF".
|
||||||
// Got the magic sequence -> reset, presumably into the bootloader.
|
// Got the magic sequence -> reset, presumably into the bootloader.
|
||||||
// Return address is wait_reset, but we must set the thumb bit.
|
// Return address is wait_reset, but we must set the thumb bit.
|
||||||
bkp_init();
|
bkp_init();
|
||||||
|
@ -350,15 +336,9 @@ static void rxHook(unsigned hook __attribute__((unused)), void *ignored __attrib
|
||||||
[cpsr] "r" (DEFAULT_CPSR)
|
[cpsr] "r" (DEFAULT_CPSR)
|
||||||
: "r0", "r1", "r2");
|
: "r0", "r1", "r2");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
iwdg_init(IWDG_PRE_4, 10);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Can't happen. */
|
/* Can't happen. */
|
||||||
ASSERT_FAULT(0);
|
ASSERT_FAULT(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // BOARD_HAVE_SERIALUSB
|
#endif // BOARD_HAVE_SERIALUSB
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -152,13 +152,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -152,13 +152,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -146,13 +146,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
|
@ -148,13 +148,9 @@ static void setup_clocks(void) {
|
||||||
*/
|
*/
|
||||||
#if defined(BOOTLOADER_maple)
|
#if defined(BOOTLOADER_maple)
|
||||||
#define USER_ADDR_ROM 0x08005000
|
#define USER_ADDR_ROM 0x08005000
|
||||||
#else
|
|
||||||
#if defined(BOOTLOADER_robotis)
|
|
||||||
#define USER_ADDR_ROM 0x08003000
|
|
||||||
#else
|
#else
|
||||||
#define USER_ADDR_ROM 0x08000000
|
#define USER_ADDR_ROM 0x08000000
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
#define USER_ADDR_RAM 0x20000C00
|
#define USER_ADDR_RAM 0x20000C00
|
||||||
extern char __text_start__;
|
extern char __text_start__;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue