error 125, AGDI: memory write failed

⚠️
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//www.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
16 posts / 0 new
Last post
ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
error 125, AGDI: memory write failed

Hi ,

Im still new with programming firmware with keil and da14580DEVKT-B sdk board.

When i compile and debug previously , i have no problems running the sample code.

However after my Jlink firware upgrades , somehow when i debug, this error crop up :

*** error 125, line 10: AGDI: memory write failed (0x50000012)

下面是runn的输出ing debug in Keil.

Running with Code Size Limit: 32K
JLink项目文件设置为“C: \ \ DA1458x \ 5.0.4 \项目ects\target_apps\ble_examples\ble_app_peripheral\Keil_5\JLinkSettings.ini"* JLink Info: Device "CORTEX-M0" selected.

JLink info:
------------
DLL: V6.46d, compiled Jun 7 2019 17:33:40
Firmware: J-Link OB-SAM3U128 V1 compiled Jan 7 2019 14:05:40
Hardware: V1.00
S/N : 480063501

* JLink Info: Found SW-DP with ID 0x0BB11477
* JLink Info: Scanning AP map to find all available APs
* JLink Info: AP[1]: Stopped AP scan as end of AP map has been reached
* JLink Info: AP[0]: AHB-AP (IDR: 0x04770021)
* JLink Info: Iterating through AP map to find AHB-AP to use
* JLink Info: AP[0]: Core found
* JLink Info: AP[0]: AHB-AP ROM base: 0xE00FF000
* JLink Info: CPUID register: 0x410CC200. Implementer code: 0x41 (ARM)
* JLink Info: Found Cortex-M0 r0p0, Little endian.
* JLink Info: FPUnit: 4 code (BP) slots and 0 literal slots
* JLink Info: CoreSight components:
* JLink Info: ROMTbl[0] @ E00FF000
* JLink Info: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
* JLink Info: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
* JLink Info: ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
ROMTableAddr = 0xE00FF000
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via AIRCR.SYSRESETREQ.

Target info:
------------
Device: ARMCM0
VTarget = 3.300V
State of Pins: TCK: 0, TDI: 1, TDO: 1, TMS: 1, TRES: 1, TRST: 1
Hardware-Breakpoints: 4
Software-Breakpoints: 8192
Watchpoints: 2
JTAG speed: 2000 kHz

Load "C:\\a\\DA1458x\\5.0.4\\projects\\target_apps\\ble_examples\\ble_app_peripheral\\Keil_5\\out_580\\ble_app_peripheral_580.axf"
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via AIRCR.SYSRESETREQ.
Include "C:\\a\\DA1458x\\5.0.4\\projects\\target_apps\\ble_examples\\ble_app_peripheral\\Keil_5\\..\\..\\..\\..\\..\\sdk\\common_project_files\\misc\\sysram_case23.ini"
/**
****************************************************************************************
* DA1458x object loading script through debugger interface (e.g. JLink, etc).
* The goal of this script is to load the Keils's object file to the DA1458x RAM
* assuring that the DA1458x has been previously cleaned up.
****************************************************************************************
*/

// Write to DA1458x SYS_CTRL_REG -> Generate SW reset, enable debugger
_WWORD(0x50000012, 0x80a4)
^
*** error 125, line 10: AGDI: memory write failed (0x50000012)

// Previous command (SW reset) unhalts the processor
// Write to Cortex-M0 DHCSR Core Debug Register -> Halt Cortex-M0
_WDWORD(0xe000edf0, 0xa05f0003)
^
*** error 125, line 14: AGDI: memory write failed (0xE000EDF0)

// Required sleep time (in msec) before debugger reset is executed
_sleep_(1000)

// Debugger reset (check Keil debugger settings)
// Preselected reset type (found in Options-> Debug-> Settings) is Normal (0):
//-正常:通过SYSRESETREQ和VECTRESET位重置核心和外围设备
RESET
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via AIRCR.SYSRESETREQ.

// Load object file
LOAD %L
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via AIRCR.SYSRESETREQ.

// Load stack pointer
SP = _RDWORD(0x20000000)

// Load program counter
$ = _RDWORD(0x20000004)

FUNC void disp_memlog(void)
{
int idx;
unsigned int min_delta;

exec("log > Memlog.log");

printf("\n\n*** Memory Logging Results ***\n\n");

printf(">>> ENV HEAP <<<\n");
printf("Used size in this HEAP : %4d (current) - %4d (maximum)\n", mem_log[0].used_sz, mem_log[0].max_used_sz);
printf("Used size in other HEAPs: %4d (current) - %4d (maximum)\n\n", mem_log[0].used_other_sz, mem_log[0].max_used_other_sz);

printf(">>> DB HEAP <<<\n");
printf("Used size in this HEAP : %4d (current) - %4d (maximum)\n", mem_log[1].used_sz, mem_log[1].max_used_sz);
printf("Used size in other HEAPs: %4d (current) - %4d (maximum)\n\n", mem_log[1].used_other_sz, mem_log[1].max_used_other_sz);

printf(">>> MSG HEAP <<<\n");
printf("Used size in this HEAP : %4d (current) - %4d (maximum)\n", mem_log[2].used_sz, mem_log[2].max_used_sz);
printf("Used size in other HEAPs: %4d (current) - %4d (maximum)\n\n", mem_log[2].used_other_sz, mem_log[2].max_used_other_sz);

printf(">>> Non-Ret HEAP <<<\n");
printf("Used size in this HEAP : %4d (current) - %4d (maximum)\n", mem_log[3].used_sz, mem_log[3].max_used_sz);
printf("Used size in other HEAPs: %4d (current) - %4d (maximum)\n\n", mem_log[3].used_other_sz, mem_log[3].max_used_other_sz);

exec("log off");
} //disp_memlog() ends

Device:
ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
Additional info : Im using

Additional info : Im using "DA1458x\\5.0.4\\projects\\target_apps\\ble_examples\\ble_app_peripheral" sample code.

PM_Dialog
Offline
Last seen:16 hours 44 min ago
Staff
Joined:2018-02-08 11:03
Hi ridzuwary,

Hi ridzuwary,

I think that this issue is not related with the JLink update. Probably, you have the debugger disabled. Have you done any modification in the ble_app_peripheral example of the SDK? have you burnt the SPI flash or you just trying to download firmware into the System-RAM? Can you replicate this issue with another example of the SDK?

Thanks, PM_Dialog

ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
Hi,

Hi,

I didnt do any any modification to ble_app_peripheral .

Im trying to run the program using debug . Previously i have no problem running it.

Im trying other ble example and the same error 125 is there.

ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
I didnt do any any

I didnt do any any modification to ble_app_peripheral .

Im trying to run the program using debug . Previously i have no problem running it.

Im trying other ble example and the same error 125 is there.

Im using this documentation :

DA14580 Bluetooth® Smart Development Kit – Basic UM-B-025

attached is the from keil , could this be a problem ?

Attachment:
PM_Dialog
Offline
Last seen:16 hours 44 min ago
Staff
Joined:2018-02-08 11:03
Hi ridzuwary,

Hi ridzuwary,

Please check the attached snapshots. Can you please indicate if you have the same configurations? As soon as you have the correct jumper set up, you should be able to program your board.

Thanks, PM_Dialog

Attachment:
ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
Hi,

Hi,

Im still folowing as per your shared picture.

The only diffences is that that DLL vesion for it is v6.46d while you sample is v6.30c .

The jumper is set correctlya s per tutorial.

The output is as follows :

Running with Code Size Limit: 32K
JLink项目文件设置为“C: \ \ DA1458x \ 5.0.4 \项目ects\target_apps\ble_examples\ble_app_barebone\Keil_5\JLinkSettings.ini"* JLink Info: Device "CORTEX-M0" selected.

JLink info:
------------
DLL: V6.46d, compiled Jun 7 2019 17:33:40
Firmware: J-Link OB-SAM3U128 V1 compiled Jan 7 2019 14:05:40
Hardware: V1.00
S/N : 480063501

* JLink Info: Found SW-DP with ID 0x0BB11477
* JLink Info: Scanning AP map to find all available APs
* JLink Info: AP[1]: Stopped AP scan as end of AP map has been reached
* JLink Info: AP[0]: AHB-AP (IDR: 0x04770021)
* JLink Info: Iterating through AP map to find AHB-AP to use
* JLink Info: AP[0]: Core found
* JLink Info: AP[0]: AHB-AP ROM base: 0xE00FF000
* JLink Info: CPUID register: 0x410CC200. Implementer code: 0x41 (ARM)
* JLink Info: Found Cortex-M0 r0p0, Little endian.
* JLink Info: FPUnit: 4 code (BP) slots and 0 literal slots
* JLink Info: CoreSight components:
* JLink Info: ROMTbl[0] @ E00FF000
* JLink Info: ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
* JLink Info: ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
* JLink Info: ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
ROMTableAddr = 0xE00FF000
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via AIRCR.SYSRESETREQ.

Target info:
------------
Device: ARMCM0
VTarget = 3.300V
State of Pins: TCK: 0, TDI: 1, TDO: 1, TMS: 1, TRES: 1, TRST: 1
Hardware-Breakpoints: 4
Software-Breakpoints: 8192
Watchpoints: 2
JTAG speed: 2667 kHz

Include "C:\\a\\DA1458x\\5.0.4\\projects\\target_apps\\ble_examples\\ble_app_barebone\\Keil_5\\..\\..\\..\\..\\..\\sdk\\common_project_files\\misc\\sysram_case23.ini"
/**
****************************************************************************************
* DA1458x object loading script through debugger interface (e.g. JLink, etc).
* The goal of this script is to load the Keils's object file to the DA1458x RAM
* assuring that the DA1458x has been previously cleaned up.
****************************************************************************************
*/

// Write to DA1458x SYS_CTRL_REG -> Generate SW reset, enable debugger
_WWORD(0x50000012, 0x80a4)
^
*** error 125, line 10: AGDI: memory write failed (0x50000012)

// Previous command (SW reset) unhalts the processor
// Write to Cortex-M0 DHCSR Core Debug Register -> Halt Cortex-M0
_WDWORD(0xe000edf0, 0xa05f0003)
^
*** error 125, line 14: AGDI: memory write failed (0xE000EDF0)

// Required sleep time (in msec) before debugger reset is executed
_sleep_(1000)

// Debugger reset (check Keil debugger settings)
// Preselected reset type (found in Options-> Debug-> Settings) is Normal (0):
//-正常:通过SYSRESETREQ和VECTRESET位重置核心和外围设备
RESET
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via AIRCR.SYSRESETREQ.

// Load object file
LOAD %L
* JLink Info: Reset: Halt core after reset via DEMCR.VC_CORERESET.
* JLink Info: Reset: Reset device via AIRCR.SYSRESETREQ.

// Load stack pointer
SP = _RDWORD(0x20000000)

// Load program counter
$ = _RDWORD(0x20000004)

FUNC void disp_memlog(void)
{
int idx;
unsigned int min_delta;

exec("log > Memlog.log");

printf("\n\n*** Memory Logging Results ***\n\n");

printf(">>> ENV HEAP <<<\n");
printf("Used size in this HEAP : %4d (current) - %4d (maximum)\n", mem_log[0].used_sz, mem_log[0].max_used_sz);
printf("Used size in other HEAPs: %4d (current) - %4d (maximum)\n\n", mem_log[0].used_other_sz, mem_log[0].max_used_other_sz);

printf(">>> DB HEAP <<<\n");
printf("Used size in this HEAP : %4d (current) - %4d (maximum)\n", mem_log[1].used_sz, mem_log[1].max_used_sz);
printf("Used size in other HEAPs: %4d (current) - %4d (maximum)\n\n", mem_log[1].used_other_sz, mem_log[1].max_used_other_sz);

printf(">>> MSG HEAP <<<\n");
printf("Used size in this HEAP : %4d (current) - %4d (maximum)\n", mem_log[2].used_sz, mem_log[2].max_used_sz);
printf("Used size in other HEAPs: %4d (current) - %4d (maximum)\n\n", mem_log[2].used_other_sz, mem_log[2].max_used_other_sz);

printf(">>> Non-Ret HEAP <<<\n");
printf("Used size in this HEAP : %4d (current) - %4d (maximum)\n", mem_log[3].used_sz, mem_log[3].max_used_sz);
printf("Used size in other HEAPs: %4d (current) - %4d (maximum)\n\n", mem_log[3].used_other_sz, mem_log[3].max_used_other_sz);

exec("log off");
} //disp_memlog() ends

Attachment:
PM_Dialog
Offline
Last seen:16 hours 44 min ago
Staff
Joined:2018-02-08 11:03
Hi ridzuwary,

Hi ridzuwary,

Seems that you are running the code in sleep mode, try to start the debugging session and click again in order to stop debugging. By doing that you should see your device advertising. if you want to debug the code, disable the sleeping feature and run the code. Please remove all the jumper except the jumpers for JTAG connection. Also remove the battery if you had it placed. Did you check to run any other example of the SDK?

Thanks, PM_Dialog

ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
1. How do i enabled sleep

1. How do i enabled sleep/unsleep mode /disable the sleeping feature ?

2. I have been trying to run debug mode wthout success with the output as above,

3. I have check all other examples , blinky is working as it doesnt use parameters/memory. Other Ble have the same error when run debug.

4. Let me just recap in order to debug without any errors i should :

a. Remove all the jumpers except for JTAG ( this support to follow UART jumpers setting) .

b. Remove the Battery

c. Select the project folder

d. build

e. Debug > start debug session

f. click run

5. can you explain why this error happening ?

// Write to DA1458x SYS_CTRL_REG -> Generate SW reset, enable debugger
_WWORD(0x50000012, 0x80a4)
^
*** error 125, line 10: AGDI: memory write failed (0x50000012)

// Previous command (SW reset) unhalts the processor

ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
By the way , in start debug,

By the way , in start debug, when issue a run command , it stuck at init.

Im attaching the picture.

Attachment:
ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
By the way , in start debug,

By the way , in start debug, when issue a run command , it stuck at init.

Im attaching the picture.

Attachment:
PM_Dialog
Offline
Last seen:16 hours 44 min ago
Staff
Joined:2018-02-08 11:03
Hi ridzuwary,

Hi ridzuwary,

The screenshot is correct! Your device should start advertising. Did you check it with a generic mobile BLE application? The device should be in the air.

Thanks, PM_Dialog

ridzuwary
Offline
Last seen:1 year 7 months ago
Joined:2017-11-24 03:10
unfortunately, i cant detect

unfortunately, i cant detect the devices.

这不是广告。

im using 3 different ble / beacon scanner just to be sure.

Please look at the command part of the screenshot before. it is expected to get that output ?

So do i igonore the "*** error 125, line 10: AGDI: memory write failed (0x50000012)" error that still exist when i run debug ?

PM_Dialog
Offline
Last seen:16 hours 44 min ago
Staff
Joined:2018-02-08 11:03
Hi ridzuwary,

Hi ridzuwary,

那是非常奇怪的行为!尝试将SDK解压到一个新的路径文件夹中,然后重新安装Keil工具和JLink。之后,尝试构建项目。你能把它们建对吗?请注意,我无法复制你的问题,所以请尝试这个,让我知道。

c:\myWorkshop\DA1458x_SDK\5.0.4

Also please try to disable all the break points you have set inside your code.

Thanks, PM_Dialog

rorbech
Offline
Last seen:1 year 5 months ago
Joined:2019-08-09 13:22
I had similar behavoir after

I had similar behavoir after the initial install and trying out the barebone example. I fixed it by doing a clean build "Project->Clean targets" followed by a "Project->Build Target". Then after starting a debug session and running the program it started advertizing. ...Claus

PM_Dialog
Offline
Last seen:16 hours 44 min ago
Staff
Joined:2018-02-08 11:03
Hi robech,

Hi robech,

Many thanks for your indication.

Regards, PM_Dialog