-
Notifications
You must be signed in to change notification settings - Fork 856
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
Comments
ping @will-v-pi |
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? |
Thank you for the suggestion. I did try it, but I do not see any change on the output of the USB. |
Version of picotool:
|
It looks as though interrupts are not working when running from SRAM.
|
It looks like the issue is the This can be fixed by calling /**
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#include <stdio.h>
#include "pico/stdlib.h"
#include "hardware/sync.h"
int main() {
restore_interrupts_from_disabled(0);
stdio_init_all();
while (true) {
printf("Hello, world!\n");
printf("I'm an encrypted binary\n");
sleep_ms(1000);
}
} @kilograham Is this a fix that should be added somewhere in the |
Thanks for the update. That fix does something to interrupts. My example with the GPIO interrupt does work, but I have not gotten the USB to reset after the main program is loaded, so perhaps there are some other issues as well. Are you getting text via USB when this fix is added? |
If you have UART enabled for the bootloader and USB enabled for the main program, then you can get output from the main program over USB. If you have USB enabled for both, then you will only get USB output from the bootloader, as it's not currently possible to de-initialise then re-initialise the SDK stdio_usb, due to the lack of a |
Aha! Great, that works. Thank you. |
Might be worth keeping an eye on hathach/tinyusb#2904 ? |
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.The text was updated successfully, but these errors were encountered: