I enabled sleep with CORTEX_ENABLE_WFI_IDLE define, however after that it is very tricky to connect to the device.
Now I am aware that it also makes attaching debugger impossible without touching special registers that would still provide clock for debugger. But actually I am interested in measuring power consumption and therefore debugger is not needed, so typically I will just reflash controller with this command which worked nicely before adding WFI support:
openocd -f interface/stlink-v2.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x.cfg -c "program build/$(PROJECT).elf verify reset exit"
Is there any flag in openocd that still allows doing reset and uploading new binary but not making "debug" connection.
STM32F4 openocd configuration with WFI sleep
Moderators: RoccoMarco, barthess
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: STM32F4 openocd configuration with WFI sleep
Hi,
I have worked a little bit with OpenOCD. Anyway I am unable to answer this question. BTW, I have a suggestion: do this question on the OpenOCD IRC channel (#openocd). They have a very active and kind community.
I have worked a little bit with OpenOCD. Anyway I am unable to answer this question. BTW, I have a suggestion: do this question on the OpenOCD IRC channel (#openocd). They have a very active and kind community.
Ciao,
RM
RM
Re: STM32F4 openocd configuration with WFI sleep
I got answer from #openocd.
First of all physical reset pin must be connected to debugger and there should be following line in .cfg file:
reset_config srst_only connect_assert_srst
Oneliner to just upload new image:
openocd -f interface/stlink-v2.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x.cfg -c "reset_config srst_only connect_assert_srst" -c "program build/$(PROJECT).elf verify reset exit"
First of all physical reset pin must be connected to debugger and there should be following line in .cfg file:
reset_config srst_only connect_assert_srst
Oneliner to just upload new image:
openocd -f interface/stlink-v2.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x.cfg -c "reset_config srst_only connect_assert_srst" -c "program build/$(PROJECT).elf verify reset exit"
Last edited by andresv on Tue Apr 11, 2017 8:22 am, edited 1 time in total.
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Location: Munich (Germany)
- Has thanked: 83 times
- Been thanked: 67 times
- Contact:
Re: STM32F4 openocd configuration with WFI sleep
On discovery this should be already done. Check out ths schematic on user manual.
About ARM JTAG 20 pin connector, I wrote an article on my blog about how interfacing STLink with a microe clicker 2 which is based on STM32F407.
About ARM JTAG 20 pin connector, I wrote an article on my blog about how interfacing STLink with a microe clicker 2 which is based on STM32F407.
Ciao,
RM
RM
Who is online
Users browsing this forum: No registered users and 39 guests