small system SRAM info output
[cortex-from-scratch] / systick.c
index 777d04d..ed062c0 100644 (file)
--- a/systick.c
+++ b/systick.c
@@ -4,13 +4,27 @@
 #include <stm32.h>
 #include <mmap.h>
 
+struct interrupt_frame {
 
-void * systick_handler() {
+        uint32_t r0; // N-32
+        uint32_t r1;
+        uint32_t r2;
+        uint32_t r3;
+        uint32_t r12;
+        uint32_t lr;
+        uint32_t pc;
+        uint32_t psr; // N-4
+};
 
-//     *RANDOM_ADDR = (volatile uint32_t) 0x10101010 ;
-//     uart_puts("TEST");
+//__attribute__ ((interrupt))
+void * systick_handler(/* struct interrupt_frame * frame */) {
+
+//     uint32_t volatile status;
+       uart_puts("TICKING\n");
+//     for(;;);
 }
 
+
 void systick_init() {
 
        /* Enable the counter and enable the interrupt
@@ -20,7 +34,7 @@ void systick_init() {
        /* The counter reload register here holds 
         * 0x1000 -- that's 4096 clock cycles -- if 
         * it is down to zero it is restores the value */
-       *STK_RELOAD = (volatile uint32_t) 0x00000400; 
+       *STK_RELOAD = (volatile uint32_t) 0x00400000; 
 
        /* Every time the counter counts down to zero
         * a systick exception is asserted. Systick has