£50 pounds Stereling to the person who...

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

I know this is not the correct forum but I would like to increase the foot fall on the thread.

 

details: ATSAMA5D44 MPU

 

£50 pounds Sterling to the person who can provide a solution to my problem.  I trying to make a context switch after handling an interrupt.  the function that decides weather or not a context takes place is called, "xapi_system_gateway" I tried making it after the interrupt was performed but it results in the timer that caused the interrupt to stop working.

 

The interrupt routine handler is listed below:

 

//------------------------------------------------------------------------------
/// Handles incoming interrupt requests by branching to the corresponding
/// handler, as defined in the AIC. Supports interrupt nesting.
//------------------------------------------------------------------------------
irqHandler:
	/* Save interrupt context on the stack to allow nesting */

	sub     lr, lr, #4
	stmfd   sp!, {lr}
	mrs     lr, SPSR
	stmfd   sp!, {r0, lr}

	/* Write in the IVR to support Protect Mode */

	ldr     lr, =AIC
	ldr     r0, [r14, #AIC_IVR]
	str     lr, [r14, #AIC_IVR]
	/* Dummy read to force AIC_IVR write completion */
	ldr     lr, [r14, #AIC_SMR]

	/* Branch to interrupt handler in Supervisor mode */

	msr     CPSR_c, #ARM_MODE_SVC
	stmfd   sp!, {r1-r3, r4, r12, lr}

	/* Check for 8-byte alignment and save lr plus a */
	/* word to indicate the stack adjustment used (0 or 4) */

	and     r1, sp, #4
	sub     sp, sp, r1
	stmfd   sp!, {r1, lr}

	blx     r0

	ldmia   sp!, {r1, lr}
	add     sp, sp, r1

	ldmia   sp!, {r1-r3, r4, r12, lr}
	msr     CPSR_c, #ARM_MODE_IRQ | I_BIT | F_BIT

	/* Acknowledge interrupt */

	ldr     lr, =AIC
	str     lr, [r14, #AIC_EOICR]

	/* Restore interrupt context and branch back to calling code */

	ldmia   sp!, {r0, lr}
	msr     SPSR_cxsf, lr

	/* Test for Pre-emption */
	bl      xapi_system_gateway

	ldmia   sp!, {pc}^

I'm looking suggestions, since you do not have the hardware to test your ideas on so what I'm looking are suggestions, if your suggestion results in success I'll transfer £50 to you via paypal.

Happy Hunting!

 

Wm.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Found it, I'll let yous know what it was when I verify it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

It seems to be the MPU Mode, It appears that it is not being configured properly.  If I set it to supervisor mode after an interrupt it functions correctly.  

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Keep at it - you’ve nearly saved yourself a fiddy. That will buy you a guiness or three methinks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Heading to London soon, I'll be away from the computer for a week.  A week without programming!.

I'm so glad I've isolated the error.  It left me stumped.

 

Thanks for the patience guys.

 

I should have no further problems with the project. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I should have no further problems with the project. 

FLW :)

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what the hell does FLW mean?

Famous Last Words.

 

 

Last Edited: Sat. Sep 8, 2018 - 11:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In London £50 buys you about one Guinness!

 

(PS Google says FLW = Famous Last Words)

Last Edited: Sat. Sep 8, 2018 - 11:19 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One Guinness for £50 quid.  You got to be fecking with me.

What should an Irishman do in London, and don't say see the Queen!  Sweet Baby Jesus!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Cliff exaggerates slightly. You might get ten pints for £50.

Four legs good, two legs bad, three legs stable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

John_A_Brown wrote:
Cliff exaggerates slightly.
Caught in the act. However...

 

https://www.independent.co.uk/ne...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmmm ... buying that particular beer online is £8.25/pint:

 

https://honestbrew.co.uk/shop/cl...

 

so £13 in a posh central-London pub doesn't actually seem so surprising?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...