CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Does #ORG it's only 16bit wide?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

PostPosted: Sun Jan 10, 2021 4:59 pm     Reply with quote

Ok, good news, I have two separated HEX files, once with the bootloader and once with the main program correctly addressed.

Now, I need to flash both HEX files at once, Is this possible? What are the options?
_________________
Electric Blue
temtronic



Joined: 01 Jul 2010
Posts: 9097
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Jan 10, 2021 5:11 pm     Reply with quote

Possible ? Yes.. though you'll have to either search this forum of 'how to do it' or wait until someone else replies who has done it.

Normally you burn( download) the 'downloader' program, then get it to download the 'real' program.

One possible are the 'fuses' they MUST be identical for both bootloader and 'main() program. Big thing is to be sure the memory where bootloader is stored is protected !

I am curious as to why you want to download both bootloader and main() at the same time ? If you do it that way, you bypass the downloading feature and cannot 'test and confirm' that everything works.

Jay
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

PostPosted: Sun Jan 10, 2021 5:19 pm     Reply with quote

I'm trying to make a FOTA.
So the bootloader download the firmware using a GPRS modem or a WiFi module.
But the device must be running when the client install it.
A device with only the bootloader is worthless to a client.
The FOTA is just an option in case the client request an update.
In a normal use the client will never use FOTA but the firmware that we burn it in the device.
_________________
Electric Blue
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jan 10, 2021 7:31 pm     Reply with quote

E_Blue wrote:
I have two separated HEX files, once with the bootloader and once with the main program correctly addressed.

I need to flash both HEX files at once, Is this possible?

See Ttelmah's answer in this thread. He explains how to do it:
http://www.ccsinfo.com/forum/viewtopic.php?t=55241
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

PostPosted: Sun Jan 10, 2021 9:28 pm     Reply with quote

Thanks to everyone for your help and patience.
After like 20 minutes I have a solid HEX file.

Just one more thing; once the bootloader ends must jump to the main code; I can do that with a GOTO in assembler but I want to have some portability to PIC24FJ family.

I just found goto_address() function, It is ok to use this or is too dirty?
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Mon Jan 11, 2021 1:02 am     Reply with quote

Look at the examples.

The bootloader example, shows how to handle the interrupt relocation,
and how to jump to the 'application'. The really important one is the
special jump_to_isr instruction used to handle the interrupt vectoring.
E_Blue



Joined: 13 Apr 2011
Posts: 406

View user's profile Send private message

PostPosted: Mon Jan 11, 2021 8:38 am     Reply with quote

Yes, the ISR is ok, But I didn't understood the jump from bootloader to main program. I will re read the example.
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19215

View user's profile Send private message

PostPosted: Mon Jan 11, 2021 10:35 am     Reply with quote

There isn't a separate jump.
They put a dummy application at the same location, which never returns,
and simply call this.
Result the compiler generates a jump to this.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group