The application is in break mode

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

I have seen several treads on this topic - I have yet to see an answer.  I have got this problem BIG TIME and cannot get anything done due to it!  I really need an answer.

 

I am running version :

Atmel Studio 7 (Version: 7.0.634 - ) - the reset of the version data is at the end of this email.

I am running a JTAGice-MKii for debugging on a custom made board.

 

I have written a simple program for an AT32UC3A1512 that sets the clock to run at 66mhz, defines on pin as an output, and does a while loop changing the state of that one pin.  If I remove the while loop the code runs to completion - well I say it does - it does not give me the break error.

If I put anything in main after 'board_init()", I get the break error.  If I change the clock source to RC, the program runs - obviously really slow, but it runs.

 

I have previously complied code that runs on the same board, same Atmel Studio at 66mhz.  I have tried copy and pasting all the files from the working project to a new project with no success.  

 

Please Atmel help me out here.  I tried moving to the latest version of 7, but ran into that issue where nothing would compile, so I went back to the version I knew would work.  I have loaded the Utilities.dll that was suggested to overcome another issue.

Kind regards,

David

 

basic code:

#ifndef CONF_CLOCK_H_INCLUDED
#define CONF_CLOCK_H_INCLUDED

    #define CONFIG_SYSCLK_SOURCE        SYSCLK_SRC_PLL0

    /* Fbus = Fsys / (2 ^ BUS_div) */
    #define CONFIG_SYSCLK_CPU_DIV         0
    #define CONFIG_SYSCLK_PBA_DIV         0
    #define CONFIG_SYSCLK_PBB_DIV         0
    #define CONFIG_USBCLK_SOURCE          USBCLK_SRC_PLL1
    #define CONFIG_USBCLK_DIV             1
    #define CONFIG_PLL0_SOURCE          PLL_SRC_OSC0
    #define CONFIG_PLL0_MUL             11
    #define CONFIG_PLL0_DIV             2

    #define CONFIG_PLL1_SOURCE            PLL_SRC_OSC0
    #define CONFIG_PLL1_MUL               (48000000UL / BOARD_OSC0_HZ)
    #define CONFIG_PLL1_DIV               1
          

#endif /* CONF_CLOCK_H_INCLUDED */

-----------------------------------

#ifndef USER_BOARD_H
#define USER_BOARD_H

#include <conf_board.h>

#include "VF700_EIM_BSP.h"

#define BOARD_OSC0_HZ             12000000
#define BOARD_OSC0_TYPE           XOSC_TYPE_XTAL
#define BOARD_OSC0_IS_XTAL        true
#define BOARD_OSC0_STARTUP_US     17000

#endif    //USER_BOARD_H

-------------------------------

#include <asf.h>
#include <board.h>
#include <conf_board.h>
#include "VF700_EIM_BSP.h"

void board_init(void);

void board_init(void)
{
    sysclk_init();
    gpio_local_init()
    delay_init(66000000UL);
    //gpio_configure_pin(PG_1_OUT,OUT);                               // enable output pins
    
    gpio_local_enable_pin_output_driver(PG_1_OUT);            //enable bit as output

    return;

}

-------------------------------------------------------------

#include <asf.h>
#include "VF700_EIM_BSP.h"

int main (void)
{
    /* Insert system clock initialization code here (sysclk_init()). */

    flashc_set_wait_state(1);

    board_init();
    
while (1)
{
}

    /* Insert application code here, after the board has been initialized. */
}

----------------------------------------

#ifndef VF700_EIM_BSP_H_
#define VF700_EIM_BSP_H_

#define APPLI_CPU_SPEED    66000000
#define APPLI_PBA_SPEED 66000000

/* These are documented in services/basic/clock/uc3b0_b1/osc.h */
#define BOARD_OSC0_HZ           12000000
#define BOARD_OSC0_STARTUP_US   17000
#define BOARD_OSC0_IS_XTAL      true
#define BOARD_OSC32_HZ          32768
#define BOARD_OSC32_STARTUP_US  71000
#define BOARD_OSC32_IS_XTAL     true
#define FOSC0                    12000000

 

#define PG_1_OUT    AVR32_PIN_PB20

#endif /* VF700_EIM_BSP_H_ */

------------------------------------------------

© 2015 Atmel Corp.
All rights reserved.

OS Version: Microsoft Windows NT 6.2.9200.0
Platform: Win32NT

Installed Packages: Shell VSIX manifest - 7.0
Shell VSIX manifest
Version: 7.0
Package GUID: e874ffe4-fbe3-4624-9a17-61014ede02d0
Company: Atmel Corporation

Installed Packages: Atmel Start - 1.0.55.0
Atmel Start
Version: 1.0.55.0
Package GUID: F8853255-9C7B-4DC2-8E0F-64D9324AEB0E
Company: Atmel

Installed Packages: LiveWatch - 2.0.51
LiveWatch
Version: 2.0.51
Package GUID: 7DF6DCFD-2BCA-41C7-9C0E-1B7F606B008E
Company: Atmel

Installed Packages: GdbConsole - 7.0.154
GdbConsole
Version: 7.0.154
Package GUID: 49258291-0FED-4501-881B-6BAA91BEBCA8
Company: Atmel

Installed Packages: Atmel Kits - 7.0.44
Atmel Kits
Version: 7.0.44
Package GUID: 6F4B8FE4-C464-4916-8B43-AC92431C1CDF
Company: Atmel

Installed Packages: AtmelToolchainProvider - 7.0.884
AtmelToolchainProvider
Version: 7.0.884
Package GUID: AtmelToolchainProvider.Atmel.10EF9C74-D8DA-4872-85F5-D8BB3101E245
Company: Atmel

Installed Packages: Data Visualizer Extension - 2.3.393
Data Visualizer Extension
Version: 2.3.393
Package GUID: 25dc067d-df31-4e22-be7f-cc6a77ccc7f3
Company: Atmel

Installed Packages: Atmel Gallery - 7.8
Atmel Gallery
Version: 7.8
Package GUID: AtmelStudio7ExtensionManager
Company: Atmel

Installed Packages: Percepio Trace for Atmel Studio - 1.3
Percepio Trace for Atmel Studio
Version: 1.3
Package GUID: fe274744-c496-42fc-9e52-f77b92d669b1
Company: Percepio AB

Installed Packages: Visual Assist for Atmel Studio - 10.9.2073.2
Visual Assist for Atmel Studio
Version: 10.9.2073.2
Package GUID: 7997A33C-B154-4b75-B2AC658CD58C9510
Company: Whole Tomato Software

Installed Packages: Atmel Software Framework - 3.28.1.254
ASF
Version: 3.28.1
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.28.1
Release Description: ASF - 3.28.1 Release

ASF
Version: 3.27.3
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.27.3
Release Description: ASF - 3.27.3 Release

ASF
Version: 3.27.0
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.27.0
Release Description: ASF - 3.27.0 Release

ASF
Version: 3.26.0
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.26.0
Release Description: ASF - 3.26.0 Release

ASF
Version: 3.25.0
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.25.0
Release Description: ASF - 3.25.0 Release

ASF
Version: 3.24.2
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.24.2
Release Description: ASF - 3.24.2 Release

ASF
Version: 3.24.1
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.24.1
Release Description: ASF - 3.24.1 Release

ASF
Version: 3.23.1
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.23.1
Release Description: ASF - 3.23.1 Release

ASF
Version: 3.22.0
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.22.0
Release Description: ASF - 3.22.0 Release

ASF
Version: 3.21.0
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.21.0
Release Description: ASF - 3.21.0 Release

ASF
Version: 3.20.1
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.20.1
Release Description: ASF - 3.20.1 Release

ASF
Version: 3.19.0
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.19.0
Release Description: ASF - 3.19.0 Release

ASF
Version: 3.18.1
Package GUID: 4CE20911-D794-4550-8B94-6C66A93228B8
Company: Atmel
HelpUrl: http://asf.atmel.com/3.18.1
Release Description: ASF - 3.18.1 Release

 

 

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

Additional information - trying to figure out where the program goes when in this undesired break mode, I put break points at each of the rjmp $ in exception.s   This morning when I ran the program, without the while loop shown in main.c, this where the program ended in exception.s

 

     .org  0x00C
    // Bus Error Instruction Fetch.
_handle_Bus_Error_Instruction_Fetch:
    rjmp $

 

Hope this will mean something to somebody!

David

 

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

Just to clarify, are you referring to the issue of being presented by the message below when hitting a break point?

 

 

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

This is the message - but I have get it when I do not have any break points set.

Thanks for replying.

David

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

Having noted previously that suing the RC clock rather than the 12mhz crystal that the code would run - I have been play with the values of     #define CONFIG_PLL0_MUL   and  #define CONFIG_PLL0_DIV.

 

 

What I have found is that with 

while(1)
{    
gpio_local_set_gpio_pin(PG_1_OUT);
gpio_local_clr_gpio_pin(PG_1_OUT);
}

 in the main.c and using the 12mhz as the clock source that with values of

    #define CONFIG_PLL0_MUL             13
    #define CONFIG_PLL0_DIV             5

 

rather than

    #define CONFIG_PLL0_MUL             11
    #define CONFIG_PLL0_DIV             2

that the code will run with a 28ns pulse and a period of 160ns.

 

Changing the values of #define CONFIG_PLL0_MUL or #define CONFIG_PLL0_DIV by 1 in either direction I get the break message Hangaround posted above.

 

I checked the output of the 12Mhz oscillator, and it is putting out 12.00Mhz according to my 500Mhz/2Gbs scope.

 

David

 

 

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

dfansler wrote:
 

gpio_local_set_gpio_pin(PG_1_OUT);
gpio_local_clr_gpio_pin(PG_1_OUT);

 

That smacks of ASF code to me, am I right? In which case that may well be your problem - I've never used ASF myself, Atmel have written it so it's generic and can be used with all of their devices, which is fair enough, but in doing so they've made it quite bloated. In your case you're just using GPIO, in which case it's easy enough to just access the actual GPIO registers directly, so try changing your code so that you simply write directly to the PORT output register and I'd imagine you might see an increase in speed of the signal, and who knows - maybe even your issue may go away too! 

 

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

I am debugging Xmag and got the same issue for debugger in break mode. After I reinstalled the lastest version, the first time, it works fine, but again the breaking mode started and break points do not work anymore. Then I erase the whole chip, it still did not work. But after I changed the fuse setting to "reset to application" instead of "reset to bootloader", then break points start to work. This kind of makes sense and hopefully it helps.

Last Edited: Fri. Jan 12, 2018 - 04:22 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Everyone,

 

Running Atmel Studio7.

programming in assembly.

 

I was having the same issue with the Break mode and found a Solution.

I have been testing with one Atmega64A in JTAG mode.

I when I changed it to a new Atmega64A. had the same problem (Break mode)

The original worked fine, only the new one failed.

I checked the Fuses and found that new chips are programmed with fuse EXTENDED.CompMode set (turn off fuse) programmed

problem fixed.

 

I hope this helps someone

Kind Regards,

 

Federico