Thanks. > In your case, the PC is sampled but it always returns the same value
I doubt that - I eventually got a proper trace by giving Start and End argsĀ» : ~~~ Each sample counts as 5.66027e-05 seconds. % cumulative self self total time seconds seconds calls Ts/call Ts/call name 3.39 0.02 0.02 USB_ReadInterrupts (stm32f0xx_ll_usb.c:680 @ 8002143) 2.45 0.03 0.01 led_update_normal_mode (led.c:103 @ 8000cd0) 2.26 0.05 0.01 USB_EPStartXfer (stm32f0xx_ll_usb.c:511 @ 80026c0) 1.30 0.05 0.01 PCD_EP_ISR_Handler (stm32f0xx_hal_pcd.c:1675 @ 8003e7e) 1.22 0.06 0.01 USB_ReadPMA (stm32f0xx_ll_usb.c:766 @ 8002aa6) 1.13 0.07 0.01 USBD_LL_Start (usbd_conf.c:189 @ 800213e) 1.01 0.07 0.01 main (main.c:126 @ 80046f8) 0.95 0.08 0.01 USB_WritePMA (stm32f0xx_ll_usb.c:726 @ 800216a) ... ~~~ > maybe your M0 does not implements PC sampling Yes it does, DWT_PCSR is documented in the ref manual for stm32F042. Still, for thoroughness, I just manually ran a few "mdw 0xE000101C" and getting different PC values, as should be. --- ** [tickets:#370] profile : Assertion `address_space >= 2' failed.** **Status:** new **Milestone:** 0.11.0 **Created:** Wed Nov 23, 2022 04:10 PM UTC by fenugrec **Last Updated:** Wed Nov 23, 2022 10:44 PM UTC **Owner:** nobody Hi, trying to profile a cortex-M0 target (stm32F042) with a jlink . If I don't specify Start and End : ~~~ (gdb) monitor profile 5 test.out [stm32f0x.cpu] Starting Cortex-M profiling. Sampling DWT_PCSR as fast as we can... [stm32f0x.cpu] Profiling completed. 10000 samples. openocd: src/target/target.c:4258: write_gmon: Assertion `address_space >= 2' failed. [stm32f0x.cpu] halted due to debug-request, current mode: Thread xPSR: 0x21000000 pc: 0x08002142 msp: 0x20001760 Remote connection closed ~~~ Should probably either - offer default values for those args - abort and complain if the args are mandatory - not require them at all Sidenote, a hardcoded limit of 10k samples ?? --- Sent from sourceforge.net because openocd-devel@lists.sourceforge.net is subscribed to https://sourceforge.net/p/openocd/tickets/ To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/openocd/admin/tickets/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.