arduino / arduino/ArduinoCore-mbed

RP2040 Core1 stops when connected via usb

Open
#378 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
411
Forks
225
PR merge metrics
No merged PRs in 30d

Description

after trying to fiddle with the pi pico trying to get core1 to "fade" the builtin led (pin 25 ) it would stop right after upload.
thinking it was a voltage issue (_unlikely but who knows_) i tried running it without usb and giving it 5v on Vusb directly, then it _did_ work.

(i already wrote something similar in a different issue but that was related to something else)
https://github.com/arduino/ArduinoCore-mbed/issues/217#issuecomment-1004352674

the code i used:
```
#include
#include
#include "pico/multicore.h"
#include "hardware/structs/sio.h"
#define CORE1_LED 25u
int brightness=0;
int fadevalue = 10;
void core1_loop()
{
while(1)
{
brightness=brightness+fadevalue;
if(brightness <=0 || brightness >= 2048) {
fadevalue = -fadevalue;
}
digitalWrite(CORE1_LED,HIGH);
sleep_us(brightness);
digitalWrite(CORE1_LED,LOW);
sleep_us(1000);
}
}

void setup()
{
pinMode(CORE1_LED,OUTPUT);
//multicore_reset_core1();
multicore_launch_core1(core1_loop);
}

void loop()
{
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the supplied sketch through setup(), core1_loop(), and loop() with the RP2040 connected by USB, then compare it with the reported 5V Vusb behavior. Trace the ArduinoCore-mbed RP2040 multicore and USB entry points involved in that sketch. Done means core1 continues running and the built-in LED fades while USB remains connected.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.