Repeated invocation of function "void sleep_us(uint64_t us)" can cause lockup #195
Labels
No labels
bazel
bluetooth
board settings
boot_stage2
bug
build
c++
can't reproduce
clang
clib-interface
cmsis
code cleanliness
code size
compiler version issues
cyw43_driver
debug
discussion
documentation
duplicate
dynamic_clock
elf2uf2
enhancement
errata
filesystem
flash layout
floating point
FreeRTOS
hardware_adc
hardware_claim
hardware_clocks
hardware_dma
hardware_exception
hardware_flash
hardware_gpio
hardware_i2c
hardware_irq
hardware_pio
hardware_pwm
hardware_rcp
hardware_rtc
hardware_spi
hardware_sync
hardware_uart
hardware_vreg
hardware_watchdog
hardware_xosc
help wanted
host
IAR
installation
invalid
linker scripts
lto
lwip
mbedtls
missing API
needs reporter detail
networking
newlib
newlib-multicore
non-c
non-cmake
non-gcc
openocd
orphan PR
OS integration
pico_async_context
pico_base
pico_binary_info
pico_flash
picolibc
pico_lwip
pico_malloc
pico_multicore
pico_printf
pico_runtime
pico_stdio
pico_stdio_usb
pico_sync
pico_time
pico_util
pioasm
port
question
review
review2
rtos interop
runtime init
static library
svd
test
tinyusb
vscode
wifi integration
wontfix
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
gh-raspberrypi/pico-sdk#195
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The attached code based on SDK C/C++ examples code test.c and built under Window10 demonstrates the problem:
test.zip
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/gpio.h"
#include "pico/binary_info.h"
const uint LED_PIN = 25;
int main() {
stdio_init_all();
gpio_init(LED_PIN);
gpio_set_dir(LED_PIN, GPIO_OUT);
while (1) {
gpio_put(LED_PIN, 0);
sleep_ms(250);
gpio_put(LED_PIN, 1);
puts("Hello World\n");
sleep_ms(250);
}
}
attach a UF2
UF2 attached
test-uf2.zip
Developer Command Prompt for VS2019.txt
I can see your UF2 hang; sadly i should really have asked for the ELF, but:
Can you tell me output of:
From your pico-sdk and pico-examples directories:
Can you send me the ELF that is built, and ideally see if you can reproduce it in debug mode (not sure if you are using VS Code, or cmd line, but you want to add -DCMAKE_BUILD_TYPE=Debug to your initial build setup)
Let me know if a debug build is broken too, if so send me the ELF for that as well
Finally, include the cmake output when starting from a clean/fresh build directory
Git logs, ELF and CMake output for both the original build and a clean build in GitLogsAndtestELF.zip. The clean build also reproduced the hang problem.
test-uf2.zip
The debug build using -DCMAKE_BUILD_TYPE=Debug works fine. The resultant test.uf2 loads and executes correctly. I have enclosed the ELF and CMake output for information purposes, see file test-debug.zip.
test-uf2.zip
GitLogsAndtestELF.zip
test-debug.zip
Ignore the test-uf2.zip files attached in the previous comment. The correct GitLogsAndtestELF.zip and test-debug.zip files are attached to this comment.
Would you mind trying the same thing with the
developbranch of pico-sdk, to see if that still has the same problem?ah, useful information would be that you are using stdio_usb!
but i can now reproduce the problem (only with gcc 10.2.1)
and on the develop branch
I confirm:
a) That if I switch to the develop branch of pico-sdk, then I still have the same problem.
b) I am using gcc 10.2.1 20201103 (release).
c) I am using usb serial comms.
GitLogDevelop.zip
Related PR ( #243 ) has been merged, so I guess this can be closed?
merged int 1.1.1 branch