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

[Question] Cannot receive ACK after synchronization #108

Open
dmitriy-serdyuk opened this issue Jan 6, 2021 · 2 comments
Open

[Question] Cannot receive ACK after synchronization #108

dmitriy-serdyuk opened this issue Jan 6, 2021 · 2 comments

Comments

@dmitriy-serdyuk
Copy link

I am trying to flash a device with cc2640R2F chip. This chip is connected to HID-to-UART interface CP2110.

I was able to establish a UART connection through HID using code based on this. Here is a proxy serial interface I give instead of self.sp.

The example program loaded into CC2640 responds successfully:

>>> d.write(b'AT\r\n')
>>> while True:
...    print(d.read().decode('latin1'), end='')
AT
OK
<....> scanning

Unfortunately, it doesn't respond in the bootloader mode:

>>> cp2110_serial.setDTR(0)  # it looks that my bootloader pin is inverted
+DATM
>>> time.sleep(1)
>>> cp2110_serial.setRTS(0)  # go to sleep. reset pin also inverted??
>>> cp2110_serial.setRTS(1)  # wake up
>>> time.sleep(1)
>>> cp2110_serial.setDTR(1)
>>> cp2110_serial.write([0x55, 0x55])  # no response

What is interesting is that after I reset, it sends an ACK byte and then loads from flash

>>> cp2110_serial.setRTS(0)
>>> cp2110_serial.setRTS(1)
>>> while True:
...    r = d.read()
...    if not r:
...        continue
...    print(r, end='')
b'\x00\x33'
<....> # scanning

Any clues what is happening here? I appreciate any pointer.

@JelmerT
Copy link
Owner

JelmerT commented Jan 20, 2021

Do you have any schematics of the device?

Are you sure DTR and RTS pins are connected to the correct bootloader and reset pins on the cc2640R2F?

It looks like the bootloader is not being started. But the ack byte after the reset is interesting. Are you sure the bootloader is enabled and uses the correct pins in the firmware that's running on the cc2640R2F?

@dmitriy-serdyuk
Copy link
Author

dmitriy-serdyuk commented Jan 20, 2021

Yeah, here CC264 Dongle v02 Schematics.pdf. I am pretty sure that the pins are correct. According to the PDF, the reset pin is connected to GPIO.8 and the bootloader pin to GPIO.9. This corresponds to flicking a bit number 13 and 12 respectively.

And according to this page 33, GPIO8 corresponds to the bit number 12 and GPIO9 to 13. Flicking the reset pin I observe that the factory program stops and resets. Flicking the bootloader pin, the factory program goes into some special regime (prints +DATM).

Are you sure the bootloader is enabled and uses the correct pins in the firmware that's running on the cc2640R2F?

I am not sure. Maybe they forgot to enable it at the factory? Is there a way to test this?

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