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:
[font=Courier New]openocd -f interface/stlink-v2.cfg -c "set WORKAREASIZE 0x2000" -f target/stm32f4x.cfg -c "program build/$(PROJECT).elf verify reset exit"[/font]
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
Moderator: RoccoMarco
- RoccoMarco
- Posts: 655
- Joined: Wed Apr 24, 2013 4:11 pm
- Has thanked: 83 times
- Been thanked: 67 times
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.
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:
[font=Courier New]reset_config srst_only connect_assert_srst[/font]
Oneliner to just upload new image:
[font=Courier New]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"[/font]
First of all physical reset pin must be connected to debugger and there should be following line in .cfg file:
[font=Courier New]reset_config srst_only connect_assert_srst[/font]
Oneliner to just upload new image:
[font=Courier New]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"[/font]
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
- Has thanked: 83 times
- Been thanked: 67 times
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.