+/* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL
+ *
+ * $LOG$
+ * 2019/7/20 - ROBIN KRENS
+ * Initial version
+ *
+ * $DESCRIPTION$
+ *
+ * */
+
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
* interrupt vector 16-92: irq0 - irq ..
* */
-uint32_t ivt[92];
+uint32_t __attribute__((aligned(0x100))) ivt[92];
/* each message corresponds to each and every exception.
* We get the correct message by accessing
/* Dummy interrupt */
-__attribute__ ((interrupt))
-void * dummy_isr(struct interrupt_frame * frame) {
+// __attribute__ ((interrupt))
+void * dummy_isr(/* struct interrupt_frame * frame */) {
uint8_t nr = *SCB_VTOR_ST & 0xFF;
// don't need to relocate or init this here
extern void * reset, * nmi, * hardfault;
- for (int i = 1; i <= 6 ; i++) {
+ for (int i = 1; i <= 64 ; i++) {
ivt_set_gate(i, dummy_isr, 0);
}
+
/* the vector table starts at 0x0. Since the address 0x0 point to
* bootcode, it is on ROM or FLASH. The vector table can be
* relocated to other memory locations. We can do this by setting
* a register in the NVIC called the vector table offset register */
//*SCB_VTOR = (volatile uint32_t) &ivt;
- regw_u32(SCB_VTOR, (uint32_t) &ivt, 0, 0x01);
+ regw_u32(SCB_VTOR, (uint32_t) &ivt, 0, OWRITE);
}