Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Encrypted bootloader example does not work with stdio over USB #584

Open
eliasbakken opened this issue Nov 29, 2024 · 5 comments
Open

Encrypted bootloader example does not work with stdio over USB #584

eliasbakken opened this issue Nov 29, 2024 · 5 comments

Comments

@eliasbakken
Copy link

The bootloader/encrypted example works as expected when compiling it as is, data is transferred via uart. But when stdio is enabled for USB, there is only output when the enc_bootloader is run, not the final program.

Adding pico_enable_stdio_usb(hello_serial_enc 1) to the CMakeLists.txt does not render any output via USB.

@lurch
Copy link
Contributor

lurch commented Dec 2, 2024

ping @will-v-pi

@will-v-pi
Copy link
Contributor

This should be fixed when using picotool 2.1.0 (which is used by SDK 2.1.0) - see #558 and raspberrypi/picotool#150

Could you try this with SDK & picotool 2.1.0 and see if you still have this issue?

@eliasbakken
Copy link
Author

Thank you for the suggestion. I did try it, but I do not see any change on the output of the USB.

@eliasbakken
Copy link
Author

Version of picotool:
picotool v2.1.0 (Linux, GNU-12.2.0, Release)
and the ld file:

        *(.eh_frame*)
        . = ALIGN(8);
    } > RAM

    .rodata : {
        *(.rodata*)
        *(.srodata*)

@eliasbakken
Copy link
Author

It looks as though interrupts are not working when running from SRAM.
The following program will not fire when loaded with the decoding bootloader, but will fire if run from flash directly.

#include <stdio.h>
#include "pico/stdlib.h"

void gpio_callback(uint gpio, uint32_t events) {
    printf("GPIO %d\n", gpio);
}

int main() {
    stdio_uart_init();
    gpio_init(2);
    gpio_set_dir(2, GPIO_IN);
    gpio_set_irq_enabled_with_callback(2, GPIO_IRQ_EDGE_RISE | GPIO_IRQ_EDGE_FALL, true, &gpio_callback);

    while(true);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants