How can I reset the DA14585 by batch after burning?

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
6 posts / 0 new
Last post
stanley_yeh
Offline
Last seen: 3 years 6 months ago
Joined: 2016-12-23 06:52
How can I reset the DA14585 by batch after burning?

Hi there,
I am using a batch file to burn the flash connected with DA14585 and following is my script...

SmartSnippets\SmartSnippetsToolbox.exe -type spi -chip DA14585-00 -jtag 60930xxxx -cmd write -firmware "SmartSnippets\common_resources\jtag_programmer_585.bin" -file "..\out_585\ble_app_peripheral_585.hex" -verify -bootable -y

It's working, but how can I reset the DA14585 after burning? Could you please tell me the script?

In addition, how can I list the jtag ID for user choosing in command line?

Thanks a lot.

Device: 
stanley_yeh
Offline
Last seen: 3 years 6 months ago
Joined: 2016-12-23 06:52
>> In addition, how can I

>> In addition, how can I list the jtag ID for user choosing in command line?

Sorry, I mean the jtag serial number actually.
Because we have many engineers here to develop the project, our serial numbers of J-Link are different and we usually have not only one J-Link.
If I can list the serial number for choosing and set to the -jtag parameter, that will be perfect.
Thanks.

MT_dialog
Offline
Last seen: 1 year 9 months ago
Staff
Joined: 2015-06-08 11:34
Hi stanley_yeh,

Hi stanley_yeh,

All the available cli commands for the 585 are documented in the Smart Snippets toolbox document ( UM-B-083, in order to find the document, go to the Help menu of the Smart Snippets toolbox and Open the User Guide.pdf), on page 79 you will be able to find all the available commands of the CLI for the DA1458x and DA14585/6 family chips. I dont see any reset command in available commands but i suppose that you could use the r command from the j-link commander tool in order to reset the device. As far as the listing the jtag devices again you should be able to use the SEGGER's tools for that.

Thanks MT_dialog

stanley_yeh
Offline
Last seen: 3 years 6 months ago
Joined: 2016-12-23 06:52
I find a way to reset DA14585

I find a way to reset DA14585 by using J-Link tool.
Sometimes it works, but if the flash is empty, I burn the code into it and execute the reset script, It doesn't work.

That's OK, I will reset it manually, but it is really inconvenient for our operator when producing.
I can't understand why doesn't SmartSnippets support the reset function?

In my batch file:
SET JLINK_PATH="SmartSnippets\common_resources\firmware_upload\JLink.exe"
%JLINK_PATH% -commanderscript JlinkReset.jlink

I create a file JlinkReset.jlink and write followings in it:
r
q

MT_dialog
Offline
Last seen: 1 year 9 months ago
Staff
Joined: 2015-06-08 11:34
Hi stanley_yeh,

Hi stanley_yeh,

Most probably the reason that the device doesn't properly reset when you issue the command after the flash is burned is because of the wrong mapping of the memory. When you are downloading data into the flash that means that you have fw (the flash programmer that is used in order to burn the flash) running on the 585 and thus you are running from the sysram. When you perform a reset without touching the mapping bit (x50000012->REMAP_ADR0) the device still has the flash programmer in the memory and its configured to have the sysram as address 0x0, so when you issue the r command from the Jlink you just keep reseting the device and the device starts from the sysram and not from the ROM code in order to start the bootloader and eventually boot from flash, so what you can do is:

  • Either after burning the flash issue a Jlink command w2 50000012 A4 in order for the mapping to be set in the ROM code and then issue a Jlink r command in order to reset the device, so the ROM memory is set to 0x0 and the bootloader will be executed upon reset.
  • Or you can directly set the reset bit of the system control register along with the remap bit in order for the device to start executing the bootloader with the command w2 50000012 80a4. 

Thanks MT_dialog

stanley_yeh
Offline
Last seen: 3 years 6 months ago
Joined: 2016-12-23 06:52
It works!! Thanks a lot.

It works!! Thanks a lot.