You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2020/11/23 20:39:31 UTC

[GitHub] [mynewt-core] kasjer commented on a change in pull request #2418: hw/mcu/dialog: Add support for Micro Trace Buffer (MTB)

kasjer commented on a change in pull request #2418:
URL: https://github.com/apache/mynewt-core/pull/2418#discussion_r528932980



##########
File path: hw/mcu/dialog/da1469x/src/arch/cortex_m33/da1469x_m33_sleep.S
##########
@@ -231,6 +245,17 @@ da1469x_m33_wakeup:
     str     r5, [r0, #(FPU_FPDSCR_OFFSET)]
 #endif
 
+#if MYNEWT_VAL(MCU_MTB_ENABLE)
+/* Restore MTB state */
+    ldmia   r3!, {r4-r6}
+    ldr     r0, =MTB_MASTER_REG
+    str     r5, [r0]
+    ldr     r0, =MTB_POSITION_REG
+    str     r4, [r0]
+    ldr     r0, =MTB_FLOW_REG
+    str     r0, [r0]

Review comment:
       are you sure the **R6** should not be used instead of **R0**?
   
   Other thing that probably does not matter is that write to MASTER can start ETB while next instructions change pointers. I would restore MASTER at the end, but as I mentioned since there is not branch around it probably does not matter and maybe even `stm r0, {r4-r6}` could be used to write all three registers at once in similar fashion save MTB does it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org