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

CH558L unresponsive after first flash #162

Closed
dirkx opened this issue May 16, 2024 · 7 comments
Closed

CH558L unresponsive after first flash #162

dirkx opened this issue May 16, 2024 · 7 comments

Comments

@dirkx
Copy link

dirkx commented May 16, 2024

Although the datasheet suggests the right boot pin (P5.1/DP), etc -- the CH558L does not seem to respond after its initial (successful) flash.

dch559 % ..../vnproch55x -r 2 -t CH558 -c 1 Blink.ino.hex 
------------------------------------------------------------------
CH55x Programmer by Deqing
Updated on: 2023/10/10
------------------------------------------------------------------
usbRertySeconds 2
target: CH558
config bytes: 1
Load file as hex
   Loaded 4919 bytes between: 0000 to 1382
DeviceVersion of CH55x: 2.40 
MCU ID: 58 11
Found Device CH558
Bootloader: 2.4.0
ID: 20 3C 4E BC
XOR Mask: 66 66 66 66 66 66 66 BE 
Write 4995 bytes from bin file.
..................................................
Write complete!!!
Verify chip
..................................................
Verify complete!!!
------------------------------------------------------------------
Reset OK
dch559 % ..../vnproch55x -r 2 -t CH558 -c 1 Blink.ino.hex 
------------------------------------------------------------------
CH55x Programmer by Deqing
Updated on: 2023/10/10
------------------------------------------------------------------
usbRertySeconds 2
target: CH559
config bytes: 1
Load file as hex
   Loaded 4962 bytes between: 0000 to 13AE
No CH55x USB Found, retry...
...
Found no CH55x USB
Time limit reached, exit process

it does appear fine on the USB bus though:

Bus 004 Device 023: ID 1209:c550 Generic 

Does this ring a bell with anyone ?

@DeqingSun
Copy link
Owner

The upload tool will change setting to a CH559, but not on CH558

https://github.com/DeqingSun/vnproch551/blob/bd6a1a85be100bda11a7ddc3db55691bf40468cf/main.cpp#L503

So your CH558L kept the factory settings. And you can try another boot pin P4.6 down.

Also the 1209:c550 means the USB stack for CDC is working. You can just set serial port to it and it can automatically go to bootloader in upload process.

@dirkx
Copy link
Author

dirkx commented May 16, 2024

Ah - understood. And indeed that works. Will see if I can modify main.cpp/503 to also work for the CH558L.

The USB-CDC stack for the default Blinken appears as /dev/ttyAMC0 (1209:c550) as opposed to the 4348:55e0 when it is powered up with boot pressed (in my case P5.1 to 3V3). And this /dev/ttyAMC0 (1209:c550) behaves as a serial port.

Can this serial port be brought into boot loader mode without a powercycle ? i.e. programatically ?

@dirkx dirkx closed this as completed May 16, 2024
@DeqingSun
Copy link
Owner

@dirkx Yes, it can be done in default Arduino way, open and close port at 1200bps. And if you choose that port in Arduino IDE and press Upload, it will be done automatically.
Code is located at

void setControlLineStateHandler() {

@DeqingSun
Copy link
Owner

@dirkx I also tried to modify the code with a text editor and Github action compiled the binary. The code is not tested on hardware, but it will likely solve your CH558 problem.

commit:
DeqingSun/vnproch551@c073316

Binary:
linux_arm64_build.zip
win_build.zip
mac_build.zip
linux_build.zip

@dirkx
Copy link
Author

dirkx commented May 16, 2024 via email

@dirkx
Copy link
Author

dirkx commented May 17, 2024

@dirkx Yes, it can be done in default Arduino way, open and close port at 1200bps. And if you choose that port in Arduino IDE and press Upload, it will be done automatically. Code is located at

void setControlLineStateHandler() {

Thanks - for splendidly (will try to make a pull request for the right menu/config settings).

@dirkx
Copy link
Author

dirkx commented May 17, 2024

Added PR #163 with the changes that made it all work automatically from within the Arduino environment (as opposed to tweaking things from the command line).

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