Short time dfu issues

Hi guys!

Right now I have my custom board which used nRF52833 SoC. There is only one reset button on custom board and dfu performed via uart.

I flashed four hex file : application( one LED blink), softdevice(s140), settings, bootloader uart .

I chose NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN and register way to enter dfu.

I changed NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN number to  dtr/rts  gpio pin on custom board. 

also I use pyserial in python to control dtr and rts when serial is opened. And dtr/rts status is used to simulate button press.

the python script was just like this:

import time
import serial

ser = serial.Serial('COM5', 115200)

ser.setRTS(0)
#time.sleep(2)
ser.setRTS(1)
#time.sleep(2)
ser.setRTS(0)

time.sleep(2)
ser.close()

My problem is that:

1.When I opened serial and press reset button .the hardware can entered dfu mode but once the serial is closed,  the hardware will back to application immediately.

2.I also try to change register and do reset in application when the hardware detect dtr/rts pin voltage change . The result was the same.

So can anyone tell me what caused this and how can dfu mode stay?

This is my first time try to raise question in nordic devzone.

Thanks in advance!

Related