Skip to content

Commit

Permalink
20240507
Browse files Browse the repository at this point in the history
Web UI:
- Automatic Zigbee OTA for corresponding Zigbee module

Code:
- Add RfStar (lauchpad) and Ebyte (others) identifying for CC2652P2
  • Loading branch information
xyzroe committed May 7, 2024
1 parent d299587 commit 07d2384
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 10 deletions.
11 changes: 9 additions & 2 deletions .github/workflows/build_fw.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
28 changes: 25 additions & 3 deletions lib/CCTools/src/CCTools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -598,15 +598,37 @@ 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"))
{
page_size = page_size * 2;
}
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;
Expand Down
16 changes: 12 additions & 4 deletions lib/CCTools/src/CCTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
{
Expand All @@ -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;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/websrc/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

Expand Down

0 comments on commit 07d2384

Please sign in to comment.