andrzej-kaczmarek opened a new pull request #1639: hw/mcu/nordic: Fix 
hal_system_start
URL: https://github.com/apache/mynewt-core/pull/1639
 
 
   While current implementation of hal_system_start works fine now, it is
   possible that compiler will "optimize" [1] code in a way that it will
   not work properly because we first set stack pointer to new location
   and then execute some more code which uses local variables.
   
   To make sure this always works fine, let's use inline assembly here to
   set stack pointer and then jump to image.
   
   [1] while working with other Cortex-M MCU it happened to me that just
       before jumping to image, GCC inserted "ldmia sp! {r3, lr}" which
       basically attempted a read outside RAM area since stack pointer was
       already at the very end of RAM area.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to