ajlennon commented on code in PR #19858:
URL: https://github.com/apache/nuttx/pull/19858#discussion_r3789850547


##########
arch/arm/src/imxrt/imxrt_start.c:
##########
@@ -147,8 +151,20 @@ static inline void imxrt_tcmenable(void)
  *
  ****************************************************************************/
 
+#ifdef CONFIG_ARCH_FAMILY_IMXRT118x
+void __attribute__((naked)) noinstrument_function __start(void)

Review Comment:
   The special handling is needed for the RT1180 ROM/debugger handoff: 
ROM/LinkServer can leave the ARMv8-M `MSPLIM`/`PSPLIM` registers enabled. On 
the EVK this caused `CFSR.STKOF` on the first compiler-generated `PUSH`, before 
normal C startup could establish the stack state. The naked reset shim clears 
both limits before branching to C startup; with that change the board reaches 
`nsh` successfully. I have also added a brief code comment to make this 
explicit.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to