sifive / freedom-metal

Bare Metal Compatibility Library for the Freedom Platform
Other
154 stars 47 forks source link

metal_before_start wrongly initializing stack memory #435

Open gasparinielias opened 1 year ago

gasparinielias commented 1 year ago

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.