mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-25 16:50:50 +01:00
[ion] Ion::Device::reset::jump() jumps to the initialisation vector
This commit is contained in:
@@ -30,7 +30,7 @@ SECTIONS {
|
||||
* We're generating the ISR vector table in code because it's very
|
||||
* convenient: using function pointers, we can easily point to the service
|
||||
* routine for each interrupt. */
|
||||
|
||||
_isr_start = .;
|
||||
KEEP(*(.isr_vector_table))
|
||||
} >FLASH
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ SECTIONS {
|
||||
* We're generating the ISR vector table in code because it's very
|
||||
* convenient: using function pointers, we can easily point to the service
|
||||
* routine for each interrupt. */
|
||||
|
||||
_isr_start = .;
|
||||
KEEP(*(.isr_vector_table))
|
||||
} >INTERNAL_FLASH
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
#include <regs/regs.h>
|
||||
#include <drivers/cache.h>
|
||||
|
||||
extern void * _isr_start;
|
||||
|
||||
namespace Ion {
|
||||
namespace Device {
|
||||
namespace Reset {
|
||||
@@ -19,8 +21,8 @@ void jump() {
|
||||
Ion::Device::Cache::disableDCache();
|
||||
Ion::Device::Cache::disableICache();
|
||||
|
||||
uint32_t * stackPointerAddress = reinterpret_cast<uint32_t *>(0x08000000);
|
||||
uint32_t * resetHandlerAddress = reinterpret_cast<uint32_t *>(0x08000004);
|
||||
uint32_t * stackPointerAddress = reinterpret_cast<uint32_t *>(&_isr_start);
|
||||
uint32_t * resetHandlerAddress = stackPointerAddress + 1;
|
||||
|
||||
/* Jump to the reset service routine after having reset the stack pointer.
|
||||
* Both addresses are fetched from the base of the Flash memory, just like a
|
||||
|
||||
@@ -23,6 +23,7 @@ STACK_SIZE = 32K;
|
||||
|
||||
SECTIONS {
|
||||
.isr_vector_table ORIGIN(RAM_BUFFER) : {
|
||||
_isr_start = .;
|
||||
KEEP(*(.isr_vector_table))
|
||||
} >RAM_BUFFER
|
||||
|
||||
|
||||
@@ -25,6 +25,10 @@ MEMORY {
|
||||
RAM_BUFFER (rw) : ORIGIN = EPSILON_STACK_END, LENGTH = 8K
|
||||
}
|
||||
|
||||
/* The DFU needs to know to which address it should jump to after a leave
|
||||
* command. This address is used in Ion::Device::Reset::jump(). */
|
||||
_isr_start = 0x08000000;
|
||||
|
||||
SECTIONS {
|
||||
.text : {
|
||||
. = ALIGN(4);
|
||||
|
||||
Reference in New Issue
Block a user