DA14681 development kit -basic, QSPI program issue

7 posts / 0 new
Last post
howardwong
Offline
Last seen:4 years 4 months ago
Joined:2016-11-04 08:56
DA14681 development kit -basic, QSPI program issue

Dear Dialog,

I am studying DA14681 development kit -Basic with the following software & tools
——SmartSnippets某o v1.2.3.588
-- DA1468x_SDK_BTLE_v_1.0.6.968

I tried to follow section 6 of UM-B-056 to build the Peripheral Demo Application & program the QSPI flash memory(use program_qspi_serial_win). It is successful in the first time(can see the output message with Tera Term after reset). However, it seems it cannot be programmed anymore if I want to program other demo code or the same Peripheral Demo Application. It always reports the error below when it tries to upload boot loader/application executable, do you have any idea on it?

"Could not connect to device.
Write executable failed: 2nd stage bootloader rejected (-105)"

thanks a lot!
HowardWong

The log message:
.......................................................................................................................
..
.. QSPI PROGRAMMING
..
.......................................................................................................................

Please enter your COM port number and press enter.
-> 137

COMPORT=COM137

D:\workspace\workspace_SmartSnippets_Studio\DA1468x_SDK_BTLE_v_1.0.6.968\utilities\scripts\qspi>CALL "..\..\..\binaries\cli_programmer.exe" --prod-id DA14681-01 --enable-uart y --ram-shuffling 0 COM137 write_qspi_exec D:\workspace\workspace_SmartSnippets_Studio\DA1468x_SDK_BTLE_v_1.0.6.968\projects\dk_apps\demos\peripherals_demo\DA14681-01-Release_QSPI\peripherals_demo.bin
cli_programmer 1.22
Copyright (c) 2016 Dialog Semiconductor

Using serial port COM137 at baud rate 57600.
bootloader file not specified, using internal uartboot.bin

Connecting to device...
Setting serial port baud rate to 57600.
Press RESET.
Uploading boot loader/application executable...
Could not connect to device.
Write executable failed: 2nd stage bootloader rejected (-105)

.......................................................................................................................
..
.. FINISHED
..
.......................................................................................................................

Device:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi howardwong,

Hi howardwong,

This is something that came up when using older revision chips or older SDKs, can you please have a look at the chip and report what is the indication on the package or try to download the a fresh copy of the SDK from the support site in case you are using an older one ? Also please make sure that the COM that you are using is the one that should be used, when the pro kit is attached use the COM port with the smaller number among the two ports that appear on the device manager. Additionally i can see the 137 in your com port assignment, can also try to clean up previous registered com ports, perhaps this is causing you some problems as well.

Thanks MT_dialog

howardwong
Offline
Last seen:4 years 4 months ago
Joined:2016-11-04 08:56
Dear Dialog,

Dear Dialog,

Thanks a lot for your quick response. I am testing with DA14681 Development Kit -Basic (please see the attached picture), the chip is "DA14681 0100 1627NCAA". The SDK I used is DA1468x_SDK_BTLE_v_1.0.6.968 which I just downloaded from the support site a few days ago. Is it OK?

I also tried to assign a smaller COM port for the Jlink CDC UART Port, but it still got the same issue.

thanks
Howard

the log message:
.......................................................................................................................
..
.. QSPI PROGRAMMING
..
.......................................................................................................................

Please enter your COM port number and press enter.
-> 28

COMPORT=COM28

D:\workspace\workspace_SmartSnippets_Studio\DA1468x_SDK_BTLE_v_1.0.6.968\utilities\scripts\qspi>CALL "..\..\..\binaries\cli_programmer.exe" --prod-id DA14681-01 --enable-uart y --ram-shuffling 0 COM28 write_qspi_exec D:\workspace\workspace_SmartSnippets_Studio\DA1468x_SDK_BTLE_v_1.0.6.968\projects\dk_apps\demos\peripherals_demo\DA14681-01-Release_QSPI\peripherals_demo.bin
cli_programmer 1.22
Copyright (c) 2016 Dialog Semiconductor

Using serial port COM28 at baud rate 57600.
bootloader file not specified, using internal uartboot.bin

Connecting to device...
Setting serial port baud rate to 57600.
Press RESET.
Uploading boot loader/application executable...
Write executable failed: 2nd stage bootloader rejected (-105)
Could not connect to device.

.......................................................................................................................
..
.. FINISHED
..
.......................................................................................................................

Attachment:
MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi howardwong,

Hi howardwong,

Since you have the basic kit of the 681 make sure that the jumpers on the J13 are placed at the proper position. If the problem still persists, try to have the reset button pressed and release it when the "Connecting to device...." indication pops up. Seems that the basic kit has this issue since i can replicate what you are experiencing. I will check with the team and let you know for any further guidance.

Thanks MT_dialog

howardwong
Offline
Last seen:4 years 4 months ago
Joined:2016-11-04 08:56
Dear Dialog,

Dear Dialog,

Thanks a lot for your reply. I checked that it can be programmed successfully sometimes if have the reset button pressed and release it when the "Connecting to device...." . However, it still fails most of times I tried (~90% NG).

thanks
Howardwong

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi howardwong,

Hi howardwong,

正如前面提到的,我复制你的这个问题is something that we are checking, what you can also try in order to increase the success rate on your downloading attemps (at least it works on my side) is to try to download via UART and try again immediatelly after the first attemp fails. By doing this the programming success should be about 50% (since on the second attempt it downloads the code with no error) or you can use the JTAG script in order to download code to the basic kit.

Thanks MT_dialog

MT_dialog
Offline
Last seen:2 months 2 weeks ago
Staff
Joined:2015-06-08 11:34
Hi howardwong,

Hi howardwong,

Got some feedback from the hw team. Seems that this issue is caused because of the Segger chip only on the basic kit (since the pro kit uses an FTDI for the UART interface). The root cause of this is the Segger firmware, which doesn't initialize the UART pins at start up, and the initialization occurs when the first data is sent out. While initializing the port the driver will toggle once before sending data, and this is interpreted from the bootlaoder either as a framing error or as a break condition, causing it to hang. The second time you try to donwload fw the port is allready initialized and the booting works ok.

So there a couple of workarounds on this:

1) You can either program your device twice, one will fail and the other one will succeed.

2) You can add the following command "@echo a > COM%comprtnr%" at the scripts\qspi\program_qspi_serial.bat, please check bellow for the exact location that the line should be placed:

@echo.
= COM % comprtnr % @echo相称
@echo a > COM%comprtnr% <---additional command that should be placed
@echo on

Thanks MT_dialog