Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get ch55x's Unique ID #39

Closed
wukongxuetang opened this issue Feb 23, 2021 · 3 comments
Closed

How to get ch55x's Unique ID #39

wukongxuetang opened this issue Feb 23, 2021 · 3 comments

Comments

@wukongxuetang
Copy link

how to get ch55x's Unique ID?

@DeqingSun
Copy link
Owner

  USBSerial_print_ub(*(__code uint8_t*)(0x3FFC), HEX);
  USBSerial_print_c(' ');
  USBSerial_print_ub(*(__code uint8_t*)(0x3FFD), HEX);
  USBSerial_print_c(' ');
  USBSerial_print_ub(*(__code uint8_t*)(0x3FFE), HEX);
  USBSerial_print_c(' ');
  USBSerial_print_ub(*(__code uint8_t*)(0x3FFF), HEX);
  USBSerial_print_c(' ');
  USBSerial_print_ub(*(__code uint8_t*)(0x3FFA), HEX);
  USBSerial_print_c(' ');
  USBSerial_print_ub(*(__code uint8_t*)(0x3FFB), HEX);
  USBSerial_print_c(' ');
  USBSerial_println();

I get

3 C0 BC 4C 31 52

@nerdralph
Copy link

nerdralph commented Feb 24, 2021

0x3FFB isn't part of the unique ID. The datasheet says it is reserved "保留", though it seems to be used for the chip ID, just like SFR CHIP_ID at address 0xA1. With a CH551, this should output 51.
p.s.:
I just tried it on a CH551, and it looks like I'm wrong about 0x3FFB being the same as CHIP_ID. here's what I get:
98 B0 4B 47 9D 32

@wukongxuetang
Copy link
Author

I am using ch552,Test the code,I get 1C 7E 80 58 31 52;
I test another ch552g,get uid is 03 7E 80 58 55 5A,0x3FFB value is 5A,not same with chip_id,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants