Programming a Nano 33 IOT over WiFi?

Hello,

Is it possible to upload new code remotely to my Nano IOT over the wifi?

Thanks!

No. You would have to implement an update over the air functionality yourself and you need to figure out whether it is possible in principle. And this is quite a complex issue. Since I guess you where looking for an out of the box solution I will not go into details. Let me know if you have any questions.

Klaus_K:
No. You would have to implement an update over the air functionality yourself and you need to figure out whether it is possible in principle. And this is quite a complex issue. Since I guess you where looking for an out of the box solution I will not go into details. Let me know if you have any questions.

I appreciate it.

I was looking for an out of the box solution but I’m willing to try and figure something out. The only issue is that I am very new to coding and may have a difficult time trying if it’s very complex. I would like to give it a try though!

If you don’t mind, I would like to know more info!

Thanks!

Ok, lets start with an easy one. You need to have a look memory size. If the memory of the device is at least twice the size of your largest program you can do everything on the device. Otherwise you might need to add some external storage e.g. a SD card.

If you cannot trust the connection you need to look into encrytion. You need to send the new firmware encryted and decrypt it on the device. For this you need to install some decryption keys. There are special trusted module chips that can be used for this or you need to find out if you can store the keys on your device. You also need a processor or peripheral helping with the decrytion algorithm.

Almost all modern microcontroller can program there internal flash memory, you need to figure out how this can be done for your device. Look at the bootloaders used by Arduinos. Since they use selfprograming the will have some code for this. Note: Flash memory cannot be erased one word at a time but only in blocks. You need to find out what functionality your device has e.g. block size. Some can only erase the entire device and this will not work.

While updating the device you will need to disable all functions that can interrupt your reprogramming. Once you deleted the old program if an interrupt is still enabled your device will crash because you do not have a program anymore.

You also need to figure out where your program runs, that reprograms the device. e.g. do you have a special bootloader available, can the program run from RAM, can you recover from a power out during programing. Your user might think the device is dead and removes the battery.

Then there is the other side. You need to create a pure hex file of your code. Compilers use different file formats e.g. some formats like DWARF contain debug information.

Then you need to package the information to be send to your device. e.g. encryption, checksum, signatures to make sure the device can verify that all information has been send and only by you and nobody else.

You also want to have a way to ensure it is save to update the device. You might not need this in your lab but when you use this in real life, you do not want to start an update when your microcontroller is doing something dangerous e.g. control a motor. We assume you are not next to the device, thats why it is wireless. :slight_smile:

Update over the air is a hot topic for current engineers and there are many more issues that are addressed. This will become more available in the next years to come, but for now you will need a lot of dedication to get this to work.

Klaus_K:
Ok, lets start with an easy one. You need to have a look memory size. If the memory of the device is at least twice the size of your largest program you can do everything on the device. Otherwise you might need to add some external storage e.g. a SD card.

If you cannot trust the connection you need to look into encrytion. You need to send the new firmware encryted and decrypt it on the device. For this you need to install some decryption keys. There are special trusted module chips that can be used for this or you need to find out if you can store the keys on your device. You also need a processor or peripheral helping with the decrytion algorithm.

Almost all modern microcontroller can program there internal flash memory, you need to figure out how this can be done for your device. Look at the bootloaders used by Arduinos. Since they use selfprograming the will have some code for this. Note: Flash memory cannot be erased one word at a time but only in blocks. You need to find out what functionality your device has e.g. block size. Some can only erase the entire device and this will not work.

While updating the device you will need to disable all functions that can interrupt your reprogramming. Once you deleted the old program if an interrupt is still enabled your device will crash because you do not have a program anymore.

You also need to figure out where your program runs, that reprograms the device. e.g. do you have a special bootloader available, can the program run from RAM, can you recover from a power out during programing. Your user might think the device is dead and removes the battery.

Then there is the other side. You need to create a pure hex file of your code. Compilers use different file formats e.g. some formats like DWARF contain debug information.

Then you need to package the information to be send to your device. e.g. encryption, checksum, signatures to make sure the device can verify that all information has been send and only by you and nobody else.

You also want to have a way to ensure it is save to update the device. You might not need this in your lab but when you use this in real life, you do not want to start an update when your microcontroller is doing something dangerous e.g. control a motor. We assume you are not next to the device, thats why it is wireless. :slight_smile:

Update over the air is a hot topic for current engineers and there are many more issues that are addressed. This will become more available in the next years to come, but for now you will need a lot of dedication to get this to work.

I really appreciate the information. I'm going to do a lot more research now and see what can be dug up. I will more than likely have more questions to come as I learn more and I'll be sure to ask here or on new threads haha.

Thanks again!

ArduinoOTA library is in Library Manager