If my understanding is correct, the _entry function provided by the metal library sets the stack pointer "sp" to the top (highest memory address) of each core's stack memory. However, the _metal_beforestart function assumes that the sp is pointing at the lowest address, so it zeros out a different memory than intended.
If my understanding is correct, the _entry function provided by the metal library sets the stack pointer "sp" to the top (highest memory address) of each core's stack memory. However, the _metal_beforestart function assumes that the sp is pointing at the lowest address, so it zeros out a different memory than intended.