View previous topic :: View next topic |
Author |
Message |
Linuxbuilders
Joined: 20 Mar 2010 Posts: 193 Location: Auckland NZ
|
bootloader and reset_cpu( ) [Solved] |
Posted: Fri Jun 12, 2015 11:29 pm |
|
|
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
|
|
Posted: Sat Jun 13, 2015 12:48 am |
|
|
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
|
|
Posted: Sat Jun 13, 2015 1:19 am |
|
|
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
|
|
Posted: Sun Jun 14, 2015 1:33 am |
|
|
+++++++++++++++++++++++++
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. |
|
|
|