Sample code does not work with SAM L11

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

I've just got a SAM L11 Xplained Pro and try to run a simple program on it.

I've tried with the LED flasher example from Atmel Smart (following " Getting Started with the SAM L10/L11 Xplained Pro" document).

Everything was built fine without errors but I don't see any LED flashing on the board.

Am I missing something? (all jumpers are untouched, in the original locations)

 

I really appreciate any help. I'm a beginner here :).

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

tarron wrote:
Everything was built fine without errors but I don't see any LED flashing on the board.

The next step is

– Load the code into the SAM L10 Xplained Pro and start debugging: Debug > Start debugging and break or ALT+F5

Did that step work and there is then no LED blinking when you

– Run the code: Debug > Continue or F5

or?

/Lars

 

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

Yes. I did that. I even set a breakpoint and confirmed that the program runs on the device (hit the breakpoint in the loop over and over) but there's still no LED blinking. I suspect that I did something wrong with the I/O pins.

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

tarron wrote:

Yes. I did that. I even set a breakpoint and confirmed that the program runs on the device (hit the breakpoint in the loop over and over) but there's still no LED blinking. I suspect that I did something wrong with the I/O pins.

 

Make sure you're using the correct secure/non-secure register alias. The CPU starts up in secure mode, and if you've made no effort to switch to non-secure mode then you need to use PORT_SEC rather than PORT to twiddle GPIOs.

The same goes for EIC, EVSYS, NVMCTRL, PAC, and PORT_IOBUS.

 

Steve

Maverick Embedded Technologies Ltd. Home of Maven and wAVR.

Maven: WiFi ARM Cortex-M Debugger/Programmer

wAVR: WiFi AVR ISP/PDI/uPDI Programmer

https://www.maverick-embedded.co...

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

(For some reasons I cant attach images) 

Please see the following links for how the code and the board look like when I run the LED flashing example.

https://ibb.co/Yjx54tX
https://ibb.co/mvdCS97

 

I also tried with "Start without debugging" and got the same result.

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

scdoubleu wrote:

tarron wrote:

Yes. I did that. I even set a breakpoint and confirmed that the program runs on the device (hit the breakpoint in the loop over and over) but there's still no LED blinking. I suspect that I did something wrong with the I/O pins.

 

Make sure you're using the correct secure/non-secure register alias. The CPU starts up in secure mode, and if you've made no effort to switch to non-secure mode then you need to use PORT_SEC rather than PORT to twiddle GPIOs.

The same goes for EIC, EVSYS, NVMCTRL, PAC, and PORT_IOBUS.

 

Steve

 

Thank you for your reply. May I ask how to set these secure/non-secure register alias? I couldn't find it in the tutorial document.

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


tarron wrote:
For some reasons I cant attach images

This: https://www.avrfreaks.net/forum/media-browser-you-are-not-authorized-access-page ?

 

But you should still be able to copy & paste images:

 

 

 

 

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...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Were you able to solve this issue? I have exactly the same problem. I'm using the example code generated by atmel studio without any modifications. I see the Trust Zone Manager init doing the following so I presume the security settings are set up correctly

 

	/* Setup Port Security Attribution of I/O Pins */
	PORT_SEC->Group[0].NONSEC.reg = CONF_PORT_INIT_NONSEC0_VAL;

	/* Setup NVIC Interrupt Target Non-Secure state */
	NVIC->ITNS[0] = CONF_NVIC_INIT_ITNS0_VAL;
	NVIC->ITNS[1] = CONF_NVIC_INIT_ITNS1_VAL;

[EDIT] The issue is indeed due to some security configuration. The LED works fine when programmed via MPLAB IDE using the Harmony library instead of ASF. Follow the instructions here - https://www.youtube.com/watch?v=...

Last Edited: Thu. Dec 23, 2021 - 03:34 PM