I have a strange thing happening when I send a sketch to a Nano 33 BLE. The code will execute just fine. When I disconnect the device from power and apply power again, the code will not execute. I have to upload the sketch again and it works until I power cycle the device. I am using the ble_shining_kb.ino example code. My expectation is, when I apply power once again to the device it will begin to advertise itself but nothing happens.
Any thoughts on what user error is occurring would be greatly appreciated.
This is a very basic example. If I compile and upload this sketch then it provides output on the Serial Monitor as expected. If I power cycle the Nano 33 BLE then nothing is happening. You are correct, maybe it is acting differently but of all the boards I have sent programs to, I have never experienced this. This is the first time I have posted a code snip, pardon my error if I use the incorrect format.
I can confirm you findings. With IDE 1.8.19 The native usb does not restart in the monitor on a reset or power cycle. The monitor needs to be closed and reopened.
This behaviour is not seen with IDE V2.0 which does restart with a power cycle or reset.
That depends on the operating system you're using. On Linux you have to change the serial port because the old name is still used by the old connection when the board reconnects to the host.
Use a more basic sketch as blinking the LED. Does that work?
Actually, I am using the 2.0.0 Arduino IDE and cannot get any sketch to persist across power cycling. Below I also tried Blink as pylon recommended, still does not persist. I am running modern MacOS. Only thing I changed on the Blink is the delay(), I extended a bit. I first saw this when working on a BLE HID application and now have broken down to the blink example as well. So to me, it is not specific to a port issue. I appreciate the input so far!
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(2000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(2000); // wait for a second
}
My successful restarts with IDE 2.0 noted on post # 4 was with Windows 10. I would suggest that you ask a moderator to move this posting to the IDE 2.0 section of the forum. That section is well monitored by people from the development team.
Does that mean you upload that blink code to the Nano 33 BLE and it blinks but after a power cycle it doesn't blink anymore? Does that mean the nRF processor is able to run sketches from the RAM? I'm no expert on that platform, I thought all Arduino platforms store sketches directly to the flash before starting them.