ATSAMB11 debugging

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

Hello.

I have the following schematic. It is almost a copy from the ATSAMB11 datasheet with the only change that I use the same VDDIO and VBAT supply.

Schematic

On pin 24 (SPI0_SSN_SD) I have connected a led and on pin 25 (SPI0_MISO) I have connected a switch (as input) that on the other side connects to GND (no external pullups, etc).

I have also created a small program at Atmel Studio:

#define DONT_USE_CMSIS_INIT

#include <asf.h>

 

void configure_gpio_pins()

{

struct gpio_config config_gpio_pin;

gpio_get_config_defaults(&config_gpio_pin);

config_gpio_pin.direction  = GPIO_PIN_DIR_INPUT;

config_gpio_pin.input_pull = GPIO_PIN_PULL_UP;

gpio_pin_set_config(25, &config_gpio_pin);

config_gpio_pin.direction = GPIO_PIN_DIR_OUTPUT;

gpio_pin_set_config(24, &config_gpio_pin);

}

 

int main(void)

{

    /* Initialize the SAM system */

    //SystemInit();

 

    /* Replace with your application code */

configure_gpio_pins();

    while (1) 

    {

bool pin_state = gpio_pin_get_input_level(25);

gpio_pin_set_output_level(24, !pin_state);

    }

}

 

Then, I try setting breakpoints inside the main() function and try to debug it. Although the software seems to be uploaded to the microprocessor, I don't see any of the breakpoints being hit at all. Atmel studio adds automatically a breakpoint at address 0x10009000 or at address 0x1236 but I don't know what these addresses are.

I try to press the switch to see if the led will turn on but it seems like the processor is dead.

Does anyone have any idea of what might be happening?

Is it possible that although Atmel ICE recognizes the processor like bellow that it can not run any program because it might be dead?

Detected device

Device signature 0x2000B1

Revision R

Datasheet information

ATSAMB11G18A-MU

CPU CORTEX-M0

SRAM size 136 KB

VCC range 2.3 - 3.6 V

Maximum operating speed 26 MHz

 

Anyone having some advice please?

 

Thank you very much.

Last Edited: Thu. Feb 15, 2018 - 03:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

First, it looks like you've used "24" and "25" because those functions are on physical pins 24 and 25, but you should be using PIN_LP_GPIO_12 and PIN_LP_GPIO_13 instead since those are the logical GPIO numbers, and they're not the same.  :)

 

0x10009000 is the default entry point for the user application, and 0x1236 is (I think) the dispatch point.  Atmel does not provide much information about debugging without their tools (which is what I'm really interested in), but I've had success using the SAM-ICE debugger a bit - I'm not sure about Atmel-ICE.

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

It does not matter what pins I am using. It just fails to even debug the first line of code from any program. Bellow screenshot is from the iBeacon_App example program in Atmel Studio.

When I run the program it never hits the break-point although my Atmel-ICE seems to be running something (3rd LED is blinking).
When I press Pause, I get the following screen:

Getting in the call-stack line numbers like 81303688 is quite strange. Yesterday I had the same problem with a SAMD20 chip and at the end I realized I was trying to run the program in 'Release' mode and not in 'Debug'. Switching to Debug mode solved the problem. But here on the SAMB11 it is not the problem as I am in Debug mode (unless the Atmel-ICE debugger does not permit any kind of debugging). sad