interrupt vectors

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guy, I need to disable interrupts before the device make the vector jump show below using, "cpsid if" instruction. 

 

/* Exception vectors
 *******************/
	.section    .vectors, "a", %progbits

resetVector:
/* Reset */
	ldr     pc, =resetHandler
/* Undefined Instruction */
	ldr     pc, =undefined_instruction_irq_handler
/* Software Interrupt */
	ldr     pc, =software_interrupt_irq_handler
/* Prefetch Abort */
	ldr     pc, =prefetch_abort_irq_handler
/* Data Abort */
	ldr     pc, =data_abort_irq_handler
/* Reserved for future use */
	.word   0
/* Interrupt */
	ldr     pc, =irqHandler
/* Fast interrupt */
	ldr     pc, =fiqHandler

 

Could someone show me how to achieve this?

Last Edited: Wed. Aug 28, 2019 - 08:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wrong forum! [now moved]
Look at what freertos does with its sama5 port

 

This is what I found  in https://github.com/cjlano/freert...

 

/* The critical section macros only mask interrupts up to an application
  determined priority level. Sometimes it is necessary to turn interrupt off in
  the CPU itself before modifying certain hardware registers. */
  #define portCPU_IRQ_DISABLE() \
  __asm volatile ( "CPSID i" ::: "memory" ); \
  __asm volatile ( "DSB" ); \
  __asm volatile ( "ISB" );
   
  #define portCPU_IRQ_ENABLE() \
  __asm volatile ( "CPSIE i" ::: "memory" ); \
  __asm volatile ( "DSB" ); \
  __asm volatile ( "ISB" );
Last Edited: Wed. Aug 28, 2019 - 08:50 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Kartman, I'll look into it when  get the time.