iap in micropython?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
wwsheldons
Posts: 31
Joined: Wed Dec 02, 2015 1:47 pm

iap in micropython?

Post by wwsheldons » Tue Dec 08, 2015 12:23 am

can I use thr IAP funcation with micropython?

User avatar
dhylands
Posts: 3066
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: iap in micropython?

Post by dhylands » Tue Dec 08, 2015 1:30 am

What's IAP?

wwsheldons
Posts: 31
Joined: Wed Dec 02, 2015 1:47 pm

Re: iap in micropython?

Post by wwsheldons » Sun Dec 27, 2015 9:45 am

IAP:In Application Programming, via uart

User avatar
dhylands
Posts: 3066
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: iap in micropython?

Post by dhylands » Sun Dec 27, 2015 10:05 am

You can definitely do it. Are you thinking of some particular module? Or are you just talking about the concept on general?

lnsri22
Posts: 65
Joined: Fri Aug 17, 2018 12:16 pm
Location: India

Re: iap in micropython?

Post by lnsri22 » Wed Dec 19, 2018 10:18 am

Hi Dave

How could I split the internal flash memory into two banks(one for existing firmware and another for backup). I might need to do this specifically in case if I need to go for remote firmware upload with the help of a gsm module.

What if I download the firmware from remote server , place it in the sd card and then load it into the flash?, Would it be good approach?

For your reference, I have been using PyboardV11

Thanks in advance!!
lnsri22 :)

User avatar
dhylands
Posts: 3066
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: iap in micropython?

Post by dhylands » Wed Dec 19, 2018 7:32 pm

In order to do this you'll require some special common code that lives at the beginning of the flash (where the rest vector and interrupt vectors live.

It's also possible to execute code from RAM, so a common technique is that you load some code into RAM and that code copies the flash in from the new location into the execution location.

The thing to keep in mind is that if something happens before that process completes (i.e. power is removed) then you can wind up with an unbootable board that needs to be recovered by DFU.

The ISR vectors can be repositioned at runtime, so it would be possible to have some special code that lives at the default location which switches between 2 instances in flash. I'm not away of anybody that's done this for the pyboard, so while eveything is theoretically possible, there are lots of little details to work out.

While mboot doesn't support what you're trying to do, it has many of the elements that you'll need, so it would be worthwhile looking at it.

lnsri22
Posts: 65
Joined: Fri Aug 17, 2018 12:16 pm
Location: India

Re: iap in micropython?

Post by lnsri22 » Tue Jan 22, 2019 9:31 am

Thanks Dave!!
lnsri22 :)

Post Reply