JelmerT / cc2538-bsl

Python cross-platform script to upload firmware via the serial boot loader onto the CC13xx, CC2538 and CC26xx SoC.
BSD 3-Clause "New" or "Revised" License
529 stars 181 forks source link

--bootloader-sonoff-usb doesn't work as expected #151

Open rverstappen opened 10 months ago

rverstappen commented 10 months ago

I was setting up two Sonoff Dongle Plus (CC2652P + CP2102N) units to use as routers and I didn't want to open them up to press the bootloader button inside so I followed the directions to use the " --bootloader-sonoff-usb" option. No errors on the flashing but neither router could be found after several attempts on each. I decided to try the standard approach using the button and not the command line option and everything worked as expected.

I'm reporting this in case it helps anyone else having a similar problem.

sultanqasim commented 6 months ago

Fixed by https://github.com/JelmerT/cc2538-bsl/pull/173

unmesh59 commented 5 months ago

The --bootloader-sonoff-usb worked for me a year or so ago but doesn't any more

@rverstappen Could you say what the "standard approach using the button" entails?

@sultanqasim Where would I find the version of cc2538-bsl with your changes incorporated? And are there any other dependencies?

sultanqasim commented 5 months ago

@unmesh59 you can use my fork here: https://github.com/sultanqasim/cc2538-bsl

unmesh59 commented 5 months ago

@unmesh59 you can use my fork here: https://github.com/sultanqasim/cc2538-bsl

It didn't help. I'm wondering if my previous attempts to reflash the Sonoff-P have somehow bricked the device

sultanqasim commented 5 months ago

If it’s not entering bootloader mode at all (stuck at waiting for sync), then you’ve probably (soft) bricked the device through something you previously flashed. What were you flashing earlier? You can recover the device over JTAG/SWD if you have a XDS110 or Launchpad board handy.

unmesh59 commented 5 months ago

I've been only trying to flash the latest koenkk coordinator firmware

And I don't have either of the devices you mention

Is there a way to use a serial terminal to tell whether the device is in bootloader mode? I'm on Windows but could boot Linux if needed

sultanqasim commented 5 months ago

What's the exact file name you used from the Koenkk firmware? If you flashed anything other than CC1352P2_CC2652P_launchpad_coordinator_20230507.zip it would break things.

When you say cc2538-bsl doesn't work, what is the command line you are executing, and what is the output you're seeing?

unmesh59 commented 5 months ago

python cc2538-bsl-sq.py -p COM6 -evw CC1352P2_CC2652P_launchpad_coordinator_20230507.hex Opening port COM6, baud 500000 Reading data from CC1352P2_CC2652P_launchpad_coordinator_20230507.hex Your firmware looks like an Intel Hex file Connecting to target... ERROR: Timeout waiting for ACK/NACK after 'Synch (0x55 0x55)'

sultanqasim commented 5 months ago

That error message means it's failing to enter the bootloader. I noticed you didn't use the --bootloader-sonoff-usb command line option. Use my fork of cc2538-bsl with the --bootloader-sonoff-usb option in addition to the arguments to specified above.

unmesh59 commented 5 months ago

I had tried it with and without and accidentally pasted the latter :-(

Same result

sultanqasim commented 5 months ago

I had tried it with and without and accidentally pasted the latter :-(

Same result

Hmm, sounds like you’re locked out of the bootloader and would need to use JTAG to recover unfortunately.

unmesh59 commented 5 months ago

It's probably easier to buy a new one. This is my backup coordinator so I'm not in a great hurry.

Thanks

On Thu, May 9, 2024 at 6:09 PM Sultan Qasim Khan @.***> wrote:

I had tried it with and without and accidentally pasted the latter :-(

Same result

Hmm, sounds like you’re locked out of the bootloader and would need to use JTAG to recover unfortunately.

— Reply to this email directly, view it on GitHub https://github.com/JelmerT/cc2538-bsl/issues/151#issuecomment-2103672914, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIPPFCVVFSY2MAZH5WUFZCTZBQM5JAVCNFSM6AAAAABBBXSG4KVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMBTGY3TEOJRGQ . You are receiving this because you were mentioned.Message ID: @.***>

patriciogonzalezvivo commented 1 month ago

What's a "JTAG to recover"?