0

Feather Rp2040 not working after unplugging/hitting reset bu
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Feather Rp2040 not working after unplugging/hitting reset bu

by muralivnv on Sun May 02, 2021 11:53 pm

I downloaded pico-sdk from https://github.com/raspberrypi/pico-sdk and built the below blink test file to generate .UF2 file. After uploading the file onto feather by entering into BOOT mode, the drive RPI-PI2 on windows disappears and I can see the red LED blinking. Now when I unplug the feather and plug it back into USB/when I hit RESET button, the program doesn't restart and I see no led getting blinked.

Any insight into this is very much appreciated.

Blink.c
Code: Select all | TOGGLE FULL SIZE
#include "pico/stdlib.h"
int main()
{
  const uint led_pin = 13;
  gpio_init(led_pin);
  gpio_set_dir(led_pin, GPIO_OUT);
  gpio_put(led_pin, 1);

  while(true)
  {
    gpio_put(led_pin, 1);
    sleep_ms(2000);
    gpio_put(led_pin, 0);
    sleep_ms(2000);
  }
}

muralivnv
 
Posts: 2
Joined: Sun May 02, 2021 11:25 pm

Re: Feather Rp2040 not working after unplugging/hitting rese

by muralivnv on Sat May 15, 2021 6:14 pm

After some debugging, I found the reason for this issue.

Solution : In the project CMakeLists.txt, we need to define the variable PICO_BOARD to adafruit_feather_rp2040 before including pico_sdk_import.cmake file.

CMakeLists.txt
Code: Select all | TOGGLE FULL SIZE
# setup PICO specific variables
set(PICO_PLATFORM rp2040)
set(PICO_BOARD adafruit_feather_rp2040)

# setup pick-sdk-path
set(PICO_SDK_PATH ${CMAKE_CURRENT_SOURCE_DIR}/pico-sdk)
include(${CMAKE_CURRENT_SOURCE_DIR}/app/pico_sdk_import.cmake)

# Initiate main project
project(PROJECT_NAME C CXX ASM)

# setup C/C++ standards
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)

# initialize pico-sdk
pico_sdk_init()


muralivnv
 
Posts: 2
Joined: Sun May 02, 2021 11:25 pm

Please be positive and constructive with your questions and comments.