maxgerhardt / platform-raspberrypi

Raspberry Pi: development platform for PlatformIO
Apache License 2.0
94 stars 46 forks source link

_exit.dbgasm called when debugging with VSCode, Pico becomes non-responsive #63

Open mytechnotalent opened 2 months ago

mytechnotalent commented 2 months ago

When attempting to debug this code, the exit.dbgasm is being called and causing the Pico to be unresponsive as it calls exit.

I am using a Pico Debug Probe https://www.raspberrypi.com/products/debug-probe/

CODE

#include "pico/stdlib.h"
#include "hardware/uart.h"

const int UART_TX_PIN = 12; // GPIO0 is TX for UART0
const int UART_RX_PIN = 13; // GPIO1 is RX for UART0
const int BAUD_RATE = 115200;

void setup() {
    // Initialize UART0
  uart_init(uart0, BAUD_RATE);

  // Set TX and RX pins for UART0
  gpio_set_function(UART_TX_PIN, GPIO_FUNC_UART);
  gpio_set_function(UART_RX_PIN, GPIO_FUNC_UART);

  // Enable UART0 receiver and transmitter
  uart_set_hw_flow(uart0, false, false);
  uart_set_format(uart0, 8, 1, UART_PARITY_NONE);
  Serial.begin(115200);
}

void loop() {
  volatile uint8_t num = 42;
  uart_puts(uart0, "AT+SEND=0,1,K\r\n");
  sleep_ms(10);
}

CONFIG:

[env:rpipico]
platform = https://github.com/maxgerhardt/platform-raspberrypi.git
board = rpipico
framework = arduino
board_build.core = earlephilhower
debug_tool = cmsis-dap

_exit.dbgasm:

0x10006ad8: 00 be               bkpt    0x0000
0x10006ada: fd e7               b.n 0x10006ad8 <_exit>
maxgerhardt commented 2 months ago

Does it also crash and become unresponsive when you load the same firmwarecode in the regular Arduino IDE with the Arduino-Pico core installed? If yes, better open an issue in Arduino-Pico itself.

mytechnotalent commented 2 months ago

HI @maxgerhardt first thank you for getting back. We use your work on just about everything our DEFCON local chapter codes and really appreciate your work. I have not tested on the Arduino IDE as I really prefer PlatformIO however will test for you and report back.

mytechnotalent commented 2 months ago

I was unable to reproduce in Arduino IDE.