Split from: Failed to create project

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

Hello,

 

I am trying to handle the exception, so that i created c function & called that c function from exception.S file but 

my system is getting restarted, please anybody suggest something.

 

#if !__AVR32_UC__ && !__AVR32_AP__
  #error Implementation for the AVR32 architecture only.
#endif

#include <avr32/io.h>

//! @{
//! \verbatim

.section  .exception, "ax", @progbits

// Start of Exception Vector Table.

/*
 * EVBA must be aligned with a power of two strictly greater than the
 * EVBA-relative offset of the last vector.
 */
.balign 0x200

// Export symbol.
.global _evba
.type _evba, @function
_evba:

    .org  0x000
    // Unrecoverable Exception.
_handle_Unrecoverable_Exception:
    mov r8, 3
    rjmp isr_exception

    .org  0x004
    // TLB Multiple Hit.
_handle_TLB_Multiple_Hit:
    mov r8, 4
    rjmp isr_exception

    .org  0x008
    // Bus Error Data Fetch.
_handle_Bus_Error_Data_Fetch:
    mov r8, 5
    rjmp isr_exception

    .org  0x00C
    // Bus Error Instruction Fetch.
_handle_Bus_Error_Instruction_Fetch:
     mov r8, 6
     rjmp isr_exception
     
    .org  0x010
    // NMI.
_handle_NMI:
    mov r8, 7
    rjmp isr_exception

    .org  0x014
    // Instruction Address.
_handle_Instruction_Address:
    rjmp $

    .org  0x018
    // ITLB Protection.
_handle_ITLB_Protection:
    rjmp $

    .org  0x01C
    // Breakpoint.
_handle_Breakpoint:
    rjmp $

    .org  0x020
    // Illegal Opcode.
_handle_Illegal_Opcode:
    rjmp $

    .org  0x024
    // Unimplemented Instruction.
_handle_Unimplemented_Instruction:
    rjmp $

    .org  0x028
    // Privilege Violation.
_handle_Privilege_Violation:
    rjmp $

    .org  0x02C
    // Floating-Point: UNUSED IN AVR32UC and AVR32AP.
_handle_Floating_Point:
    rjmp $

    .org  0x030
    // Coprocessor Absent: UNUSED IN AVR32UC.
_handle_Coprocessor_Absent:
    rjmp $

    .org  0x034
    // Data Address (Read).
_handle_Data_Address_Read:
    rjmp $

    .org  0x038
    // Data Address (Write).
_handle_Data_Address_Write:
    rjmp $

    .org  0x03C
    // DTLB Protection (Read).
_handle_DTLB_Protection_Read:
    rjmp $

    .org  0x040
    // DTLB Protection (Write).
_handle_DTLB_Protection_Write:
    rjmp $

    .org  0x044
    // DTLB Modified: UNUSED IN AVR32UC.
_handle_DTLB_Modified:
    rjmp $

    .org  0x050
    // ITLB Miss.
_handle_ITLB_Miss:
    rjmp $

    .org  0x060
    // DTLB Miss (Read).
_handle_DTLB_Miss_Read:
    rjmp $

    .org  0x070
    // DTLB Miss (Write).
_handle_DTLB_Miss_Write:
    rjmp $

    .org  0x100
    // Supervisor Call.
_handle_Supervisor_Call:
    rjmp $

isr_exception:
    st.w    --sp,sp
    pushm   r0-r7,lr
    bral    _Exception

 

_Exception is my c function 

 

my question is that why my system is getting restarted?

 

Angad

Last Edited: Tue. Dec 12, 2017 - 01:23 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 Please use the features in the toolbar for formatting. The "<>" button is for the code editor.

 

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

ki0bk wrote:
 The "<>" button is for the code editor.

Full, illustrated instructions here: http://www.avrfreaks.net/comment...

 

 

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

Thanks ki0bk,

I am using atmels 6.2 and at32uc3c0512c controller.

Please tell me in detail, as I toolbar " <>" not available.

Regards,
Angad

Angad

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

Angad wrote:
 I toolbar " <>" not available.

What do you mean by that?

 

Did you follow the links & read the instructions?

 

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

The "<>" button is for inserting code in your post in the correct format.

 

Please listen to ki0bk and awneil and I'm sure they will help.

 

You will get more help here than personal messageing the same question.

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

Folks, just to note that if you access Freaks on mobiles/tablets or other small screens it "scales" and sometimes that means "<>" cannot be seen.

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

Ah.

 

Does that mean that the button is not available at all, or just not immediately visible?

 

EDIT

 

I had never before used this site on a "mobile" device - not least because of the negative reports from those that do.

 

So I just tried it on my Android Nexus-7 tablet:

 

there is no toolbar at all!!

 

surprise

 

Is that normal?

 

(typing this back on the PC)

Last Edited: Wed. Dec 13, 2017 - 09:59 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
Is that normal?
Yes.

 

As it happens it doesn't matter as on mobiles and tablets (certainly all the Android and Apple ones I've tried) the code editor (which you can get with "request desktop site") is completely unusable. It's basically only for PCs.

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

OK - I updated my  "instructions" posts to note this.

 

Should probably also note this in the Wiki entries - but updating that has long been broken: http://www.avrfreaks.net/forum/cant-edit-wiki

 

<rolls eyes>

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

You can 'Request Destkop Site" within some mobile browsers.  Pages begin to look more like they do on a computer.

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

joeymorin wrote:
You can 'Request Destkop Site"

But clawson wrote:
the code editor (which you can get with "request desktop site") is completely unusable. It's basically only for PCs.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
#include <avr/io.h>
#include <util/delay.h>

int main(void) {
    DDRB = (1<<PB5);
    while (1) {
        PINB = (1<<PB5);
        _delay_(1000);
    }
}

This post was entirely composed from my mobile after requesting desktop site.

 

EDIT: (from a PC because I'm right in front of one) Nevertheless, I'm of the opinion that the code editor is a piece of **** on any platform.  The mobile experience is not a huge departure from the desktop experience.  The only quirk I found is that the shift key operates like a backspace key, so if I want an upper-case letter I have to shift-lock.  To return to lower-case I have to hide the keyboard and restore it.

 

I rarely even bother to request a desktop site from my mobile anyway.  When posting from it I live with plain text.  If there's something more involved I want to post, I wait.

 

The only role of the code editor in my world is to paste code from my text editor.  Who would want to actually compose a code example in it?  Even with the short one above, I would fire that into an off-line editor and copy/paste.

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

Last Edited: Thu. Dec 14, 2017 - 03:36 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

joeymorin wrote:
This post was entirely composed from my mobile after requesting desktop site.
Can I ask what OS, what browser and what keyboard input you use?

 

I mostly use Android+Chrome+Swiftkey3 and whether I am in "request desktop" view or not I find it impossible to type into the code editor. That's true of both phone and tablet. Even if I switch Chrome to Fierfox I get the same. I'm guessing it might be something to do with SwiftKey3 but I couldn't operate an Android device without it. It is a very popular choice among Android users so I assume I'm not the only one afflicted by this.

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

joeymorin wrote:
 I'm of the opinion that the code editor is a piece of **** on any platform.

I would agree.

 

And it's not even consistent: sometimes it's usable; others it's completely unusable - eg, the text & cursor positioning goes haywire on pressing <return>

 

angry

 

 

 

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

Can I ask what OS, what browser and what keyboard input you use?

Pretty old.

 

 

 

Standard keyboard that shipped with the device.  Never changed the settings.

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

joeymorin wrote:
The only quirk I found is that the shift key operates like a backspace key, so if I want an upper-case letter I have to shift-lock.  To return to lower-case I have to hide the keyboard and restore it.

 

Does that pertain to the code editor only, or the site in general?

 

If the code editor in particular: No comment - I've never even dared to try to run it on a mobile device. It would take me for ages to type in what you did above..

 

If in general then: That likely has nothing to do with the site and everything to do with the browser in your mobile/handheld device. Possibly some intermix of the two. I see no problem with the shift key. Samsung Galaxy Tab A 10.1, some Android version that I do not have handy but likely 5 or 6 dot something, Chrome (of a likewise unknown version). No problem w.r.t. shift key regardless of if mobile or desktop site was loaded.

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

 

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

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

Does that pertain to the code editor only, or the site in general?

Code editor only.

 

It would take me for ages to type in what you did above..

It did take me a while ;-) ... but I'm not as fast as the kids today with their flying Fred Flintstone thumbs.

"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."

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

"Fast.  Cheap.  Good.  Pick two."

"Read a lot.  Write a lot."

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

 

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

Nicely hijacked post, but let me ask the OP about those extra move instructions see one below:

    .org  0x000
    // Unrecoverable Exception.
_handle_Unrecoverable_Exception:
    mov r8, 3
    rjmp isr_exception

 

I have an assumption that those rjmp instructions (actually replaced by the compiler to bral) can be 4 bytes itself (depends on the distance of the jump, maybe?). Could you check it in your generated code?

 

BR,

M