I upload again the code but before i have erased the chip. I want use an internal 8Mhz clock.
Thanks.
The output process is:
Processing samd21g18a (platform: atmelsam; board: samd21g18a; framework: arduino)
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: Redirecting...
PLATFORM: Atmel SAM 4.0.0 > Atmel ATSAMW25-XPRO
HARDWARE: SAMD21G18A 48MHz, 32KB RAM, 256KB Flash
DEBUG: Current (jlink) On-board (cmsis-dap) External (atmel-ice, blackmagic, jlink)
PACKAGES: toolchain-gccarmnoneeabi 1.70201.0 (7.2.1), framework-arduinosam 4.4.191002, tool-jlink 1.65200.0 (6.52.0)
LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 8 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Checking size .pio\build\samd21g18a\firmware.elf
Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
DATA: [= ] 7.2% (used 2364 bytes from 32768 bytes)
PROGRAM: [ ] 4.3% (used 11184 bytes from 262144 bytes)
Configuring upload protocol…
AVAILABLE: atmel-ice, blackmagic, cmsis-dap, jlink
CURRENT: upload_protocol = jlink
Uploading .pio\build\samd21g18a\firmware.bin
SEGGER J-Link Commander V6.52 (Compiled Sep 27 2019 17:52:04)
DLL version V6.52, compiled Sep 27 2019 17:50:11
J-Link Command File read successfully.
Processing script file…
J-Link connection not established yet but required for command.
Connecting to J-Link via USB…O.K.
Firmware: J-Link OB-STM32F072-CortexM compiled Jan 7 2019 14:09:37
Hardware version: V1.00
S/N: -1
License(s): GDB, RDI, FlashBP, FlashDL, JFlash, RDDI
VTref=3.300V
Target connection not established yet but required for command.
Device “ATSAMD21G18” selected.
Connecting to target via SWD
InitTarget()
Found SW-DP with ID 0x0BC11477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770031)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0x41003000
CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
Found Cortex-M0 r0p1, Little endian.
FPUnit: 4 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ 41003000
ROMTbl[0][0]: E00FF000, CID: B105100D, PID: 000BB4C0 ROM Table
ROMTbl[1] @ E00FF000
ROMTbl[1][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
ROMTbl[1][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
ROMTbl[1][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
ROMTbl[0][1]: 41006000, CID: B105900D, PID: 001BB932 MTB-M0+
Cortex-M0 identified.
PC = FFFFFFFE, CycleCnt = 00000000
R0 = 41004000, R1 = 40000400, R2 = 40000C00, R3 = 40000800
R4 = FFFFFF80, R5 = 00000000, R6 = 00000080, R7 = 4BBFFFDF
R8 = EAFF74FF, R9 = B9EFFEF7, R10= F9EBF6EF, R11= 8BFFEFEB
R12= 200005D8
SP(R13)= FFFFFFFC, MSP= FFFFFFFC, PSP= FCFFECF4, R14(LR) = 00000153
XPSR = A1000000: APSR = NzCvq, EPSR = 01000000, IPSR = 000 (NoException)
CFBP = 00000000, CONTROL = 00, FAULTMASK = 00, BASEPRI = 00, PRIMASK = 00
FPU regs: FPU not enabled / not implemented on connected CPU.
Downloading file [.pio\build\samd21g18a\firmware.bin]…
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (11264 bytes)
J-Link: Flash download: Total time needed: 0.332s (Prepare: 0.059s, Compare: 0.031s, Erase: 0.000s, Program: 0.221s, Verify: 0.010s, Restore: 0.009s)
O.K.
Reset delay: 0 ms
Reset type NORMAL: Resets core & peripherals via SYSRESETREQ & VECTRESET bit.
Script processing completed.
=========================================================================================== [SUCCESS] Took 5.09 seconds ===========================================================================================
And the code it is simple:
#include <Arduino.h>
void setup() {
// put your setup code here, to run once:
pinMode(PIN_PA20, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(PIN_PA20, HIGH);
delay(2000);
digitalWrite(PIN_PA20, LOW);
delay(2000);
}
my .ini file is:
[env:samd21g18a]
platform = atmelsam
board = samd21g18a
framework = arduino
; SWD interface
upload_protocol = jlink
debug_tool = jlink