caramoan tour package

caramoan tour package

Author Topic: ELab-PhilRobotics Lean Bootloader Design  (Read 2316 times)

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #60 on: November 05, 2011, 07:28:33 AM »
I also saw that one.

Isa lang ang interrupt vector sa PIC. Kung ginamit ng bootloader ang interrupts, then mahirap i-revector ang interrupts to the application ISR.

Maybe it's simpler to lump halInitComms(),  halInitGPIO(), halInitPerip() to one init() function.

Ang halMCUReset() ba yung nag start ng application?




yes sir... inihiwalay ko kasi may mga MCU na may instruction na reset, yung wala eh watchdog reset ang ginagamit kong pangreset. bale inienable ko watchdog then hinahayaan kong magtimeout.

Quote
Maybe it's simpler to lump halInitComms(),  halInitGPIO(), halInitPerip() to one init() function.
will consider, sayang din nga instruction na matitipid sa pagtawag sa mga functions... yung setup sa main.c ay magiging halInit() sa HAL layer.
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Philippine Electronics Forum

Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #60 on: November 05, 2011, 07:28:33 AM »

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1881
  • Pogi/Ganda Points: 244
  • Gender: Male
  • Been at this longer than you've been alive.
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #61 on: November 05, 2011, 07:56:38 AM »
The bootloader does not need to init() all parts of the MCU. Yung lang parts na kailangan para gumana ang bootloader mismo.

Another issue that you may have to decide soon is the location of the bootloader. For the PIC16 and PIC18 families, the first block is called the boot block. Pwede write protected siya and the reset of the program space is writable.

Kung bottom boot then the entry point ng application may have to be fixed location or specified to the bootloader. This is also an issue for the interrupt service routine.

"Set your mind free!"

Philippine Electronics Forum

Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #61 on: November 05, 2011, 07:56:38 AM »

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #62 on: November 05, 2011, 09:06:33 AM »
Quote
The bootloader does not need to init() all parts of the MCU. Yung lang parts na kailangan para gumana ang bootloader mismo.
yup, inilagay ko lang init ng mga perip for example sa 628a, by default nakaenable comparator nila, hindi mapapagana ang GPIO(for LED perhaps) kapag enabled ang comparator, isa pang issue eh may mga application na gusto nila may default values(safe values) na pins na iba sa reset value(though dapat naman talaga sa design ng hardware ikinuconsider nila na ang safe value ng pins are reset values),


Quote
Another issue that you may have to decide soon is the location of the bootloader. For the PIC16 and PIC18 families, the first block is called the boot block. Pwede write protected siya and the reset of the program space is writable.

as mentioned sa earlier post, mas preferred ko ang sa umpisa, at di dapat nagagalaw ang reset vector, any time na burado to at nagkaron ng power interruption sigurado bricked ang unit. Yung nga lang kung maraming interrupt vectors and MCU, kailangan iremapped ito sa application space.

Quote
Ang halMCUReset() ba yung nag start ng application?
mali pala intindi ko sa question, sya po yung function na tinatawag para ireset ang MCU. it should contain a simple MCU reset instruction or watchdog initialization then infinite loop.
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Philippine Electronics Forum

Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #62 on: November 05, 2011, 09:06:33 AM »

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1881
  • Pogi/Ganda Points: 244
  • Gender: Male
  • Been at this longer than you've been alive.
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #63 on: November 05, 2011, 10:05:25 AM »
Quote
mali pala intindi ko sa question, sya po yung function na tinatawag para ireset ang MCU. it should contain a simple MCU reset instruction or watchdog initialization then infinite loop.

Diba sa application side na yan? Hindi ito kailangan within the bootloader. Restarting within the bootloader will only re-enter the bootloader.

Then dapat may separate function to start the application when the bootloader ends. This verifies if the checksum is valid and jump to the app program entry point.
"Set your mind free!"

Philippine Electronics Forum

Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #63 on: November 05, 2011, 10:05:25 AM »

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #64 on: November 05, 2011, 10:15:37 AM »
ang idea is kailangan siguraduhin ng bootloader na tama ang checksum ng program na naiload nya after bootloading otherwise it should remain in bootloader mode, normal na ginagawa ito ng bootloader every reset before jumping to application, kaya para masimplify lang ang process at di na magadd ng separate instructions(though it's just a call to function already defined) to check the checksum then jump to apps iniforce na lang natin ang reset, rather than verify checksum then decide whether to jump to app or remain on bootloader.


mas may control din ang GUI natin to end bootloading kung ganitong approach ang gagawin...
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Philippine Electronics Forum

Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #64 on: November 05, 2011, 10:15:37 AM »

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #65 on: November 05, 2011, 10:35:42 AM »
maaring di gaano magkalayo ang impact sa generated number of instructions pero I think may benefit sa control at kung documented ang design eh mas simple ang state diagram... :)
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1881
  • Pogi/Ganda Points: 244
  • Gender: Male
  • Been at this longer than you've been alive.
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #66 on: November 05, 2011, 12:13:22 PM »
Quote
mas may control din ang GUI natin to end bootloading kung ganitong approach ang gagawin...

GUI? maybe it's a misnomer. Kung may LCD display sa bootloader, that uses space that will increase the size to more than the bootblock from my experience. Baka you mean API.

Quote
maaring di gaano magkalayo ang impact sa generated number of instructions pero I think may benefit sa control at kung documented ang design eh mas simple ang state diagram...

State diagram ng alin?

Kung state diagram ng bootloader. Nothing is more simple than assuming the bootloader starts from the reset state. How it got there is irrelevant to the boot loader. Parang the "Big Bang".

Kung state diagram ng application program. IMHO, mas magiging complicated to the application software para i-access ang MCU reset function than to simply specify "reset the MCU by any means" to enter the bootloader. To the application, basta't ma reset mo MCU, tapos na ang usapan.

If you really believe kailangan ng MCU reset function sa bootloader, show me how to use it sa application side.






"Set your mind free!"

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #67 on: November 05, 2011, 10:16:37 PM »
Quote
GUI? maybe it's a misnomer. Kung may LCD display sa bootloader, that uses space that will increase the size to more than the bootblock from my experience. Baka you mean API.

I mean yung PC application na gagamitin para maiload ang hexfiles sa MCU, may control sya na i-end ang bootloading by issuing a reset command...


Perhaps Diagram would help...




If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #68 on: November 05, 2011, 10:29:34 PM »
Dun sa "Option" though it looks very simple, we still need to verify the checksum after code update just to make sure were running the correct code so it's not a simple jump to application

Kung MCU reset ang gagawin natin after bootloading, automatically at start naman eh nagchecheck tayo nun. Plus we're giving the PC application the control to end bootloading, parang warm boot.
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1881
  • Pogi/Ganda Points: 244
  • Gender: Male
  • Been at this longer than you've been alive.
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #69 on: November 06, 2011, 07:29:03 AM »
From your state diagram, the MCU remains in the "Perform Update" state until a "MCU Reset command" is received. OK, that is reasonable. It allows for a variable length firmware update. MCU reset, among other things, can initialize the firmware so that it is executable like saving the valid checksum. After MCU reset, the MCU can restart (MCU power ON).

Bale, it seems the MCU reset command is the same as "Option". Kasi after MCU reset is finished, the MCU jumps to "MCU power ON" to verify the checksum and run the application if no new bootloader request is received (bootloader timeout).



"Set your mind free!"

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1588
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #70 on: November 06, 2011, 09:00:23 AM »
I have been reading these thread over and over again. Iniwasan ko mag post ng "pa subs" to remain these thread clean.
Finally now naka subscribe na ako. Cheers! ;D
I have been using the mikroC bootloader, not so lean over 350 words sa PIC16F887/877A. But it works and sabi nila indestructible daw.
And it's a good thing open source din siya. Nakagawa ako simple addition na mag ilaw ng LED pag naka connect na siya sa GUI, but working on to turn it off pagkatapos mag update ang bootloader. Unfortunately hindi open source ang GUI.
Ang susunod na i-try ko is yung sabi ni master glutnix_neo about sa automatic reset gamit ng WDT.
Reading and learning mode muna sa conversations ng mga masters.  :)
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #71 on: November 06, 2011, 10:41:56 AM »
Bale, it seems the MCU reset command is the same as "Option". Kasi after MCU reset is finished, the MCU jumps to "MCU power ON" to verify the checksum and run the application if no new bootloader request is received (bootloader timeout).


Yes sir bale yung pagcheck lang if bootloader mode is requested ang naskipped dun, kaya mas pinili ko na ireset na lang para reset din ang states ng hardware(at least some of the hardwares, ram eh hindi, hehehe)
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Offline motion55

  • Technical People
  • Diesel Generator
  • *****
  • Posts: 1881
  • Pogi/Ganda Points: 244
  • Gender: Male
  • Been at this longer than you've been alive.
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #72 on: November 06, 2011, 10:58:04 AM »
Go! go! go!
"Set your mind free!"

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #73 on: November 07, 2011, 06:23:49 PM »
oh I got 1 problem? hindi supported ng lite hi-tech ang pic16f877a?
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Offline Kaizer03

  • Nuclear Reactor
  • ****
  • Posts: 4847
  • Pogi/Ganda Points: 225
  • C#<-->Android<-->Java
    • PhilRobotics
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #74 on: November 07, 2011, 06:29:12 PM »
^

supported yan sir.. at first lite lang din gamit ko.. at as of now lite yung gamit ni 'yus for PhilRobokit IDE...

anong version nyan?
Lend a hand for those who are in need!=)

Stop Hijacking!=) More Technical Posts!=)
 ;)

Kaizer Killer EX Pre-Alpha

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #75 on: November 07, 2011, 06:48:09 PM »
^

supported yan sir.. at first lite lang din gamit ko.. at as of now lite yung gamit ni 'yus for PhilRobokit IDE...

anong version nyan?

9.6
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #76 on: November 07, 2011, 07:07:32 PM »
up.. ;D

v9.83 (LITE) yung kasama ngayon sa IDE
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline glutnix_neo

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4162
  • Pogi/Ganda Points: 166
  • Gender: Female
  • A journey to a thousand lines begins w/ LED Blink
    • Underground Workbench
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #77 on: November 07, 2011, 07:09:17 PM »
kailangan na pala magupdate
If we hear,we forget;if we see, we remember;if we do,we understand.
Let's support the use of free and open source softwares...
http://UndergroundWorkbench.wordpress.com

Offline 'yus

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4251
  • Pogi/Ganda Points: 299
  • Gender: Male
  • hw -> fw -> sw
    • yus' projects
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #78 on: November 07, 2011, 07:33:12 PM »
may napulot na akong icon para dito :)
join  - Philippine Electronics and Robotics Enthusiasts Club - www.philrobotics.com

Offline Kaizer03

  • Nuclear Reactor
  • ****
  • Posts: 4847
  • Pogi/Ganda Points: 225
  • C#<-->Android<-->Java
    • PhilRobotics
Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #79 on: November 07, 2011, 07:37:42 PM »
may napulot na akong icon para dito :)



haha talagang pinepressure? :D


--

9.82 gamit ko for PhilRobokit Library..
Lend a hand for those who are in need!=)

Stop Hijacking!=) More Technical Posts!=)
 ;)

Kaizer Killer EX Pre-Alpha

Philippine Electronics Forum

Re: ELab-PhilRobotics Lean Bootloader Design
« Reply #79 on: November 07, 2011, 07:37:42 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com