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 CCS Technical Support

bootloader and reset_cpu( ) [Solved]

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

bootloader and reset_cpu( ) [Solved]
PostPosted: Fri Jun 12, 2015 11:29 pm     Reply with quote

Hey,
Quite interesting thing:

1. I have bootloader
2. I have extended its size and let it read rom at location 0x00
3. If I find there 0 it means that network did request to boot in bootloader
4. I execute reset_cpu()

Problem which I have just found is that reset CPU jumps to location 0 offset by bootloader which is program memory not a bootloader.

How do I force total re-power (like hard reset) so the unit does restart in bootloader?

Thnx
_________________
Help "d" others and then you shell receive some help from "d" others.
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Sat Jun 13, 2015 12:48 am     Reply with quote

I am not quite sure why when I execute goto_address(0x00040);
somehow it ignores the instruction to read my ROM and jumps directly into the program itself.

But when I do hard reset then it works correctly.

Below is a map of memory:

Code:

               Filename:  main.lst

               ROM used:   864 bytes (1%)
                           Largest free fragment is 64172
               RAM used:   73 (2%) at main() level
                           131 (3%) worst case
               Stack used: 5 locations (4 in main + 1 for interrupts)
               Stack size: 31



+++++++++++++++++++++++++
Bootloader.c code removed.
Reason: CCS forum rule #10
10. Don't post the CCS example code or drivers.
http://www.ccsinfo.com/forum/viewtopic.php?t=26245
- Forum Moderator
+++++++++++++++++++++++++

_________________
Help "d" others and then you shell receive some help from "d" others.
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Sat Jun 13, 2015 1:19 am     Reply with quote

Solved, never mind - had a bug in main software, boot loader is ok.
I leave the code if anybody would be looking for something like that.
_________________
Help "d" others and then you shell receive some help from "d" others.
Linuxbuilders



Joined: 20 Mar 2010
Posts: 193
Location: Auckland NZ

View user's profile Send private message

PostPosted: Sun Jun 14, 2015 1:33 am     Reply with quote

+++++++++++++++++++++++++
Bootloader.c code removed.
Reason: CCS forum rule #10
10. Don't post the CCS example code or drivers.
http://www.ccsinfo.com/forum/viewtopic.php?t=26245
- Forum Moderator
+++++++++++++++++++++++++

Hi,
Please clear "internet" of your code too, GOOGLE it by file name, you may be surprised what you can find there.

However I am sorry, I could trim it a bit down. I agree here.
_________________
Help "d" others and then you shell receive some help from "d" others.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
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