2017-07-11 07:09 AM
Hi,
i wondered if i can use the &sharpSWD in &sharpST-Link on the STM32F407G-DISCO1 Board to set individual IO registers during runtime?
According to
https://www.arm.com/products/processors/serial-wire-debug.php
it can be used as AMBA bus master to manipulate IO registers...So consider the simple test case: I want to switch on the red onboard LED (PD14) on the DISCOVERY board with SWD during runtime. How do i do it? What client software would you recommend?
I tried SW4STM32 but couldnt write the IO registers during runtime, no idea why it did not work.
I also used ST-LINK CLI and read memory address 0x40020C00 - 0x40020FFF (GPIO D memory area) but i only got zeros....
Am i using the SWD in the wrong way? Please help!
Patrick
#swd #stm32f4 #st-link2017-07-11 07:54 AM
>>
I also used ST-LINK CLI and read memory address 0x40020C00 - 0x40020FFF (GPIO D memory area) but i only got zeros....
Did you enable the clock first?
2017-07-11 08:00 AM
Hi,
i wanted to update: I can manipulate the IO registers now through sw4stm32 with the plugin 'EmbSys Registers'.
However, how do i do it with ST-LINK CLI? Is it even possible to read out peripheral register addresses with this tool?
Please clarify!
Patrick
2017-07-11 10:01 AM
The peripheral clock is activated. I am running an application on the device where it gets activated right on startup.
2017-07-12 01:12 AM
Hi,
update again: I can manipulate the IO register successfully with ST-LINK GUI. That means i can toggle an LED via register write now, but still i get a write error message popup in the GUI.
However, it doesnt work in the command line tool. I always get a write error:
C:\Users\pm>ST-LINK_CLI -w32 0x40020C18 0x00004000
STM32 ST-LINK CLI v3.0.0.0STM32 ST-LINK Command Line InterfaceST-LINK SN : 066EFF575450707267193852
ST-LINK Firmware version : V2J28M18Connected via SWD.SWD Frequency = 4000K.Target voltage = 2.9 V.Connection mode : Normal.Device ID:0x413Device flash Size : 1024 KbytesDevice family :STM32F405xx/F407xx/F415xx/F417xxWriting 0x00004000 at 0x40020C18... Error!Can anyone say what i am doing wrong in the command line tool? Please help!
Patrick
2017-07-12 10:51 AM
>>
Can anyone say what i am doing wrong in the command line tool? Please help!
Looks like a limitation in the software, this is a user forum, help depends on others working in a similar area. If you are a commercial client, push in via the sales and FAE contacts.
I've flagged this post for attention.
2017-07-13 04:38 AM
Hello,
I raised this issue internally to the ST-Link responsible and it's under investigation.
I will come back to you as soon as I have needed details.
With Regards
Imen