Arduino nano L Lights up and sketch restarts

My nano runs this programm for about 30 sek, then the L Led flashes (Pin 13) and the sketch restarts. After the first flash, L starts flashing rapidly and the programm always gets reseted. What can i do?

I'm new to arduino so any help is appreceated!

#include <FastLED.h>

FASTLED_USING_NAMESPACE

// FastLED "100-lines-of-code" demo reel, showing just a few 
// of the kinds of animation patterns you can quickly and easily 
// compose using FastLED.  
//
// This example also shows one easy way to define multiple 
// animations patterns and have them automatically rotate.
//
// -Mark Kriegsman, December 2014

#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif

const int buttonPin = 2;     // the number of the pushbutton pin
int buttonState = 0;         // variable for reading the pushbutton status
int buttonhigh = 0;         // variable for reading the pushbutton status



#define DATA_PIN    3
//#define CLK_PIN   4
#define LED_TYPE    WS2812B
#define COLOR_ORDER GRB
#define NUM_LEDS    20
CRGB leds[NUM_LEDS];

#define BRIGHTNESS          96
#define FRAMES_PER_SECOND  100

void setup() {
  delay(1000); // 3 second delay for recovery


  pinMode(buttonPin, INPUT); // initialize the pushbutton pin as an input:
  
  // tell FastLED about the LED strip configuration
  FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
  //FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);

  // set master brightness control
  FastLED.setBrightness(BRIGHTNESS);
}


// List of patterns to cycle through.  Each is defined as a separate function below.
typedef void (*SimplePatternList[])();
SimplePatternList gPatterns = { rainbow, sinelon, bpm };

uint8_t gCurrentPatternNumber = 0; // Index number of which pattern is current
uint8_t gHue = 0; // rotating "base color" used by many of the patterns
  
void loop()
{
  // Call the current pattern function once, updating the 'leds' array
  gPatterns[gCurrentPatternNumber]();

  // send the 'leds' array out to the actual LED strip
  FastLED.show();  
  // insert a delay to keep the framerate modest
  FastLED.delay(1000/FRAMES_PER_SECOND); 

  // do some periodic updates
  EVERY_N_MILLISECONDS( 20 ) { gHue++; } // slowly cycle the "base color" through the rainbow

  buttonState = digitalRead(buttonPin); //read button state
    if (buttonState == HIGH) {
    buttonhigh = 1;
    
  } else {
    if (buttonhigh == 1) {
    buttonhigh = 0;
    nextPattern();
    }
    }

}

#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))

void nextPattern()
{
  // add one to the current pattern number, and wrap around at the end
  gCurrentPatternNumber = (gCurrentPatternNumber + 1) % ARRAY_SIZE( gPatterns);
}

void rainbow() 
{
  // FastLED's built-in rainbow generator
  fill_rainbow( leds, NUM_LEDS, gHue, 7);
}

void sinelon()
{
  // a colored dot sweeping back and forth, with fading trails
  fadeToBlackBy( leds, NUM_LEDS, 20);
  int pos = beatsin16( 13, 0, NUM_LEDS-1 );
  leds[pos] += CHSV( gHue, 255, 192);
}

void bpm()
{
  // colored stripes pulsing at a defined Beats-Per-Minute (BPM)
  uint8_t BeatsPerMinute = 62;
  CRGBPalette16 palette = PartyColors_p;
  uint8_t beat = beatsin8( BeatsPerMinute, 64, 255);
  for( int i = 0; i < NUM_LEDS; i++) { //9948
    leds[i] = ColorFromPalette(palette, gHue+(i*2), beat-gHue+(i*10));
  }
}

How do you power the strip? You can't power it from the 5V output of the Nano as it can't supply sufficient current. 20 leds times 3 time 20 mA (or so, not quite sure) is 1.2A worst case scenario, all leds on max).

sterretje:
How do you power the strip? You can't power it from the 5V output of the Nano as it can't supply sufficient current. 20 leds times 3 time 20 mA (or so, not quite sure) is 1.2A worst case scenario, all leds on max).

The Strip is powerd by a 2 amps usb powerbank, the nano is in parallel to the strip so there should be no problem.

The same problem appears when i plug in the nano to upload a new sketch. If i am fast and the programm uploads in like 15 sec there is no problem. If it is pluged in longer the pc shows out of sync errors.

If also added a simple paint circutplan.

Even when i upload the blink sketch, while powering the nano only by the usb pc connection and with the lightstrip removed, the blinking gets nonrythimc after a short time.

Could this be a problem with the watchdog?

The bootloader on old official and all clone Nanos does have a bug where it goes into an endless reset loop after a watchdog reset:

As long as you have the ATmega328P Nano, to fix that, you can select Tools > Board > Arduino/Genuino Uno and then burn the bootloader to your Nano. Then use the Nano as an Uno from then on. The Uno bootloader doesn't have that bug and it also frees up 1.5 kB of flash memory. If you have the rare ATmega168 Nano, there is another easy way to do this.