Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 04, 2016, 11:23:25 11:23


Login with username, password and session length


Pages: [1]
Print
Author Topic: OTA - Over-The-Air Programming  (Read 1766 times)
0 Members and 1 Guest are viewing this topic.
OrciBorg
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 52
-Receive: 7


« on: October 15, 2013, 02:37:06 14:37 »

Hi,

I have a circuit, a data logger and need to update the firmware using GPRS

And I need example and information about OTA.

I using SIM900D with PIC 18LF46K80 and CCS compliler.

Can anyone help ?

Thnaks in advance
Logged
LzEn
Junior Member
**
Offline Offline

Posts: 78

Thank You
-Given: 45
-Receive: 82


Lazy Efficient


« Reply #1 on: October 17, 2013, 06:58:35 18:58 »

Hey Orci I can give you some tips but I can't give you a working example.

1- You need to divide your program memory into 3 parts: Bootloader, Current Program Code, New Program Code.
2- The bootloader starts at address 0x0000, it is the first code that will be loaded, at the end of the bootloader you will have a jump routine with the starting address of the "Current Code". The bootloader is responsible of writing the New Code once it is received.
3- Send the "New Code" as hex data taken from the compiler output to the PIC with OTA.
4- Check that all the data is received, and if it is received check if it is the correct data. (Usually with CRC)
5- After the checking is completed, call the bootloader in order to write the data to the right addresses. (The addresses can be found in the hex code sent, check this LINK for more details about the composition of the hex file for PIC MCU.

Notes:
1- Edit your compiler settings, to make sure the bootloader compiles at address 0x0000.
2- Edit your compiler settings, to make sure the Current Code compiles at the defined starting address.
3- Edit the address for the interrupts to make it Current Code Starting Address + Old Interrupt Address
4- Compile the bootloader get the hex file, compile the Current Code get the hex file. With a text editor, join the two files and program the PIC with the new code.

Hope it helps somehow
Logged

~ Laziness Is The Mother Of Efficiency ~
OrciBorg
Newbie
*
Offline Offline

Posts: 19

Thank You
-Given: 52
-Receive: 7


« Reply #2 on: October 19, 2013, 02:25:50 14:25 »

Thank you, LzEn. I'll get the bootloader of CCS and make some changes and do what you said.

WIth these tips you've helped me a lot.

Logged
LzEn
Junior Member
**
Offline Offline

Posts: 78

Thank You
-Given: 45
-Receive: 82


Lazy Efficient


« Reply #3 on: October 19, 2013, 05:11:21 17:11 »

No problem anytime. Let us know how it goes...
Logged

~ Laziness Is The Mother Of Efficiency ~
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC