DeqingSun / ch55xduino

An Arduino-like programming API for the CH55X
GNU Lesser General Public License v2.1
433 stars 85 forks source link

CH554 support #147

Closed mcu23 closed 5 months ago

mcu23 commented 11 months ago

Hello,

Using ch554 chip and code upload possible at v0.0.17. Compile for ch552 and upload to ch554 no problem for vnproch55x application.

But error at v0.0.18 and v0.0.19. Detected MCU ID ( 54 11) mismatch while programming.

Would you consider official support for CH554 chip at newer version ?

Thanks

DeqingSun commented 11 months ago

@mcu23 Thanks for reporting. It looks weird as the source code treated CH554 the same way as CH552, can you paste the whole error message? Especially I want to see "Updated on" section.

mcu23 commented 11 months ago

CH552 Board selected but CH554 chip used on DIY circuit.

error1.txt

noError_v0.0_0_1_7.txt

DeqingSun commented 11 months ago

Thanks, the problem is cause by expecting an exactly the same part number, while CH551 should take CH552 & CH554, and CH552 should also take CH554.

https://github.com/DeqingSun/vnproch551/blob/896ee29c46aa842b55abeb57b5c19fef6998e766/main.cpp#L432

I'll try to fix it tonight.

DeqingSun commented 11 months ago

@mcu23 Please remove your CH55xduino package (should be able to do in board manager) and add 0.0.19 again.

The new version of upload tool should work with a print: "Updated on: 2023/10/09"

mcu23 commented 11 months ago

Thank you very much. Upload problem solved. CH554 programming OK. After "Verify complete!!!" additional error present. Send Detect: Fail, Reset: Fail Failed uploading: uploading error: exit status 1

But blink demo works as expected.

CDC serial device present at Device manager. This is simple blink demo. CDC added by ch55xduino stack for debugging?

Error_10_10_23.txt

DeqingSun commented 11 months ago

I have a feeling the last command of uploader tool to restart the chip did not get a proper response. The response may be lost in CH552 or windows side. But as long as you see "Verify complete!!!", the firmware is ready. And that is why you see a CDC device added by default CH55xduino settings.

Does the LED blink immediately after the fail message? If so the CH552 got the reboot command but the tool does not get respond. I'll do some test on my side. Which version of windows are you using?

mcu23 commented 11 months ago

Yes LED blink immediately after the fail message. Windows 7 used with DIY board. I thought CDC may added for debugging.

DeqingSun commented 11 months ago

@mcu23 DIY board may be a possible. Can you show you schematic and board picture? I'll also look for a win7 computer and v2.4.0 bootloader chip. If you have a logic analyzer or USB analyzer you can also try to monitor the communication at the end of upload process.

I'll also take a look into the code and maybe provide an debugging version for you.

mcu23 commented 11 months ago

I think, USB module ON by default. USB line pull up on? But no usb stack in blink hex? So Windows can effort for driver etc.

DeqingSun commented 11 months ago

Please try this upload tool. You can use this one to replace the old one come in the package as I found one code that might cause the issue.

You should see "Updated on: 2023/10/10"

win_build.zip

You may need to manually install serial driver on Win7, use Zadig tool to install CDC driver.

mcu23 commented 11 months ago

Thank you for new build. This content placed to ..Myusername\AppData\Local\Arduino15\packages\CH55xDuino\tools\MCS51Tools\2023.10.09\win (busybox.exe not changed)

After programming info: Error_10_10_23_2.txt

CDC ok. it's coming from Default settings.

DeqingSun commented 11 months ago

It seems the ch552 did receive the reboot signal but the computer did not even think the ch552 get it.

I'll try to see if I can reproduce the error.