cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H735-DK Error: ST-LINK error (DEV_TARGET_CMD_ERR)

maguirre
Associate

While working with the HDP_Boot and HDP_Appli I was working on becoming familiar with the functionality of the examples

I had managed to program both applications and things were running well (as expected) prior t the secure settings being programmed via STMCubeProgrammer.

I was able to test everything and confirm the firmware jumped from the bootloader to the application as it was displayed on the screen.

However After performing Step #1 (setting the security bit. OB-> User Configuration and checking "SECURITY" bit and cllicking apply things worked fine.

When I proceeded to step #2 "Set Secure Area" as described in the doc folder of the example projects, I set the "secure area" start at 0x8000 000 and end address to 0x0801 FFFF is when things stopped working.

After setting the secure region the STlink disconnected and I am no longer able to connect. STLink presents the error: Error: ST-LINK error (DEV_TARGET_CMD_ERR)

On the DK the EEMBC demo appears to be running and it can be interacted with However I cannot connect via SWD to erase the firmware.

Is there any way to recover this board? Where exactly was the mistake that caused this issue?

2 REPLIES 2
Pavel A.
Evangelist II

The readme file in the HDP demo warns:

Before setting a secure address range it’s very important to have a valid code in this area.
After booting, the code stored in the secure area will be automatically executed.
During this code execution the debugger can’t be connected ..........
The last instruction executed in this secure area is a “jump�? out of the secure area.      (RSS->exitSecureArea).
The debugger can then be connected ...
..........
If for any reason the execution in the secure area is locked and the “jump�? instruction
is never executed, it will not be possible anymore to connect a debugger and also not
possible anymore to modify the flash content.

If the HDP_Appli executes, it displays text on the LCD, do you see it?

After displaying the text, the appli goes into while(1) loop, in this state you can connect with CubeProgrammer and remove the protected area as explained in the readme.

maguirre
Associate

@Pavel A.​ 

Thanks for the quick reply.

I took a very long read (multiple times) to the readme file. I executed the code w/o any security features enabled (both HDP_Boot and HDP_Appli) and everything worked flawlessly and as expected per the readme file.

I confirmed that HDP_Appli  prior to applying any of the security features, I am confident that the application was running because the LCD text said so as much.

After I applied the security features via STMCubreProgrammer (security bit and the read protection region addresses)

>If the HDP_Appli executes, it displays text on the LCD, do you see it?

Not after I set the security settings via STMCubeProgrammer. To Reiterate HDP_Appl was running prior to setting the secure FLASH regions and security bit.

The one curious item is that even though I had programmed HDP_Boot and HDP_Appl (and confirmed it was running), I did not not erase xFLASH.

The EEMBC demo that I am seeing currently run on this board appears to be part of that original demo that the DK was programmed with this, "something" is running, However even though a valid application is active I still cannot gain access via SWD.