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

CH552T upload problems #44

Closed
hexesdesu opened this issue Mar 30, 2021 · 14 comments
Closed

CH552T upload problems #44

hexesdesu opened this issue Mar 30, 2021 · 14 comments

Comments

@hexesdesu
Copy link

When I tried to upload a blink demo to a CH552T chip, I got:

------------------------------------------------------------------
CH55x Programmer by VNPro
------------------------------------------------------------------
Load file as hex
   Loaded 4393 bytes between: 0000 to 1156
Not support

2021-03-30 203417

(failed to upload the project)

But with the same code, CH551G and CH522G works just fine.

Then I export the hex file and upload it by WCHISPTool, and it works.

Maybe it's a VNPro compatible problem?

@DeqingSun
Copy link
Owner

@hexesdesu Are you using an early version of ch55xduino? Please update to the newest version and try again. It may work or it will show you more info to troubleshoot.

@hexesdesu
Copy link
Author

@hexesdesu Are you using an early version of ch55xduino? Please update to the newest version and try again. It may work or it will show you more info to troubleshoot.

Well, it's the newest 0.0.9 version downloaded by Arduino board manager.
You've inspired me and I will try a lower version.

@DeqingSun
Copy link
Owner

DeqingSun commented Mar 31, 2021

@DeqingSun

That is quite weird, I tried it again in windows, and it shows the bootloader ID and chip ID. Even there is a error message, the ID should be printed first.

Also, the newer upload tool will not just say "not support". It will give you a reason.

Maybe you can delete the board support file completely, include the caching zip files and install again.

Screen Shot 2021-03-30 at 9 13 49 PM

@hexesdesu
Copy link
Author

hexesdesu commented Mar 31, 2021

@DeqingSun

That is quite weird, I tried it again in windows, and it shows the bootloader ID and chip ID. Even there is a error message, the ID should be printed first.

Also, the newer upload tool will not just say "not support". It will give you a reason.

Maybe you can delete the board support file completely, include the caching zip files and install again.

Screen Shot 2021-03-30 at 9 13 49 PM

Yep I tried CH551G and CH552G and they do show the bootloader ID and chip ID, only my CH552T are not.

I tried to install Arduino in a new PC and I got the same.

I got these chips from Xianyu, which the seller claimed that they are shipped by szlcsc. And it can be upload by WCHISPTool, so I don't think it was a chip failure.

I bought some new chips from Taobao in order to figure how this could be happened.

@DeqingSun
Copy link
Owner

That really weird. I do have some CH552T and there is no difference from the CH552G at all.
And the new tool has no string "Not support". Such a string only exist in the old version of tools.
By the way, can you upload hex with https://deqingsun.github.io/ch55xduino/bootloaderWebtool/ ?

@hexesdesu
Copy link
Author

hexesdesu commented Mar 31, 2021

That really weird. I do have some CH552T and there is no difference from the CH552G at all.
And the new tool has no string "Not support". Such a string only exist in the old version of tools.
By the way, can you upload hex with https://deqingsun.github.io/ch55xduino/bootloaderWebtool/ ?

It says MCU family Not support :(

So the chip is a new family that have WCHISPTool support but not vnproch55x?

I uncomment console.log and got :[[ArrayBufferData]]: "0x314400e08010"

@hexesdesu
Copy link
Author

That really weird. I do have some CH552T and there is no difference from the CH552G at all.
And the new tool has no string "Not support". Such a string only exist in the old version of tools.
By the way, can you upload hex with https://deqingsun.github.io/ch55xduino/bootloaderWebtool/ ?

modified ch55xbl.js

    await device.transferOut(endpointOut, (new Uint8Array(bootloaderDetectCmd)).buffer)
    //await device.transferOut(endpointOut, (new Uint8Array(bootloaderIDCmd)).buffer)
    result = await device.transferIn(endpointIn, 64);  
    resultUint8 = new Uint8Array(result.data.buffer)
    bootloaderDeviceID = resultUint8[4]
    console.log(result.data.buffer);
    console.log(resultUint8[4]);
    console.log(resultUint8[5]);

image

And got definitely creepy response...

@DeqingSun
Copy link
Owner

DeqingSun commented Mar 31, 2021

@hexesdesu
I check another uploader repo https://github.com/ole00/chprog . It seems the V1 version of the bootloader returns 2 bytes instead of 6. Since you get the chip from a flee market. It is likely you get a old chip with old bootloader.

I never get a chance to get the old version bootloader to test, so the upload tool in my repo don't support that version. You may get a newer chip or use a tool support V1 version of the bootloader.

@hexesdesu
Copy link
Author

@hexesdesu
I check another uploader repo https://github.com/ole00/chprog . It seems the V1 version of the bootloader returns 2 bytes instead of 6. Since you get the chip from a flee market. It is likely you get a old chip with old bootloader.

I never get a chance to get the old version bootloader to test, so the upload tool in my repo don't support that version. You may get a newer chip or use a tool support V1 version of the bootloader.

Ok I checked my bootloader version in WCHISPTool
CH552T:
image
CH552G:
image
and it seem to be in a lower bootloader version(1.0)

I'm gonna try if I can upgrade it by myself, or bypass the code check.
Thank you for your works on my problems. glhf

@DeqingSun
Copy link
Owner

You can not bypass the code check in my uploader, because the protocols are different. I would recommend using another tool to upload.

@hexesdesu
Copy link
Author

Maybe I can use chprog instead of vnproch551 in arduino?

@DeqingSun
Copy link
Owner

If you can make it accept hex file, yes.
Refering to https://github.com/DeqingSun/vnproch551/blob/master/KT_BinIO.cpp for hex file parsing.
And if you successfully get it working. Share the solution to help other people.

@hexesdesu
Copy link
Author

Ye I'm gonna try. It's my first time hacking Arduino so it may take a long time.

@DeqingSun
Copy link
Owner

You don't need to hack Arduino, just make the chprog to accept the same parameters to the vnproch551, and replace the one in the tool folder.

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

2 participants