diff --git a/.github/workflows/build_fw.yml b/.github/workflows/build_fw.yml index 1ebca20..5d13f6a 100644 --- a/.github/workflows/build_fw.yml +++ b/.github/workflows/build_fw.yml @@ -48,10 +48,17 @@ jobs: value=$(grep '#define VERSION' src/version.h | awk -F '"' '{print $2}') echo "version=$value" >> $GITHUB_OUTPUT + - name: Get Release tag + id: get_tag + shell: bash + run: | + value=${GITHUB_REF#refs/tags/} + echo "tag=$value" >> $GITHUB_OUTPUT + - name: Get last commit message id: get_commit_message run: | - currentTag=${GITHUB_REF#refs/tags/} + currentTag=${{ steps.get_tag.outputs.tag }} badgeText="![GitHub Downloads](https://img.shields.io/github/downloads/xyzroe/XZG/${currentTag}/total)" printf -v badgeTextWithNewlines "%s\n\n" "$badgeText" commitMessage=$(git log -1 --pretty=%B | tail -n +2) @@ -100,7 +107,7 @@ jobs: -d chat_id="${{ secrets.TELEGRAM_CHAT_ID }}" \ -d parse_mode="MarkdownV2" \ -d message_thread_id=14 \ - -d text="[${{ steps.get_version.outputs.version }}](https://github.com/${{ github.repository }}/releases/tag/${{ steps.get_version.outputs.version }})" \ + -d text="[${{ steps.get_tag.outputs.tag }}](https://github.com/${{ github.repository }}/releases/tag/${{ steps.get_tag.outputs.tag }})" \ -d link_preview_options='{ "show_above_text": true, "prefer_large_media": false diff --git a/lib/CCTools/src/CCTools.cpp b/lib/CCTools/src/CCTools.cpp index b093da6..7f75a4a 100644 --- a/lib/CCTools/src/CCTools.cpp +++ b/lib/CCTools/src/CCTools.cpp @@ -476,7 +476,7 @@ bool CCTools::begin(int CC_RST_PIN, int CC_BSL_PIN, int BSL_PIN_MODE) if (!_sendSynch()) { - //DEBUG_PRINT("NO BEGIN ANSWER"); + // DEBUG_PRINT("NO BEGIN ANSWER"); return false; } @@ -598,8 +598,12 @@ bool CCTools::detectChipInfo() String chip_str; if (protocols & PROTO_MASK_IEEE == PROTO_MASK_IEEE) - { - chip.hwRev = _getChipDescription(chip_id, wafer_id, pg_rev); + { + uint32_t test = 360372; + //Serial.print(test, HEX); + byte *b_val = _cmdMemRead(test); + + chip.hwRev = _getChipDescription(chip_id, wafer_id, pg_rev, b_val[1]); int page_size = 4096; if (chip.hwRev.indexOf("P7")) { @@ -607,6 +611,24 @@ bool CCTools::detectChipInfo() } chip.flashSize = flash_size[0] * page_size; + test = chip.flashSize - 88 + 0xC; + Serial.print(test, HEX); + b_val = _cmdMemRead(test); + Serial.print(" MODE_CONF: "); + Serial.print(b_val[0], HEX); + Serial.print(b_val[1], HEX); + Serial.print(b_val[2], HEX); + Serial.println(b_val[3], HEX); + + uint32_t bsl_adr = chip.flashSize - 88 + 0x30; + Serial.print(bsl_adr, HEX); + byte *bsl_val = _cmdMemRead(bsl_adr); + Serial.print(" bsl_val: "); + Serial.print(bsl_val[0], HEX); + Serial.print(bsl_val[1], HEX); + Serial.print(bsl_val[2], HEX); + Serial.println(bsl_val[3], HEX); + return true; } return false; diff --git a/lib/CCTools/src/CCTools.h b/lib/CCTools/src/CCTools.h index 1f21f17..896fdc1 100644 --- a/lib/CCTools/src/CCTools.h +++ b/lib/CCTools/src/CCTools.h @@ -72,7 +72,7 @@ class CommandInterface } } - const char *_getChipDescription(uint32_t chip_id, uint32_t wafer_id, uint8_t pg_rev) + const char *_getChipDescription(uint32_t chip_id, uint32_t wafer_id, uint8_t pg_rev, uint8_t mode_cfg) { if (chip_id == 0xb964 || chip_id == 0xb965) @@ -98,9 +98,17 @@ class CommandInterface { return "CC2652P7"; } + else if (chip_id == 0x3202 && wafer_id == 0xBB41 && pg_rev == 0x3 && mode_cfg == 0xC1) + { + return "CC2652P2_launchpad"; + } + else if (chip_id == 0x3202 && wafer_id == 0xBB41 && pg_rev == 0x3 && mode_cfg == 0xFA) + { + return "CC2652P2_other"; + } else if (chip_id == 0x3202 && wafer_id == 0xBB41 && pg_rev == 0x3) { - return "CC2652P"; + return "CC2652P2_?"; } else if (chip_id == 0x3102 && wafer_id == 0xBB41 && pg_rev == 0x3) { @@ -109,8 +117,8 @@ class CommandInterface else { static char unknownDescription[50]; - sprintf(unknownDescription, "Unknown (C: %X, W: %X, P: %X)", - chip_id, wafer_id, pg_rev); + sprintf(unknownDescription, "Unknown (C: %X, W: %X, P: %X, M: %X)", + chip_id, wafer_id, pg_rev, mode_cfg); return unknownDescription; } } diff --git a/src/websrc/js/functions.js b/src/websrc/js/functions.js index c2545a7..043aa37 100644 --- a/src/websrc/js/functions.js +++ b/src/websrc/js/functions.js @@ -1521,7 +1521,7 @@ function findAllVersionsSorted(data, chip) { const categories = ['router', 'coordinator', 'thread']; const result = {}; - const chipMap = { "CC2652P": "CC2652P2_launchpad", "CC2652P7": "CC2652P7", "CC2652RB": "CC2652RB" }; + const chipMap = { "CC2652P2_launchpad": "CC2652P2_launchpad", "CC2652P2_other": "CC2652P2_other", "CC2652P7": "CC2652P7", "CC2652RB": "CC2652RB" }; const deviceName = chipMap[chip]; if (!deviceName) throw new Error("Unsupported chip type or deviceName not set.");