From aec4351bd5d81089e10e50b1eb9d8c95e6f44d83 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Mon, 29 Jan 2024 01:43:39 +0200 Subject: [PATCH 01/20] update requirements --- docs/doc-requirements.txt | 5 +++++ docs/requirements.txt | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 docs/doc-requirements.txt diff --git a/docs/doc-requirements.txt b/docs/doc-requirements.txt new file mode 100644 index 00000000..1578530a --- /dev/null +++ b/docs/doc-requirements.txt @@ -0,0 +1,5 @@ +sphinx>=5.2.3 +sphinxcontrib-programoutput +sphinx-inline-tabs +sphinx-copybutton +furo \ No newline at end of file diff --git a/docs/requirements.txt b/docs/requirements.txt index 621e2aad..1578530a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1 +1,5 @@ -sphinx>=3.2.1 +sphinx>=5.2.3 +sphinxcontrib-programoutput +sphinx-inline-tabs +sphinx-copybutton +furo \ No newline at end of file From d34f55ad7ee8aa0c887de04b2575659ce747ade7 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Mon, 29 Jan 2024 01:43:49 +0200 Subject: [PATCH 02/20] update theme selection --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 318433df..0496d220 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -45,7 +45,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'alabaster' +html_theme = 'furo' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, From cd29656837879fc4690ddd4286bba913f8812899 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Mon, 29 Jan 2024 01:54:19 +0200 Subject: [PATCH 03/20] remove unneeded requirements file --- docs/doc-requirements.txt | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 docs/doc-requirements.txt diff --git a/docs/doc-requirements.txt b/docs/doc-requirements.txt deleted file mode 100644 index 1578530a..00000000 --- a/docs/doc-requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -sphinx>=5.2.3 -sphinxcontrib-programoutput -sphinx-inline-tabs -sphinx-copybutton -furo \ No newline at end of file From 3574784eaa6e3a40061da9e9e68c1ed646021515 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Mon, 29 Jan 2024 01:54:36 +0200 Subject: [PATCH 04/20] specify requirements file --- .readthedocs.yaml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index d9ee7902..e1d9d310 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -17,6 +17,8 @@ sphinx: # We recommend specifying your dependencies to enable reproducible builds: # https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html -# python: -# install: -# - requirements: docs/requirements.txt \ No newline at end of file +python: + install: + - requirements: docs/requirements.txt + - method: pip + path: . \ No newline at end of file From 0205e145db31e8ba2b5e14a996d38945c2c14320 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Mon, 29 Jan 2024 02:13:34 +0200 Subject: [PATCH 05/20] fix indent --- .readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index e1d9d310..eb3b6cb1 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -21,4 +21,4 @@ python: install: - requirements: docs/requirements.txt - method: pip - path: . \ No newline at end of file + path: . \ No newline at end of file From 6e60c321ec51b1eee27e6e0dc2c8f6625b78a906 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Mon, 29 Jan 2024 02:16:52 +0200 Subject: [PATCH 06/20] remove path --- .readthedocs.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index eb3b6cb1..22d0c4fe 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -20,5 +20,4 @@ sphinx: python: install: - requirements: docs/requirements.txt - - method: pip - path: . \ No newline at end of file + - method: pip \ No newline at end of file From 6675f3f53cf01d46299bf7708725aa982fda9a68 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Mon, 29 Jan 2024 02:18:19 +0200 Subject: [PATCH 07/20] remove pip --- .readthedocs.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 22d0c4fe..9712e405 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -20,4 +20,3 @@ sphinx: python: install: - requirements: docs/requirements.txt - - method: pip \ No newline at end of file From 5c3d76c84cd79b92dbbfebddff2689ef94b632bf Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Thu, 15 Feb 2024 20:47:59 +0200 Subject: [PATCH 08/20] inline functions --- firmware/src/can/can_func.c | 253 +--------------------------------- firmware/src/can/can_func.h | 268 ++++++++++++++++++++++++++++++++++-- 2 files changed, 257 insertions(+), 264 deletions(-) diff --git a/firmware/src/can/can_func.c b/firmware/src/can/can_func.c index 05265c80..e279722f 100644 --- a/firmware/src/can/can_func.c +++ b/firmware/src/can/can_func.c @@ -22,7 +22,7 @@ uint8_t data_length; uint32_t rx_id; bool rtr; uint32_t can_ep_id; -uint32_t can_seq_id; +uint32_t can_frame_hash; // * The function "can_io_config" is part of the Tinymovr-Firmware distribution // * (https://github.com/yconst/tinymovr-firmware). @@ -169,256 +169,5 @@ void can_baud(CAN_BAUD_TYPE baud) } } -TM_RAMFUNC void can_process_standard(void) -{ - uint32_t buffer = PAC55XX_CAN->RXBUF; // read RX buffer, RX buffer bit order same as TX buffer - - data_length = buffer & 0x0F; - rx_id = ((buffer & 0xE00000) >> 21) | ((buffer & 0xFF00) >> 5); - - can_ep_id = rx_id & 0x3F; - rtr = ((buffer >> 6) & 0x1) == 0x1; - rx_data[0] = buffer >> 24; // data0 - if (data_length > 1u) - { - buffer = PAC55XX_CAN->RXBUF; // buffer contains data1..data4 - rx_data[1] = buffer; - rx_data[2] = buffer >> 8; - rx_data[3] = buffer >> 16; - rx_data[4] = buffer >> 24; - if (data_length > 5u) - { - buffer = PAC55XX_CAN->RXBUF; // buffer contains data7..data5 - rx_data[5] = buffer; - rx_data[6] = buffer >> 8; - rx_data[7] = buffer >> 16; - } - } -} - -// * The function "can_process_extended" is part of the Tinymovr-Firmware distribution -// * (https://github.com/yconst/tinymovr-firmware). -// * Copyright (c) 2022 Ioannis Chatzikonstantinou. -// * -// * This program is free software: you can redistribute it and/or modify -// * it under the terms of the GNU General Public License as published by -// * the Free Software Foundation, version 3. -// * -// * This program is distributed in the hope that it will be useful, but -// * WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// * General Public License for more details. -// * -// * You should have received a copy of the GNU General Public License -// * along with this program. If not, see . - -TM_RAMFUNC void can_process_extended(void) -{ - uint32_t buffer = PAC55XX_CAN->RXBUF; // read RX buffer, RX buffer bit order same as TX buffer - - data_length = buffer & 0x0F; - rtr = ((buffer >> 6) & 0x1) == 0x1; - rx_id = ((buffer & 0xFF000000) >> 19) | ((buffer & 0x00FF0000) >> 3) | ((buffer & 0x0000FF00) << 13); - - buffer = PAC55XX_CAN->RXBUF; - - rx_id |= (buffer & 0xFF) >> 3; - - ids_from_arbitration(rx_id, &can_ep_id, &can_seq_id); - - rx_data[0] = (buffer >> 8) & 0xFF; // data0 - rx_data[1] = (buffer >> 16) & 0xFF; // data1 - rx_data[2] = (buffer >> 24) & 0xFF; // data2 - if (data_length > 3u) - { - buffer = PAC55XX_CAN->RXBUF; // buffer contains data3..data6 - rx_data[3] = buffer & 0xFF; - rx_data[4] = (buffer >> 8) & 0xFF; - rx_data[5] = (buffer >> 16) & 0xFF; - rx_data[6] = (buffer >> 24) & 0xFF; - if (data_length > 7u) - { - buffer = PAC55XX_CAN->RXBUF; // buffer contains data7 - rx_data[7] = buffer & 0xFF; - } - } -} - -TM_RAMFUNC void can_transmit_standard(uint8_t dataLen, uint16_t id, const uint8_t * data) -{ - while (PAC55XX_CAN->SR.TBS == 0) {}; // wait for TX buffer free - PAC55XX_CAN->TXBUF = (dataLen << 0) | // DLC - Data Length Code - (0u << 6) | // RTR = 0 Data Frame - (0u << 7) | // FF - Format Frame; 0=Std Frame - ((id>>3 & 0xFF) << 8) | // ID 10:3 - ((id&0x07u) << 21) | // ID 2:0 - (data[0] << 24); // Data 0 - - if (dataLen > 1u) - { - PAC55XX_CAN->TXBUF = (data[1] << 0) | // Data 1 - (data[2] << 8) | // Data 2 - (data[3] << 16) | // Data 3 - (data[4] << 24); // Data 4 - } - if (dataLen > 5u) - { - PAC55XX_CAN->TXBUF = (data[5] << 0) | // Data 5 - (data[6] << 8) | // Data 6 - (data[7] << 16); // Data 7 - - } - - PAC55XX_CAN->CMR.TR = 1; // Request transmit -} - -// * The function "can_transmit_extended" is part of the Tinymovr-Firmware distribution -// * (https://github.com/yconst/tinymovr-firmware). -// * Copyright (c) 2022 Ioannis Chatzikonstantinou. -// * -// * This program is free software: you can redistribute it and/or modify -// * it under the terms of the GNU General Public License as published by -// * the Free Software Foundation, version 3. -// * -// * This program is distributed in the hope that it will be useful, but -// * WITHOUT ANY WARRANTY; without even the implied warranty of -// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// * General Public License for more details. -// * -// * You should have received a copy of the GNU General Public License -// * along with this program. If not, see . - -TM_RAMFUNC void can_transmit_extended(uint8_t dataLen, uint32_t id, const uint8_t * data) -{ - while (PAC55XX_CAN->SR.TBS == 0) {}; // wait for TX buffer free - PAC55XX_CAN->TXBUF = (dataLen << 0) | // DLC - Data Length Code - (0u << 6) | // RTR = 0 Data Frame - (1u << 7) | // FF - Format Frame; 1=Ext Frame - ((id&0x1FE00000u) >> (21-8)) | - ((id&0x001FE000u) << (16-13)) | - ((id&0x00001FE0u) << (24-5)); - - PAC55XX_CAN->TXBUF = ((id & 0x1F) << 3) | - ((data[0] & 0xFF) << 8) | - ((data[1] & 0xFF) << 16) | - ((data[2] & 0xFF) << 24); - - if (dataLen > 3u) - { - PAC55XX_CAN->TXBUF = ((data[3] & 0xFF) << 0) | // Data 3 - ((data[4] & 0xFF) << 8) | // Data 4 - ((data[5] & 0xFF) << 16) | // Data 5 - ((data[6] & 0xFF) << 24); // Data 6 - } - if (dataLen > 7u) - { - PAC55XX_CAN->TXBUF = ((data[7] & 0xFF) << 0); // Data 7 - } - PAC55XX_CAN->CMR.TR = 1; // Request transmit -} - -uint16_t CAN_BaudTypeToInt(CAN_BAUD_TYPE type) -{ - uint16_t ret = 0u; - switch(type) - { - case CAN_BAUD_50KHz: - ret = 50u; - break; - - case CAN_BAUD_100KHz: - ret = 100u; - break; - - case CAN_BAUD_125KHz: - ret = 125u; - break; - - case CAN_BAUD_200KHz: - ret = 200u; - break; - - case CAN_BAUD_250KHz: - ret = 250u; - break; - - case CAN_BAUD_400KHz: - ret = 400u; - break; - - case CAN_BAUD_500KHz: - ret = 500u; - break; - - case CAN_BAUD_800KHz: - ret = 800u; - break; - - case CAN_BAUD_1000KHz: - ret = 1000u; - break; - - default: - // ret already set - break; - } - return ret; -} -CAN_BAUD_TYPE CAN_IntToBaudType(uint16_t baud) -{ - CAN_BAUD_TYPE ret = CAN_BAUD_250KHz; - switch(baud) - { - case 50u: - ret = CAN_BAUD_50KHz; - break; - - case 100u: - ret = CAN_BAUD_100KHz; - break; - - case 125u: - ret = CAN_BAUD_125KHz; - break; - - case 200u: - ret = CAN_BAUD_200KHz; - break; - - // 250 handled in default - - case 400u: - ret = CAN_BAUD_400KHz; - break; - - case 500u: - ret = CAN_BAUD_500KHz; - break; - - case 800u: - ret = CAN_BAUD_800KHz; - break; - - case 1000u: - ret = CAN_BAUD_1000KHz; - break; - - default: - // ret already set - break; - } - return ret; -} - -inline void ids_from_arbitration(uint32_t arb_id, uint32_t* ep_id, uint32_t* seq_id) -{ - *ep_id = arb_id & CAN_EP_MASK; - *seq_id = (arb_id & CAN_SEQ_MASK) >> CAN_EP_SIZE; -} - -inline void arbitration_from_ids(uint32_t* arb_id, uint32_t ep_id, uint32_t seq_id, uint32_t node_id) -{ - *arb_id = (ep_id & CAN_EP_MASK) | ((seq_id << CAN_EP_SIZE) & CAN_SEQ_MASK) | ((node_id << (CAN_EP_SIZE + CAN_SEQ_SIZE)) & CAN_DEV_MASK); -} diff --git a/firmware/src/can/can_func.h b/firmware/src/can/can_func.h index 597080ba..5637ee3c 100644 --- a/firmware/src/can/can_func.h +++ b/firmware/src/can/can_func.h @@ -20,10 +20,10 @@ #define CAN_EP_SIZE 12 #define CAN_EP_MASK ((1 << CAN_EP_SIZE) - 1) -#define CAN_SEQ_SIZE 9 -#define CAN_SEQ_MASK (((1 << CAN_SEQ_SIZE) - 1) << CAN_EP_SIZE) +#define CAN_HASH_SIZE 9 +#define CAN_HASH_MASK (((1 << CAN_HASH_SIZE) - 1) << CAN_EP_SIZE) #define CAN_DEV_SIZE 8 -#define CAN_DEV_MASK (((1 << CAN_DEV_SIZE) - 1) << (CAN_EP_SIZE + CAN_SEQ_SIZE)) +#define CAN_DEV_MASK (((1 << CAN_DEV_SIZE) - 1) << (CAN_EP_SIZE + CAN_HASH_SIZE)) // #define CAN_SJW_1tq ((uint8_t)0x00) /*!< 1 time quantum */ // #define CAN_SJW_2tq ((uint8_t)0x01) /*!< 2 time quantum */ @@ -77,17 +77,261 @@ extern uint8_t data_length; extern uint32_t rx_id; extern bool rtr; extern uint32_t can_ep_id; -extern uint32_t can_seq_id; +extern uint32_t can_frame_hash; void can_baud(CAN_BAUD_TYPE baud); void can_io_config(void); -void can_process_standard(void); -void can_process_extended(void); -void can_transmit_standard(uint8_t dataLen, uint16_t id, const uint8_t * data); -void can_transmit_extended(uint8_t dataLen, uint32_t id, const uint8_t * data); -uint16_t CAN_BaudTypeToInt(CAN_BAUD_TYPE type); -CAN_BAUD_TYPE CAN_IntToBaudType(uint16_t baud); +static inline void ids_from_arbitration(uint32_t arb_id, uint32_t* ep_id, uint32_t* hash) +{ + *ep_id = arb_id & CAN_EP_MASK; + *hash = (arb_id & CAN_HASH_MASK) >> CAN_EP_SIZE; +} + +static inline void arbitration_from_ids(uint32_t* arb_id, uint32_t ep_id, uint32_t hash, uint32_t node_id) +{ + *arb_id = (ep_id & CAN_EP_MASK) | ((hash << CAN_EP_SIZE) & CAN_HASH_MASK) | ((node_id << (CAN_EP_SIZE + CAN_HASH_SIZE)) & CAN_DEV_MASK); +} + +static inline void can_process_standard(void) +{ + uint32_t buffer = PAC55XX_CAN->RXBUF; // read RX buffer, RX buffer bit order same as TX buffer + + data_length = buffer & 0x0F; + rx_id = ((buffer & 0xE00000) >> 21) | ((buffer & 0xFF00) >> 5); + + can_ep_id = rx_id & 0x3F; + rtr = ((buffer >> 6) & 0x1) == 0x1; + rx_data[0] = buffer >> 24; // data0 + if (data_length > 1u) + { + buffer = PAC55XX_CAN->RXBUF; // buffer contains data1..data4 + rx_data[1] = buffer; + rx_data[2] = buffer >> 8; + rx_data[3] = buffer >> 16; + rx_data[4] = buffer >> 24; + if (data_length > 5u) + { + buffer = PAC55XX_CAN->RXBUF; // buffer contains data7..data5 + rx_data[5] = buffer; + rx_data[6] = buffer >> 8; + rx_data[7] = buffer >> 16; + } + } +} + +// * The function "can_process_extended" is part of the Tinymovr-Firmware distribution +// * (https://github.com/yconst/tinymovr-firmware). +// * Copyright (c) 2022 Ioannis Chatzikonstantinou. +// * +// * This program is free software: you can redistribute it and/or modify +// * it under the terms of the GNU General Public License as published by +// * the Free Software Foundation, version 3. +// * +// * This program is distributed in the hope that it will be useful, but +// * WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// * General Public License for more details. +// * +// * You should have received a copy of the GNU General Public License +// * along with this program. If not, see . + +static inline void can_process_extended(void) +{ + uint32_t buffer = PAC55XX_CAN->RXBUF; // read RX buffer, RX buffer bit order same as TX buffer + + data_length = buffer & 0x0F; + rtr = ((buffer >> 6) & 0x1) == 0x1; + rx_id = ((buffer & 0xFF000000) >> 19) | ((buffer & 0x00FF0000) >> 3) | ((buffer & 0x0000FF00) << 13); + + buffer = PAC55XX_CAN->RXBUF; + + rx_id |= (buffer & 0xFF) >> 3; + + ids_from_arbitration(rx_id, &can_ep_id, &can_frame_hash); + + rx_data[0] = (buffer >> 8) & 0xFF; // data0 + rx_data[1] = (buffer >> 16) & 0xFF; // data1 + rx_data[2] = (buffer >> 24) & 0xFF; // data2 + if (data_length > 3u) + { + buffer = PAC55XX_CAN->RXBUF; // buffer contains data3..data6 + rx_data[3] = buffer & 0xFF; + rx_data[4] = (buffer >> 8) & 0xFF; + rx_data[5] = (buffer >> 16) & 0xFF; + rx_data[6] = (buffer >> 24) & 0xFF; + if (data_length > 7u) + { + buffer = PAC55XX_CAN->RXBUF; // buffer contains data7 + rx_data[7] = buffer & 0xFF; + } + } +} + +static inline void can_transmit_standard(uint8_t dataLen, uint16_t id, const uint8_t * data) +{ + while (PAC55XX_CAN->SR.TBS == 0) {}; // wait for TX buffer free + PAC55XX_CAN->TXBUF = (dataLen << 0) | // DLC - Data Length Code + (0u << 6) | // RTR = 0 Data Frame + (0u << 7) | // FF - Format Frame; 0=Std Frame + ((id>>3 & 0xFF) << 8) | // ID 10:3 + ((id&0x07u) << 21) | // ID 2:0 + (data[0] << 24); // Data 0 + + if (dataLen > 1u) + { + PAC55XX_CAN->TXBUF = (data[1] << 0) | // Data 1 + (data[2] << 8) | // Data 2 + (data[3] << 16) | // Data 3 + (data[4] << 24); // Data 4 + } + if (dataLen > 5u) + { + PAC55XX_CAN->TXBUF = (data[5] << 0) | // Data 5 + (data[6] << 8) | // Data 6 + (data[7] << 16); // Data 7 + + } + + PAC55XX_CAN->CMR.TR = 1; // Request transmit +} + +// * The function "can_transmit_extended" is part of the Tinymovr-Firmware distribution +// * (https://github.com/yconst/tinymovr-firmware). +// * Copyright (c) 2022 Ioannis Chatzikonstantinou. +// * +// * This program is free software: you can redistribute it and/or modify +// * it under the terms of the GNU General Public License as published by +// * the Free Software Foundation, version 3. +// * +// * This program is distributed in the hope that it will be useful, but +// * WITHOUT ANY WARRANTY; without even the implied warranty of +// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// * General Public License for more details. +// * +// * You should have received a copy of the GNU General Public License +// * along with this program. If not, see . + +static inline void can_transmit_extended(uint8_t dataLen, uint32_t id, const uint8_t * data) +{ + while (PAC55XX_CAN->SR.TBS == 0) {}; // wait for TX buffer free + PAC55XX_CAN->TXBUF = (dataLen << 0) | // DLC - Data Length Code + (0u << 6) | // RTR = 0 Data Frame + (1u << 7) | // FF - Format Frame; 1=Ext Frame + ((id&0x1FE00000u) >> (21-8)) | + ((id&0x001FE000u) << (16-13)) | + ((id&0x00001FE0u) << (24-5)); + + PAC55XX_CAN->TXBUF = ((id & 0x1F) << 3) | + ((data[0] & 0xFF) << 8) | + ((data[1] & 0xFF) << 16) | + ((data[2] & 0xFF) << 24); + + if (dataLen > 3u) + { + PAC55XX_CAN->TXBUF = ((data[3] & 0xFF) << 0) | // Data 3 + ((data[4] & 0xFF) << 8) | // Data 4 + ((data[5] & 0xFF) << 16) | // Data 5 + ((data[6] & 0xFF) << 24); // Data 6 + } + if (dataLen > 7u) + { + PAC55XX_CAN->TXBUF = ((data[7] & 0xFF) << 0); // Data 7 + } + + PAC55XX_CAN->CMR.TR = 1; // Request transmit +} + +static inline uint16_t CAN_BaudTypeToInt(CAN_BAUD_TYPE type) +{ + uint16_t ret = 0u; + switch(type) + { + case CAN_BAUD_50KHz: + ret = 50u; + break; + + case CAN_BAUD_100KHz: + ret = 100u; + break; + + case CAN_BAUD_125KHz: + ret = 125u; + break; + + case CAN_BAUD_200KHz: + ret = 200u; + break; + + case CAN_BAUD_250KHz: + ret = 250u; + break; + + case CAN_BAUD_400KHz: + ret = 400u; + break; + + case CAN_BAUD_500KHz: + ret = 500u; + break; + + case CAN_BAUD_800KHz: + ret = 800u; + break; + + case CAN_BAUD_1000KHz: + ret = 1000u; + break; + + default: + // ret already set + break; + } + return ret; +} + +static inline CAN_BAUD_TYPE CAN_IntToBaudType(uint16_t baud) +{ + CAN_BAUD_TYPE ret = CAN_BAUD_250KHz; + switch(baud) + { + case 50u: + ret = CAN_BAUD_50KHz; + break; + + case 100u: + ret = CAN_BAUD_100KHz; + break; + + case 125u: + ret = CAN_BAUD_125KHz; + break; + + case 200u: + ret = CAN_BAUD_200KHz; + break; + + // 250 handled in default + + case 400u: + ret = CAN_BAUD_400KHz; + break; + + case 500u: + ret = CAN_BAUD_500KHz; + break; + + case 800u: + ret = CAN_BAUD_800KHz; + break; + + case 1000u: + ret = CAN_BAUD_1000KHz; + break; -void ids_from_arbitration(uint32_t arb_id, uint32_t* can_ep_id, uint32_t* can_seq_id); -void arbitration_from_ids(uint32_t* arb_id, uint32_t ep_id, uint32_t seq_id, uint32_t node_id); \ No newline at end of file + default: + // ret already set + break; + } + return ret; +} From 3bac00507fe8a7352ed89e22243162c43e2566c6 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Thu, 15 Feb 2024 20:48:19 +0200 Subject: [PATCH 09/20] use hash in arbitration id --- firmware/src/can/can.c | 6 ++- firmware/src/can/can_endpoints.c | 1 - firmware/src/can/can_endpoints.h | 2 +- studio/Python/tinymovr/channel.py | 52 ++++++++++++------------- studio/Python/tinymovr/config/config.py | 7 +++- studio/Python/tinymovr/constants.py | 6 +-- 6 files changed, 39 insertions(+), 35 deletions(-) diff --git a/firmware/src/can/can.c b/firmware/src/can/can.c index 512f5212..d48ce0f7 100644 --- a/firmware/src/can/can.c +++ b/firmware/src/can/can.c @@ -39,6 +39,9 @@ static CANState state ={0}; extern volatile uint32_t msTicks; +const uint8_t avlos_proto_hash_8 = (uint8_t)(avlos_proto_hash & 0xFF); +const size_t endpoint_count = sizeof(avlos_endpoints) / sizeof(avlos_endpoints[0]); + void CAN_init(void) { #if defined(BOARD_REV_R52) @@ -135,7 +138,8 @@ void CAN_process_interrupt(void) { can_process_extended(); - if (sizeof(avlos_endpoints) / sizeof(avlos_endpoints[0]) > can_ep_id) + if ((endpoint_count > can_ep_id) && + ((can_frame_hash == avlos_proto_hash_8) || (can_frame_hash == 0))) { uint8_t (*callback)(uint8_t buffer[], uint8_t * buffer_length, Avlos_Command cmd) = avlos_endpoints[can_ep_id]; uint8_t can_msg_buffer[8]; diff --git a/firmware/src/can/can_endpoints.c b/firmware/src/can/can_endpoints.c index 5280c9fd..f9b6ec0f 100644 --- a/firmware/src/can/can_endpoints.c +++ b/firmware/src/can/can_endpoints.c @@ -19,7 +19,6 @@ uint8_t (*avlos_endpoints[79])(uint8_t * buffer, uint8_t * buffer_len, Avlos_Command cmd) = {&avlos_protocol_hash, &avlos_uid, &avlos_fw_version, &avlos_hw_revision, &avlos_Vbus, &avlos_Ibus, &avlos_power, &avlos_temp, &avlos_calibrated, &avlos_errors, &avlos_save_config, &avlos_erase_config, &avlos_reset, &avlos_enter_dfu, &avlos_scheduler_errors, &avlos_controller_state, &avlos_controller_mode, &avlos_controller_warnings, &avlos_controller_errors, &avlos_controller_position_setpoint, &avlos_controller_position_p_gain, &avlos_controller_velocity_setpoint, &avlos_controller_velocity_limit, &avlos_controller_velocity_p_gain, &avlos_controller_velocity_i_gain, &avlos_controller_velocity_deadband, &avlos_controller_velocity_increment, &avlos_controller_current_Iq_setpoint, &avlos_controller_current_Id_setpoint, &avlos_controller_current_Iq_limit, &avlos_controller_current_Iq_estimate, &avlos_controller_current_bandwidth, &avlos_controller_current_Iq_p_gain, &avlos_controller_current_max_Ibus_regen, &avlos_controller_current_max_Ibrake, &avlos_controller_voltage_Vq_setpoint, &avlos_controller_calibrate, &avlos_controller_idle, &avlos_controller_position_mode, &avlos_controller_velocity_mode, &avlos_controller_current_mode, &avlos_controller_set_pos_vel_setpoints, &avlos_comms_can_rate, &avlos_comms_can_id, &avlos_motor_R, &avlos_motor_L, &avlos_motor_pole_pairs, &avlos_motor_type, &avlos_motor_offset, &avlos_motor_direction, &avlos_motor_calibrated, &avlos_motor_I_cal, &avlos_motor_errors, &avlos_encoder_position_estimate, &avlos_encoder_velocity_estimate, &avlos_encoder_type, &avlos_encoder_bandwidth, &avlos_encoder_calibrated, &avlos_encoder_errors, &avlos_traj_planner_max_accel, &avlos_traj_planner_max_decel, &avlos_traj_planner_max_vel, &avlos_traj_planner_t_accel, &avlos_traj_planner_t_decel, &avlos_traj_planner_t_total, &avlos_traj_planner_move_to, &avlos_traj_planner_move_to_tlimit, &avlos_traj_planner_errors, &avlos_homing_velocity, &avlos_homing_max_homing_t, &avlos_homing_retract_dist, &avlos_homing_warnings, &avlos_homing_stall_detect_velocity, &avlos_homing_stall_detect_delta_pos, &avlos_homing_stall_detect_t, &avlos_homing_home, &avlos_watchdog_enabled, &avlos_watchdog_triggered, &avlos_watchdog_timeout }; -uint32_t avlos_proto_hash = 3526126264; uint32_t _avlos_get_proto_hash(void) { diff --git a/firmware/src/can/can_endpoints.h b/firmware/src/can/can_endpoints.h index 0f773a13..11fbdf12 100644 --- a/firmware/src/can/can_endpoints.h +++ b/firmware/src/can/can_endpoints.h @@ -95,7 +95,7 @@ typedef enum ENCODER_TYPE_HALL = 1 } encoder_type_options; -extern uint32_t avlos_proto_hash; +static const uint32_t avlos_proto_hash = 3526126264; extern uint8_t (*avlos_endpoints[79])(uint8_t * buffer, uint8_t * buffer_len, Avlos_Command cmd); extern uint32_t _avlos_get_proto_hash(void); diff --git a/studio/Python/tinymovr/channel.py b/studio/Python/tinymovr/channel.py index aa088194..42cb07fc 100644 --- a/studio/Python/tinymovr/channel.py +++ b/studio/Python/tinymovr/channel.py @@ -24,30 +24,29 @@ CAN_DEV_MASK, CAN_EP_SIZE, CAN_EP_MASK, - CAN_SEQ_SIZE, - CAN_SEQ_MASK, + CAN_HASH_SIZE, + CAN_HASH_MASK, ) from tinymovr.codec import MultibyteCodec class ResponseError(Exception): - def __init__(self, kw, *args, **kwargs): - msg = "Node {} did not respond".format(kw) - super().__init__(msg, *args, **kwargs) - self.kw = kw + def __init__(self, node_id): + super().__init__(f"Node {node_id} did not respond") + self.node_id = node_id class CANChannel(BaseChannel): - def __init__(self, node_id): + def __init__(self, node_id, compare_hash = 0): self.node_id = node_id - get_tee().add( - lambda frame: frame.is_remote_frame == False - and ids_from_arbitration(frame.arbitration_id)[2] == node_id, - self._recv_cb, - ) + self.compare_hash = compare_hash self.queue = [] self.lock = Lock() self.evt = Event() + get_tee().add(self._filter_frame, self._recv_cb) + + def _filter_frame(self, frame): + return not frame.is_remote_frame and ids_from_arbitration(frame.arbitration_id)[2] == self.node_id def _recv_cb(self, frame): """ @@ -76,12 +75,11 @@ def recv(self, ep_id, timeout=1.0): with self.lock: self.evt.wait(timeout=timeout) self.evt.clear() - frame_id = arbitration_from_ids(ep_id, 0, self.node_id) - index = 0 - while index < len(self.queue): - if self.queue[index].arbitration_id == frame_id: - return self.queue.pop(index).data - index += 1 + for frame in self.queue: + inc_ep_id, inc_hash, _ = ids_from_arbitration(frame.arbitration_id) + if inc_ep_id == ep_id and (inc_hash == self.compare_hash or inc_hash == 0): + self.queue.remove(frame) + return frame.data raise ResponseError(self.node_id) def create_frame(self, endpoint_id, rtr=False, payload=None): @@ -89,7 +87,7 @@ def create_frame(self, endpoint_id, rtr=False, payload=None): Generate a CAN frame using python-can Message class """ return can.Message( - arbitration_id=arbitration_from_ids(endpoint_id, 0, self.node_id), + arbitration_id=arbitration_from_ids(endpoint_id, self.compare_hash, self.node_id), is_extended_id=True, is_remote_frame=rtr, data=payload, @@ -103,22 +101,22 @@ def serializer(self): # TODO: Implement unit test for these functions def ids_from_arbitration(arbitration_id): """ - Generate endpoint, message sequence and node ids + Generate endpoint, hash value and node ids from a CAN arbitration id """ - node_id = (arbitration_id & CAN_DEV_MASK) >> (CAN_EP_SIZE + CAN_SEQ_SIZE) - seq_id = (arbitration_id & CAN_SEQ_MASK) >> CAN_EP_SIZE + node_id = (arbitration_id & CAN_DEV_MASK) >> (CAN_EP_SIZE + CAN_HASH_SIZE) + hash = (arbitration_id & CAN_HASH_MASK) >> CAN_EP_SIZE ep_id = arbitration_id & CAN_EP_MASK - return ep_id, seq_id, node_id + return ep_id, hash, node_id -def arbitration_from_ids(ep_id, seq_id, node_id): +def arbitration_from_ids(ep_id, hash, node_id): """ Generate a CAN arbitration id from endpoint, - message sequence and node ids + hash value and node ids """ return ( ep_id & CAN_EP_MASK - | ((seq_id << CAN_EP_SIZE) & CAN_SEQ_MASK) - | ((node_id << (CAN_EP_SIZE + CAN_SEQ_SIZE)) & CAN_DEV_MASK) + | ((hash << CAN_EP_SIZE) & CAN_HASH_MASK) + | ((node_id << (CAN_EP_SIZE + CAN_HASH_SIZE)) & CAN_DEV_MASK) ) diff --git a/studio/Python/tinymovr/config/config.py b/studio/Python/tinymovr/config/config.py index 28ab4698..e0655ba8 100644 --- a/studio/Python/tinymovr/config/config.py +++ b/studio/Python/tinymovr/config/config.py @@ -69,18 +69,20 @@ def create_device(node_id): Create a device with the defined ID. The hash value will be retrieved from the remote. """ - chan = CANChannel(node_id) # Temporarily using a default spec to get the protocol_hash # This assumes that `protocol_hash` is standard across different specs # Get the first spec as a temp - tmp_spec = list(specs["hash_uint32"].values())[0] + tmp_hash = list(specs["hash_uint32"].keys())[0] + tmp_spec = specs["hash_uint32"][tmp_hash] node = deserialize(tmp_spec) + chan = CANChannel(node_id, (tmp_hash & 0xFF)) node._channel = chan # Check for the correct spec using the remote hash protocol_hash = node.protocol_hash device_spec = specs["hash_uint32"].get(protocol_hash) + chan.compare_hash = protocol_hash & 0xFF if not device_spec: raise ValueError(f"No device spec found for hash {protocol_hash}.") @@ -101,6 +103,7 @@ def create_device_with_hash_msg(heartbeat_msg): hash, *_ = chan.serializer.deserialize(heartbeat_msg.data[:4], DataType.UINT32) device_spec = specs["hash_uint32"].get(hash) + chan.compare_hash = hash & 0xFF if not device_spec: raise ValueError(f"No device spec found for hash {hash}.") diff --git a/studio/Python/tinymovr/constants.py b/studio/Python/tinymovr/constants.py index de5d58fb..f2f07674 100644 --- a/studio/Python/tinymovr/constants.py +++ b/studio/Python/tinymovr/constants.py @@ -25,8 +25,8 @@ CAN_EP_SIZE = 12 CAN_EP_MASK = (1 << CAN_EP_SIZE) - 1 -CAN_SEQ_SIZE = 9 -CAN_SEQ_MASK = ((1 << CAN_SEQ_SIZE) - 1) << CAN_EP_SIZE +CAN_HASH_SIZE = 9 +CAN_HASH_MASK = ((1 << CAN_HASH_SIZE) - 1) << CAN_EP_SIZE CAN_DEV_SIZE = 8 -CAN_DEV_MASK = ((1 << CAN_DEV_SIZE) - 1) << (CAN_EP_SIZE + CAN_SEQ_SIZE) +CAN_DEV_MASK = ((1 << CAN_DEV_SIZE) - 1) << (CAN_EP_SIZE + CAN_HASH_SIZE) From d6147adfc4e5f113ba98d79e69cabb5eba0bcc4f Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Thu, 15 Feb 2024 20:48:47 +0200 Subject: [PATCH 10/20] update bootloader --- firmware/bootloader/bootloader-M51.bin | Bin 0 -> 3764 bytes firmware/bootloader/bootloader-R32.bin | Bin 0 -> 3796 bytes firmware/bootloader/bootloader-R33.bin | Bin 0 -> 3796 bytes firmware/bootloader/bootloader-R50.bin | Bin 0 -> 3748 bytes firmware/bootloader/bootloader-R51.bin | Bin 0 -> 3748 bytes firmware/bootloader/bootloader-R52.bin | Bin 0 -> 3764 bytes firmware/bootloader/bootloader_M51.bin | Bin 3684 -> 0 bytes firmware/bootloader/bootloader_R32.bin | Bin 3716 -> 0 bytes firmware/bootloader/bootloader_R33.bin | Bin 3716 -> 0 bytes firmware/bootloader/bootloader_R50.bin | Bin 3668 -> 0 bytes firmware/bootloader/bootloader_R51.bin | Bin 3668 -> 0 bytes firmware/bootloader/bootloader_R52.bin | Bin 3684 -> 0 bytes 12 files changed, 0 insertions(+), 0 deletions(-) create mode 100755 firmware/bootloader/bootloader-M51.bin create mode 100755 firmware/bootloader/bootloader-R32.bin create mode 100755 firmware/bootloader/bootloader-R33.bin create mode 100755 firmware/bootloader/bootloader-R50.bin create mode 100755 firmware/bootloader/bootloader-R51.bin create mode 100755 firmware/bootloader/bootloader-R52.bin delete mode 100755 firmware/bootloader/bootloader_M51.bin delete mode 100755 firmware/bootloader/bootloader_R32.bin delete mode 100755 firmware/bootloader/bootloader_R33.bin delete mode 100755 firmware/bootloader/bootloader_R50.bin delete mode 100755 firmware/bootloader/bootloader_R51.bin delete mode 100755 firmware/bootloader/bootloader_R52.bin diff --git a/firmware/bootloader/bootloader-M51.bin b/firmware/bootloader/bootloader-M51.bin new file mode 100755 index 0000000000000000000000000000000000000000..6da95ccf395c92f7eea8f607f70e71d7ccb8a279 GIT binary patch literal 3764 zcmc&%eQaCR6~FJpv12=qKT?!9Y4_|GsOc-kNvbtXk>=RprSVHhlhCP2gSd7&_F4_) zwP=!oP4QYLB3cBc5~MCjAT*7se~<=@1}qrTv9Wa$aZDxJY9jkgKj?VyocSdweLL4S zUFiNm`)9NDyXW3>&pr3vbMHC#ynq#PJ1Y?C1atu;Ko6i7aPzNk6>k9Q-(wNF8|eQG zH_azRThqt(3O&54GRI;YB(F^QV%k&9UYwG{YLZT2uN>1V{iHprvF;S^&8tDAo?1CQ z^{!^-4u#q5(7L&)FE>nN1f{+ksn4(Qazter9urCdwQxv%VP!<7{BiBMfe}0cnm&1G z1dpl)GZGULd~5_HEzAhEOW1!%ujhMJ6!*gTQSBg%pT5`{>dk+Eks5y+u~i|kDTg>h zts(R$G*3yj38fQd2!Bf&siP}ysb01T>ppgMyQ1!{ex2XpPsk!tCzcV zyKV9s8ISL-p9s4?w!`cv=&G|e*#m2SMfW8tCG_+@u{}Q@vvAZgq%JQL-CyY`?g#eL zw5e$mwSf_xB9&qNR%H!Xy*7h5rIXsAq)nnjtPv}+NIkm5@-0dLbD}bh8dny+-n-|f zUWBL(&U8tuDOw{xGv0uiOe$Hy+Z4n(r%@&Wo3nu3b}liTW%}RROj)DQXKYpi%74ye zf^}?JTHV*0W3K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z=v180gJpWUNW-cV=(cV0wX7r@X1*5Qb2K2#82@59QBXse5q&k`-x!ee!ALDa4 z2YJ=_Ly`P=OAfv*>WW`MkGtw{9lX9(O(k0Ct1GU7#9%lLq6_jMlN6#S;59yKzIJv< z?uT+hes_wT79Fxm2PcQ*XMop!Ipk~4C-)yOOR`c)_Jm9wqfXG1C3%tq-)~G`w1kYp ItB`U13&xQg*8l(j literal 0 HcmV?d00001 diff --git a/firmware/bootloader/bootloader-R32.bin b/firmware/bootloader/bootloader-R32.bin new file mode 100755 index 0000000000000000000000000000000000000000..45718d83f4f7ea8708b7099f6df264c880155b86 GIT binary patch literal 3796 zcmc&%eQaCR6~FJpAN5!4I7Nw*X0~6TCN9NEDw?K9bL{fc_$8!i=+ve~y>>cyDMNW_ zHO+vucr8;SQW&KYq$x-sgvQiA2mx0E77Xdw*g9!(Or$2&MA%pQLC1sV%r77G?OfaK zLiY#SKbx)JJ@=k_?z#7#d(XM&`Ao>&uSci{@O{9;fL_2OfLni$uHyAU{U8Wisid4-37(afgG1!s)7$fI;rGN2IiMr^@Z{#zh{r)5RqKF z%!~%cck7Y64PXS_`+z9a$wsxK_SdL}2%4Zs8Yn?p?)&^A^c@!!>u?llnF;9)45H z(HaYOKc{@Kvy$GO@=Esc0GtoGBgUkbyQ+0$UzU&@UQ*{9lXt+a7`E%#d4$Gy?9W7ZNdo)$KcZ(i4E44J_92ewgv}q9tN!?dr`( zooI(V$L)#Ed5)-@-QayG>Wab*2EVlipMBdoo%iiB@a=18?u%9$fdxyQVyF15CMOIq&o`zS@^DPea$MvyxC z5(h^Yu6M8*OWw{;gNMDckm!1ALH#b9F$myy(h%^@8}_Fdf$<)9yQJ-TKP>2iU3l$p zJ9{l{9K<+h)GSycBiIsg;f}A^QZLv$hS#)J;Ssz>fIaLS!3o7U_@K%P#+LjZi~HqK zDY_5UBeLe}^WXei1zW_{Iux>IY*0gtLs|Lx zd?5zD4*pEy6M;zf3;OLzi?9#Q9I^ZGJ~67St=Wh7h%x0TwFh^LSTU4#0}aU(P3RQ0 zG7XUdV(pWB^A*H6Wrle)9c*gObgJyuAmIN+gH7X8fqKWcuEXARZOT%wyD7&uEl#oZ z#>pu|Rm!1KTM>ZDm@vt-$KPu(5K|tTHB6%Iyp3qm=0&OnRQ&gdyF1GI~(zLF?-vV)s zjJsBB-&ySME%G~yZ3^^|HzNS^?Y^!JP(UekiTO}BTs=S|^b%kk&lcy(v&)bI_Jry2ZMieI}??=6h+VRUi7te7CsX^97XU zp3k9ldM-n0_WT{n(wn0g&tLM~e?n=y$t7zo=$e@)vA%lycZ3O%mP;rpSs|?xCX|Gu zLYg*aEV`_=mdR>eABz6)E=DJ7yZqq~m0#=p;j(r=E^9xhnDra66R5Glk4pusX`NIm zTS_{vIPL>PKN)*aIwhGWC&XFFVXEkNSW0ap{d@YohHWX}^+P0s`AM$u0D$BMBzM>W zAbEq7ysh02S;5NmdDLcRvIBZHJFx9{?4~d!4>WtiK{>&C!oR?d_{FjC6^iSOLm561 zXM8|=&S3q_l*$CoV1w_;ROYcWn7juNo8he}%$rCaA4PAd_#ON>-YIlJJn96AK4lH( z#P>UriUXgO624K;99IQi09md;(7N#@l2n`!sA2j9|xEh?aVK7V9IfShqN#1krPb zrB8<8juTlT_wyGYJD#A?LgMgnh{}-sZHLPGsruX`1$CXE11;r+u@o75YSmaN*?fg& zS(#xGoKaQSmA2h)6W+oN;sH3z2F&p%L#Ff(#kDe}TQ08pQ8k&*1v??n4Faf!&*!O{ z1@MQ$dJIX{OP#P@r76gRt}~>X8dwHJZYDAw2v>grElh!m_k4#@rvkKvvcZ^(+y|lyav_}%q=(@}K4Dmy?iP1KIV^rKMox?+>QYWd?^k_kz_mU{!Tu73dzuq)dD literal 0 HcmV?d00001 diff --git a/firmware/bootloader/bootloader-R33.bin b/firmware/bootloader/bootloader-R33.bin new file mode 100755 index 0000000000000000000000000000000000000000..5dedf73a4f6f214aa033c3b8833379ff938f8422 GIT binary patch literal 3796 zcmc&%eQaCR6~FJp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TO7GQ=m>C`qTcd? z-sZi|HCtmR5RvKEJomWqH}nUYz}53aetqyMX|VQ5i~_&U5Zx%SafZ-uU16|1@I^tx z-NFB2#`G%jA;=UEb8!*{v`jHG_*i2^x98S<^A@TTln97peZM((>sD}Iu1$BdH04j>c z|4V5~jA$N*+)moTloK+lL*buJumYFa_m;iG;nVXUL$1RM%$E+s4~0r;K=KL9w5jn_ zxI)Nh{&*QNm2LEi$~FdIfE*Wjmgh;HM)a9M+kvnnWy`R29zoCV&_iz%`UBnbHnsV$ zlZlOL#xX^CuEXld82U}h`^r^_Z2sj8{VTbBo#;q$aIb6jakx&rAklTZ)pFkjIF;S1 z5l)5l2`&=FhSh_RI}_U7P^8upHI?`u739i614|Q$a1QO`aB}akO3}#}q5DhpOo4_K z2hclD8#{Y)h?>?CPA81Q>RHeSFC{FPe2>tD?~(G(EXn1D_}nO;#aYO!#vYI4#u~Hm zZBbSD3VOy_g{$E8wbd8tDsNR`4WSrE?gP;Ud5}R2(c=(Lj~cI^89GBjoB&S7( y%;NruLFswmwO$E%TXTt#<0VN}EXtmcsAJR#dZH*#a^OewsY|Aio_`%Ou73e^i4wp7 literal 0 HcmV?d00001 diff --git a/firmware/bootloader/bootloader-R51.bin b/firmware/bootloader/bootloader-R51.bin new file mode 100755 index 0000000000000000000000000000000000000000..4718e255feeaaf629c3e18c83e3b1c5a04703e3e GIT binary patch literal 3748 zcmc&%eQaCR6~FJpvFoq+BSndmX3uuon!Zw;q+8Pjgky)7CNCjPLZ>DaaqU#>wHnGx z(If+#Vzo>}Z4oV%Aay|kRnwUI2Wh})z=9zigRPSm$5f)NCbG};gN_H!nO~C9w{vZ` z3*8@R|7^B?_uPB#x#!+{?mg$87ce94{xXEN0JZ{J0QUm!1Kj>=UBQb$eFuxscY*%T zaNB%MsrBOeZjVHHqv~@F>pDF6;2xi%&0(Fq;{y zot^x8!+4sPtGkf$(z0KQC@ka0gi=6F98z9h9+D_uOntF`2oHg#&mJGb!-~!fMftct zIs}p?W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ne&PIkod2p=5z=U z-LIcLgW7FOuD^`U^|$_>T^6R){uXaIs3ur%_+9LbpC1fgqWHCOD8u{Wj2~$4VO(}@ zRA&N*vDyDzI{WltO#DCiVu%gJc@wF<1L%m3PvB>8m(&gZXDvwdX|s4YeoR^e?HPzC zmCVZ6jC_8Of!YiD!T{o5&>sxg#@~Q4(73YI@G&~KgtVwe(gQW_4UkKQu4WN`GIsy? z$*nzg@5kPkJ*|Ylp$@b-TyZkCIC5dYA$T%Hy_E&M&0C#wSHun?BGavNkGSz&`U8w` z`5cj77r$t1}cSX1q}}d{)-vYv!soX9U$iXAQJRUF&j9c zGZOM8F-ixP4~Ypl(Oa>|TJ?F@ELp&gW8fXj=rLRt@x*%MVJ(PWHBWzf0PZ-EC33$! z^z_~YjV2R24uq&I$-~y@tUxv7M<}S9Bok<(h*f;MOtE5^k(JZSnEP^wt3wtsZ zk5x$T;YN8goMj{C#r+{`=11~ul`_qgR{cFaRmkbqLcSUVP>ok6sQO8G55@JEQ>>5L zSALnMAn&=!3_#?WL69*q{$!e#;7q`GkkwbiJ!Sld(v%d|Ift@}v;&aCJwLGhxV_Ec zGxDE6Uc-ybmk!hS#cFwj>=T(`OXJ~Cm6*@``66PfTj_(~DjKC0fQYL~++A=wp=kt;^uI{4*K)H)I_PBuB~vceif42iHquGF`t} ztMrY5&caY3#UG_W+02<6ar_(s{KouAk51EaXeO zcZ74h8?*2&P*eD7dBItOYaptYFD=qp-kQQ1f-w&{bMj3B`He{m(g(n2?lWIM+aq^D zc|iVPkXV8aTBV%>J@Tu-Yq=Ekw&W7q-YiM7Qc?DxOzo!*(gQ_#lG{FE3|+7Ujr Date: Thu, 15 Feb 2024 20:49:33 +0200 Subject: [PATCH 11/20] support adding hash as parameter to functions --- studio/Python/tinymovr/dfu.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/studio/Python/tinymovr/dfu.py b/studio/Python/tinymovr/dfu.py index 4b1c8d3e..e179def9 100644 --- a/studio/Python/tinymovr/dfu.py +++ b/studio/Python/tinymovr/dfu.py @@ -15,6 +15,7 @@ import sys import os import time +import inspect from pathlib import Path import can import yaml @@ -89,7 +90,12 @@ def upload_bin(device, bin_path): total_size = os.path.getsize(bin_path) # Get the total size of .bin file uploaded_size = 0 print("\nErasing flash...") - result = device.erase_all() + if 'hash_validation' in inspect.signature(device.erase_all).parameters: + # Call erase_all with hash_validation, using the device's specified hash + result = device.erase_all(device.hash_uint32) + else: + # If not, call erase_all without hash_validation + result = device.erase_all() if result != 0: print("\nError while erasing!") return @@ -110,7 +116,12 @@ def upload_bin(device, bin_path): time.sleep(1e-5) # Commit the data in scratchpad to flash memory and get checksum - device_checksum = device.commit(flash_addr) + if 'hash_validation' in inspect.signature(device.commit).parameters: + # Call commit with hash_validation, using the device's specified hash + device_checksum = device.commit(flash_addr, device.hash_uint32) + else: + # If not, call commit without hash_validation + device_checksum = device.commit(flash_addr) local_checksum = calculate_local_checksum(chunk) From 5ca1a345ac3b883d45a806ca40444e6fcb58a7c3 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Thu, 15 Feb 2024 20:50:23 +0200 Subject: [PATCH 12/20] add version info --- firmware/Makefile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/firmware/Makefile b/firmware/Makefile index 137a646e..ea9c2846 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -104,7 +104,7 @@ all: release debug: CFLAGS += -DDEBUG -g2 -O1 debug: CPPFLAGS += -DDEBUG -g2 -O1 debug: LDFLAGS += -O1 -debug: OBJECTS += $(BUILDDIR)/bootloader_$(REV).o +debug: OBJECTS += $(BUILDDIR)/bootloader-$(REV).o debug: binary # Upgrade target @@ -114,11 +114,11 @@ upgrade: LDFLAGS += -O3 upgrade: binary # Release target -release: OBJECTS += $(BUILDDIR)/bootloader_$(REV).o +release: OBJECTS += $(BUILDDIR)/bootloader-$(REV).o release: upgrade # Binary target -binary: print_board_rev $(HEX) $(BIN) $(ELF) +binary: print_board_info $(HEX) $(BIN) $(ELF) # Objcopy to HEX $(HEX): $(ELF) @@ -131,7 +131,7 @@ $(BIN): $(ELF) # Link $(ELF): $(OBJECTS) - - $(OBJCOPY) -I binary -O elf32-littlearm -B arm --rename-section .data=.bl_section,alloc,load,readonly,data,contents $(PROJECTDIR)/bootloader/bootloader_$(REV).bin $(BUILDDIR)/bootloader_$(REV).o + - $(OBJCOPY) -I binary -O elf32-littlearm -B arm --rename-section .data=.bl_section,alloc,load,readonly,data,contents $(PROJECTDIR)/bootloader/bootloader-$(REV).bin $(BUILDDIR)/bootloader-$(REV).o $(LD) $(LDFLAGS) $(OBJECTS) -o $(ELF) $(SIZE_EX) --format=berkeley $(ELF) @@ -151,8 +151,9 @@ clean : - $(rmdir_cmd) "$(BUILDDIR)" # Print board revision -.PHONY: print_board_rev -print_board_rev: - @echo "===Building Tinymovr===" +.PHONY: print_board_info +print_board_info: + @echo "===Building Tinymovr Bootloader===" @echo "Board revision is $(REV)" - @echo "=======================" + @echo "Fw version is $(GIT_VERSION)" + @echo "==================================" From 95c635e316f519af253254c1e7e1e454574753ff Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Thu, 15 Feb 2024 21:02:28 +0200 Subject: [PATCH 13/20] revise dfu specs --- .../specs/{dfu.yaml => dfu_1_0_x.yaml} | 0 studio/Python/tinymovr/specs/dfu_1_1_x.yaml | 72 +++++++++++++++++++ 2 files changed, 72 insertions(+) rename studio/Python/tinymovr/specs/{dfu.yaml => dfu_1_0_x.yaml} (100%) create mode 100644 studio/Python/tinymovr/specs/dfu_1_1_x.yaml diff --git a/studio/Python/tinymovr/specs/dfu.yaml b/studio/Python/tinymovr/specs/dfu_1_0_x.yaml similarity index 100% rename from studio/Python/tinymovr/specs/dfu.yaml rename to studio/Python/tinymovr/specs/dfu_1_0_x.yaml diff --git a/studio/Python/tinymovr/specs/dfu_1_1_x.yaml b/studio/Python/tinymovr/specs/dfu_1_1_x.yaml new file mode 100644 index 00000000..1cef75e1 --- /dev/null +++ b/studio/Python/tinymovr/specs/dfu_1_1_x.yaml @@ -0,0 +1,72 @@ + +name: tm_dfu +remote_attributes: + - name: protocol_hash + dtype: uint32 + getter_name: _system_get_proto_hash_and_trigger_dfu + summary: The Avlos protocol hash. + - name: uid + dtype: uint32 + getter_name: system_get_uid + summary: The unique device ID, unique to each PAC55xx chip produced. + - name: fw_version + dtype: string + getter_name: system_get_fw_version_string + summary: The bootloader firmware version. + - name: hw_revision + dtype: uint32 + getter_name: system_get_hw_revision + summary: The hardware revision. + - name: reset + summary: Reset the device. + caller_name: system_reset + dtype: void + arguments: [] + meta: {reload_data: True} + - name: node_id + summary: The node id + getter_name: CAN_get_ID + dtype: uint8 + - name: error + options: [NONE, START_EXECUTION_STACK_POINTER_OUT_OF_RANGE, START_EXECUTION_ADDRESS_OUT_OF_RANGE, START_EXECUTION_ADDRESS_LSB_NOT_SET] + getter_name: system_get_error + summary: The last error encountered in DFU + - name: read_flash_32 + summary: Read a 32 bit value from the flash + caller_name: nvm_read_flash_32 + dtype: uint32 + arguments: + - name: address + dtype: uint32 + - name: write_scratch_32 + summary: Write a 32 bit value to the scratchpad + caller_name: nvm_write_scratch_32 + dtype: void + arguments: + - name: offset_word32 + dtype: uint8 + - name: value + dtype: uint32 + - name: read_scratch_32 + summary: Read a 32 bit value from the scratchpad + caller_name: nvm_read_scratch_32 + dtype: uint32 + arguments: + - name: offset_word32 + dtype: uint8 + - name: commit + summary: Commit the 128 bit scratchpad to the specified flash address. Pass the current protocol hash for validation. + caller_name: nvm_commit + dtype: uint32 + arguments: + - name: address + dtype: uint32 + - name: hash_validation + dtype: uint32 + - name: erase_all + summary: Erase all flash. Pass the current protocol hash for validation. + caller_name: nvm_erase_all + dtype: uint32 + arguments: + - name: hash_validation + dtype: uint32 From 873d692ecf9880a6d36c9938d96162ef93932d08 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Fri, 16 Feb 2024 01:06:39 +0200 Subject: [PATCH 14/20] revise function detection --- studio/Python/tinymovr/dfu.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/studio/Python/tinymovr/dfu.py b/studio/Python/tinymovr/dfu.py index e179def9..299bbaf6 100644 --- a/studio/Python/tinymovr/dfu.py +++ b/studio/Python/tinymovr/dfu.py @@ -90,11 +90,11 @@ def upload_bin(device, bin_path): total_size = os.path.getsize(bin_path) # Get the total size of .bin file uploaded_size = 0 print("\nErasing flash...") - if 'hash_validation' in inspect.signature(device.erase_all).parameters: - # Call erase_all with hash_validation, using the device's specified hash + try: + # Assume device.erase_all can take hash_validation and attempt to call it result = device.erase_all(device.hash_uint32) - else: - # If not, call erase_all without hash_validation + except TypeError: + # Fallback to calling erase_all without hash_validation if TypeError is raised result = device.erase_all() if result != 0: print("\nError while erasing!") @@ -116,11 +116,11 @@ def upload_bin(device, bin_path): time.sleep(1e-5) # Commit the data in scratchpad to flash memory and get checksum - if 'hash_validation' in inspect.signature(device.commit).parameters: - # Call commit with hash_validation, using the device's specified hash + try: + # Assume device.commit can take hash_validation and attempt to call it device_checksum = device.commit(flash_addr, device.hash_uint32) - else: - # If not, call commit without hash_validation + except TypeError: + # Fallback to calling commit without hash_validation if TypeError is raised device_checksum = device.commit(flash_addr) local_checksum = calculate_local_checksum(chunk) From 4c88656a28616f96e3b5fb4e551cdd7ace4f7787 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Fri, 16 Feb 2024 01:16:41 +0200 Subject: [PATCH 15/20] update bootloader --- firmware/bootloader/bootloader-M51.bin | Bin 3764 -> 3716 bytes firmware/bootloader/bootloader-R32.bin | Bin 3796 -> 3748 bytes firmware/bootloader/bootloader-R33.bin | Bin 3796 -> 3748 bytes firmware/bootloader/bootloader-R50.bin | Bin 3748 -> 3700 bytes firmware/bootloader/bootloader-R51.bin | Bin 3748 -> 3700 bytes firmware/bootloader/bootloader-R52.bin | Bin 3764 -> 3716 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/firmware/bootloader/bootloader-M51.bin b/firmware/bootloader/bootloader-M51.bin index 6da95ccf395c92f7eea8f607f70e71d7ccb8a279..ee975015ce496d568ab67ec84ced54f213c8b212 100755 GIT binary patch delta 1079 zcmbu8e@IhN6vxkfKiqR}b83>Pi$^OHEz2~rMo}%E+Orl(BtbO#>lFoe5iugz#G-le#ivZ!>+JSBrl97v0B)bI-ZockVg&a&Pz! z_+o|vs;mHH8~|Bl0+~cCrK_ust(}$vdl}S35T+*hO8D!@35Ujjm>+PUb%2xlRjoNb-XZN z#_y)%Pnlk!Mb5*o2oa%**jW zcqpwjp|`-Vhu(W@drXLza91(T+mP_qT=&-=lf-+eYh=uLMipm8L~#|yJk?w&?uwj= zRHrZ;85k=nu6$aim$rAB4PiqAZsox5YWLGR&CvQax|0KdmVVtK`b z-&ToUVbE4cN!Sk?RE7iIL_vo?8oXv@Hcv@K8`vYU-O|Ov?rfu0k6Di}pWG=N#-LnRdT;(2(TSFf-FL=Ah(dm$Y(^BzzyYivh_$1>5n_{l|*q% bvG!bw=s{EU($=WNp19TtQK`SieVlv)KowWr delta 1106 zcmbu8U2GIp6vxk9(^=TS}7_s;;%f(HC!h z(0!0BMq_v|Cgi@f1dKppe6+2@3oc7rG(13H6%xW5i3tiZnPeNg?xu`q>^>0Qh?D&C zzvttgx#!NAFTy{Dvr!qeaS31m8AMDZg$yIlKcmn1#&CT?062vDKX~KCHb3`5ww=Vb zFH}|+uN8gT=Ldztv6f#KH`?a%I&DsZbFRWDY2eOR*q5ZAo4&$s5-rbHGJOlOxy?e-viX4#vcQQ} z_#e7*6B1}i#1EiNp&mtgkalDS>9v(XWvDh;V>Mdo)5lqn+ogb0E_-`7^Vn|wRdR++ z@?kQ=KHuf0*$;21j zbw*yjx=)<`Bqw&>%vw5O8w8jd2Nd`r6b#uR=b7`NW*a&;f7F-tz7DqTl!~DyQ+vyc_qhq@~0D zk4ZL+>$gkbTo5+(Kvn0-rd_Do9aSxeoBnKvKxh$Zg~a;^P6rNCy%}jw5VFxRGs1>@Zg>&Z#BT z4$-i=Qalw5(R=>i0^*w6$gjC$%a$G==S9aI*W=5@>!KcSNa^W@)M~Lt>P*+8`uFN- z)!ZtFspe3Q=8nma4j0~(Y=v%!F>oSmJVZT0o%(Kn031#+m*8)R>Q vy}|Vcdj#=@`pi%1r4hNGQ)6iG(Q|oX#!Ffq9f(QnyTD;CCN2FP_?r9+zacSL diff --git a/firmware/bootloader/bootloader-R32.bin b/firmware/bootloader/bootloader-R32.bin index 45718d83f4f7ea8708b7099f6df264c880155b86..082c9f793082647e7a4fc775d4f105db0d238af6 100755 GIT binary patch delta 1071 zcmbu8Pe>GT6vy9hW>&{_cU`rz)UBztTnw$%C~YZnaaT8ZiCFxE&3IClX=}W*faq=#$&m zZ9p`iIr1=WK*DY5t{>e7iS}!b=QHYSO|&oX5FI%YS1A+oS~@Owl#Zd@F*=i*SNy6_ zDQIjqs=}%a%uIvV(dgAGWK|xl2lf+)FXx4%*WSrh>eOP@t`vul%4YK0JU1Bsz`6kJ zJ9-6>&LaazKZ0i>b)p_aE+ChXEiqT4Yd2lVRk_UMgL!^%V|<~6wsO_v8|~#hWRl+E z{2rejK#T#qo8l!gPAasRO?JskWZMff>7*&Hz zX@c{D2uOQ_4g0LcYq1lVOImNQd%yQ6QCiXvcT%e?JiVFO<~wfwvToS zv`@H})1C6m>#^xMT4!tKdeF306r34_u^y}^N{g=5TQPlN+ipFzXI*pE;*MHpVR2m; zx|em5L@sh5wHd$;p=W7+M!Pb8WhQ@{$@BSzy5pJr2&%sdZ~RO3c{4"Gx1+xk}? z<^j$iH<10vV`K{XisT9as|9d^AA@?N4H+7+@8Sw{9Fq549V1H6klb3mF3|6eCQcWI IWM?1w1@JmFp#T5? delta 1154 zcmbu8T}%{L6vxk<*_oXVuH+5*phuR9XkxrgwdD z<3q=`FMTpG_XYbEH8%0FmJAQJ>lSQGAKlcZ#y68DR!x&hAlYTNIz2aRBH_(A$uIwV z{&Vj4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_Kg876a7?5qm*3Ppgp{?z^*K+@j*?#OK8xqm7jS>Hh!Yuj#Mj;6V5IT+);Ky+_!U}O7H}b z18p*yn(~{Y&X-rgeZS(B=U$$@s-(bG*%fg&r&QTpagXX3E#G2fxr1xaiMdXgT0X90OpY)#6b$kL!^u}@&Hk!A2AVjT=+BBnR?4yvpKhkP$xp8 z=341|I706Q?}Wq+Z!5pyO|RN|a)uXOZ$?k9mVOuYWb34EwN9>=8l)bp1vS{OTdLV8 zN2%(DnvOgTA3{F4yZjMdqz$*$><2U~M>64%s{D{Sndu6Q7SNZ$;Q~1_><_X(!2aO+ rgFS`#Lp^`pS{ar{IW>U>AHP^2X0oC+)3Joaz7HMd64J_Fp$p^{V|y*m diff --git a/firmware/bootloader/bootloader-R52.bin b/firmware/bootloader/bootloader-R52.bin index 34c841a547267dc5e9a9f63bcac1706a90c79f78..39000676dc6bf68776505b116e4d294e913cf887 100755 GIT binary patch delta 1079 zcmbu8e@IhN6vxkfKiqR}b83>Pi$^OHEz2~rMo}%E+Orl(BtbO#>lFoe5iugz#G-le#ivZ!>+JSBrl97v0B)bI-ZockVg&a&Pz! z_+o|vs;mHH8~|Bl0+~cCrK_ust(}$vdl}S35T+*hO8D!@35Ujjm>+PUb%2xlRjoNb-XZN z#_y)%Pnlk!Mb5*o2oa%**jW zcqpwjp|`-Vhu(W@drXLza91(T+mP_qT=&-=lf-+eYh=uLMipm8L~#|yJk?w&?uwj= zRHrZ;85k=nu6$aim$rAB4PiqAZsox5YWLGR&CvQax|0KdmVVtK`b z-&ToUVbE4cN!Sk?RE7iIL_vo?8oXv@Hcv@K8`vYU-O|Ov?rfu0k6Di}pWG=N#-LnRdT;(2(TSFf-FL=Ah(dm$Y(^BzzyYivh_$1>5n_{l|*q% bvG!bw=s{EU($=WNp19TtQK`SieVlv)KowWr delta 1106 zcmbu8U2GIp6vxk9(^=TS}7_s;;%f(HC!h z(0!0BMq_v|Cgi@f1dKppe6+2@3oc7rG(13H6%xW5i3tiZnPeNg?xu`q>^>0Qh?D&C zzvttgx#!NAFTy{Dvr!qeaS31m8AMDZg$yIlKcmn1#&CT?062vDKX~KCHb3`5ww=Vb zFH}|+uN8gT=Ldztv6f#KH`?a%I&DsZbFRWDY2eOR*q5ZAo4&$s5-rbHGJOlOxy?e-viX4#vcQQ} z_#e7*6B1}i#1EiNp&mtgkalDS>9v(XWvDh;V>Mdo)5lqn+ogb0E_-`7^Vn|wRdR++ z@?kQ=KHuf0*$;21j zbw*yjx=)<`Bqw&>%vw5O8w8jd2Nd`r6b#uR=b7`NW*a&;f7F-tz7DqTl!~DyQ+vyc_qhq@~0D zk4ZL+>$gkbTo5+(Kvn0-rd_Do9aSxeoBnKvKxh$Zg~a;^P6rNCy%}jw5VFxRGs1>@Zg>&Z#BT z4$-i=Qalw5(R=>i0^*w6$gjC$%a$G==S9aI*W=5@>!KcSNa^W@)M~Lt>P*+8`uFN- z)!ZtFspe3Q=8nma4j0~(Y=v%!F>oSmJVZT0o%(Kn031#+m*8)R>Q vy}|Vcdj#=@`pi%1r4hNGQ)6iG(Q|oX#!Ffq9f(QnyTD;CCN2FP_?r9+zacSL From 46ce324d707cd27185be71e7de4ffbb04524d89e Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Fri, 16 Feb 2024 01:29:50 +0200 Subject: [PATCH 16/20] fix returning trimmed string --- firmware/src/system/system.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/src/system/system.h b/firmware/src/system/system.h index 91bf0497..5ddf404b 100644 --- a/firmware/src/system/system.h +++ b/firmware/src/system/system.h @@ -38,10 +38,11 @@ void system_update(void); void system_reset(void); void system_enter_dfu(void); -inline uint8_t system_get_fw_version_string(char *buffer) +static inline uint8_t system_get_fw_version_string(char *buffer) { - memcpy(buffer, GIT_VERSION, 4); - return 4; + const uint8_t size = fminf(sizeof(GIT_VERSION), 8); + memcpy(buffer, GIT_VERSION, size); + return size; } inline uint32_t system_get_uid(void) From 1caa62219bc68e8b9f11a7990b3a8d58df80367b Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Fri, 16 Feb 2024 01:31:52 +0200 Subject: [PATCH 17/20] update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a2c2acc7..78c873b6 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ![Docs Build](https://github.com/yconst/tinymovr/workflows/Tinymovr%20Docs%20Build/badge.svg) [![Discord](https://img.shields.io/discord/742400176664084535)](https://discord.gg/CzcCaXbU) -[Tinymovr is an affordable motor controller](https://tinymovr.com) for precise control of 3-phase brushless motors. Tinymovr works with up to 38V input voltage, drives motors up to 40A continuous phase current, integrates an absolute angle encoder (MPS MA702) and features rich connectivity. +[Tinymovr is an affordable motor controller](https://tinymovr.com) with integrated encoder and CAN bus for precise control of 3-phase brushless motors (PMSMs). This repository holds the open source firmware, client library, hardware designs and documentation source. From 8b1f5ee14c10ea2bc5fada34f51dab673c8345a7 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Sat, 17 Feb 2024 13:36:30 +0200 Subject: [PATCH 18/20] test iteratively --- studio/Python/tests/test_dfu.py | 38 +++++++++++++++++---------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/studio/Python/tests/test_dfu.py b/studio/Python/tests/test_dfu.py index c560b576..031626b7 100644 --- a/studio/Python/tests/test_dfu.py +++ b/studio/Python/tests/test_dfu.py @@ -39,24 +39,26 @@ def setUp(cls): def test_dfu(self, node_id=1): init_tee(self.can_bus) time.sleep(0.5) - tm = create_device(node_id=node_id) - tm_hash = tm.protocol_hash - tm.enter_dfu() - time.sleep(0.5) - bl = create_device(node_id=node_id) - bl_hash = bl.protocol_hash - bl.reset() - time.sleep(0.2) - tm = create_device(node_id=node_id) - tm_hash2 = tm.protocol_hash - tm.reset() - time.sleep(0.2) - tm_hash3 = tm.protocol_hash - self.assertNotEqual(tm_hash, 0) - self.assertEqual(tm_hash, tm_hash2) - self.assertEqual(tm_hash, tm_hash3) - self.assertNotEqual(tm_hash, bl_hash) - time.sleep(0.2) + for i in range(10): + print("Testing DFU iteration ", i+1) + tm = create_device(node_id=node_id) + tm_hash = tm.protocol_hash + tm.enter_dfu() + time.sleep(0.5) + bl = create_device(node_id=node_id) + bl_hash = bl.protocol_hash + bl.reset() + time.sleep(0.2) + tm = create_device(node_id=node_id) + tm_hash2 = tm.protocol_hash + tm.reset() + time.sleep(0.2) + tm_hash3 = tm.protocol_hash + self.assertNotEqual(tm_hash, 0) + self.assertEqual(tm_hash, tm_hash2) + self.assertEqual(tm_hash, tm_hash3) + self.assertNotEqual(tm_hash, bl_hash) + time.sleep(0.2) @classmethod def tearDownClass(cls): From c7b6dbf68ce28e6e1d6e9fc31c878388847a56d8 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Sat, 17 Feb 2024 13:36:46 +0200 Subject: [PATCH 19/20] use zero hash for initial communitacion --- studio/Python/tinymovr/config/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/studio/Python/tinymovr/config/config.py b/studio/Python/tinymovr/config/config.py index e0655ba8..6f72b1a9 100644 --- a/studio/Python/tinymovr/config/config.py +++ b/studio/Python/tinymovr/config/config.py @@ -76,7 +76,7 @@ def create_device(node_id): tmp_hash = list(specs["hash_uint32"].keys())[0] tmp_spec = specs["hash_uint32"][tmp_hash] node = deserialize(tmp_spec) - chan = CANChannel(node_id, (tmp_hash & 0xFF)) + chan = CANChannel(node_id, 0) node._channel = chan # Check for the correct spec using the remote hash From ce916708f9c21c96a13d29b0e11381849e469ad7 Mon Sep 17 00:00:00 2001 From: Yannis Chatzikonstantinou Date: Sat, 17 Feb 2024 13:46:46 +0200 Subject: [PATCH 20/20] update bootloader --- firmware/bootloader/bootloader-M51.bin | Bin 3716 -> 3724 bytes firmware/bootloader/bootloader-R32.bin | Bin 3748 -> 3756 bytes firmware/bootloader/bootloader-R33.bin | Bin 3748 -> 3756 bytes firmware/bootloader/bootloader-R50.bin | Bin 3700 -> 3708 bytes firmware/bootloader/bootloader-R51.bin | Bin 3700 -> 3708 bytes firmware/bootloader/bootloader-R52.bin | Bin 3716 -> 3724 bytes 6 files changed, 0 insertions(+), 0 deletions(-) diff --git a/firmware/bootloader/bootloader-M51.bin b/firmware/bootloader/bootloader-M51.bin index ee975015ce496d568ab67ec84ced54f213c8b212..0945a943619972d42fa955cdc9502df39bcb43c8 100755 GIT binary patch delta 1070 zcmbu8Uu;WJ9LImB_qM(5+Vxf~{%oDgjBfR3HKBMQ8+WU!3Gp{%jZ9QX+;}kwY5iGv zpe9FRghaxl2e#ZXQr)sd!h)3-FR}^Agpj*b(xbLrze^v+o4Cm*-`~IUJLh*!?iufS zZ#*i1R3ZRa5gSs3I1v}}_vfAz^PpX60WhQf2dn;V@gEyrdU&lgG}hnQo3%=(>-fyB z@>iYX)g5WSQn~@OQ}i$?As1;ISx3t00I4X;)i2)|43EZw8;01o;l6C5glI04S9vK6 zIH=t;D=sW(dchzu#CnHUMfwEOfP=kap-QpKl8vXX+iKSoHkqMGGmd8%yAfOeI>i2xm!Z{(2mVTD@zbiGO{)Esiy65`lcLb5H1wG} z%4rM#DzJHi50}RJv%Q;3O*_(a6fqUU5sWbfRnL9ao4(ytK#SzrNKl<8fwq?JH!rT7 znkRS^h=UZVZ`@=Isi;S~L0if6+@0~g-NlWdmD5M&`Q$5oZ(is&dYaaIVx-m+)pIS6 z57F6{Teb_|1F|1`9;44KTS$V=w))*?A458U)g-*5RcSz*?y;`M+zsn3rw^~qxMYLt zT@m3ZiC3c8%s_i<`mGlVy04&H3;7cT-&XK#-0%7W7!NE8ELws;)$s{EPEZMa>+}0d!)P(}^32SUZdXX0qvxK|v?H(#`{R2UHMVd^ov1o9{9H-abKCSaJ%+|~sfR56 V(3x0}&4?)?jg1)fT|Vb-@)KLtIo<#O delta 1084 zcmbu8T}TvB6vxlqnQ^Ceciqhdaa|kIQraxHHPCv<4;r<#j6$$TS|n(Mq)`MVf?YAm zs35sL*vErmj|HNQVX&@Y4~9gpz0^Z!5F`~evdNC?$8@GP65pab{5bcV`QLNTJ$L4& z`>H!A@gQ(KK->(ljI1DQh>mO?1a*G~gY%3OfF;!Z2Z#P`F}HEEzUTK`^{bP^6EU;U zUBO1r#zIbDCpK8AlQbGFy4;7JIhJr!}7REi(ciCc9;Y6Yb(Qk&Eha8-35Xg7=q;q8mLck+4 zLP?lcW;Eh}PEbE3j6AGbOnSxCo1fqV4Rg z_slx$cS)16iIXlV=@Rj!2lRN;csuo`3~uRK z_KF_Nd7XYpIYoM@*X(ijj6iIqlrX^Z(VzI$RGv}Iynjax8yG}6d-kYJw) zgmW6GjTkblGike$@xrA4G3h&*-@2Bh-;CC~7a#nMuB_`pf|kGn^MdQo@iPF;$aUlZ z@&tK?yhXkv919l6z)pIQ%8}ES8iF6dV5&k|=xJ+}rxW*P3LZp=zfuz%a+Tp1DNbzn zjf$QjR?LdFjoND*JM{PzeP#8Q7hC_Q| SQAd~vtDgakH6ul~v*afr^I1j! diff --git a/firmware/bootloader/bootloader-R32.bin b/firmware/bootloader/bootloader-R32.bin index 082c9f793082647e7a4fc775d4f105db0d238af6..8409f60e0454ae2721e1b3ebc62e8a64568da6e1 100755 GIT binary patch delta 1099 zcmbu8U1$?o6vxk7SJ8*5urwXv&4MYI;D$!4`;Q3M5pD2%8uxG$Bm zB#VkZXsq6s7E}a%^r2d&HV^3s1z}ln8-36hX+@#+1H2_dZnC!H84YalO&s{~Kj+;4 zxp(fpGq?SB{E4^>YDfkMAoWNC(u4$&ub)+mYHKiVa{~N=`W=JfFIQ~bm9crN)PVP3&+{44+C zrYnTngxuWuh(mIUk4hqMuaCLC7)O!#q2ga3Q=IgsxB$M% zIX%TiMJ`Wq31qjcvWCgt6n8+1JC&MId$dd$o~!WspN$7$@=1D0tSZ{Y8{@hLY`zEq zcQjzo0YP2$c0nA-%(628<=f6lpq@qg5D7r-MLmHWK`tN{>AbM9Vi-GGGN0?TO>C{r z6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